diff --git a/.buildkite/scripts/build_kibana.sh b/.buildkite/scripts/build_kibana.sh index a7fbcc0ea4b92..482f730284a94 100755 --- a/.buildkite/scripts/build_kibana.sh +++ b/.buildkite/scripts/build_kibana.sh @@ -8,7 +8,7 @@ echo "--- Build Kibana Distribution" if [[ "${GITHUB_PR_LABELS:-}" == *"ci:build-all-platforms"* ]]; then node scripts/build --all-platforms --skip-os-packages elif [[ "${GITHUB_PR_LABELS:-}" == *"ci:build-os-packages"* ]]; then - node scripts/build --all-platforms + node scripts/build --all-platforms --docker-cross-compile else node scripts/build fi diff --git a/.buildkite/scripts/steps/artifacts/build.sh b/.buildkite/scripts/steps/artifacts/build.sh index 211bfddecd010..db1faa184b35a 100644 --- a/.buildkite/scripts/steps/artifacts/build.sh +++ b/.buildkite/scripts/steps/artifacts/build.sh @@ -5,7 +5,7 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh echo "--- Build Kibana Distribution" -node scripts/build --all-platforms --debug --skip-docker-cloud +node scripts/build --all-platforms --debug --docker-cross-compile --skip-docker-cloud echo "--- Build dependencies report" node scripts/licenses_csv_report --csv=target/dependencies_report.csv diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1ccad2a3ac36d..1d4eb2ba39cd5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -41,6 +41,7 @@ /src/plugins/chart_expressions/expression_heatmap/ @elastic/kibana-vis-editors /src/plugins/chart_expressions/expression_gauge/ @elastic/kibana-vis-editors /src/plugins/chart_expressions/expression_partition_vis/ @elastic/kibana-vis-editors +/src/plugins/chart_expressions/expression_xy/ @elastic/kibana-vis-editors /src/plugins/url_forwarding/ @elastic/kibana-vis-editors /packages/kbn-tinymath/ @elastic/kibana-vis-editors /x-pack/test/functional/apps/lens @elastic/kibana-vis-editors diff --git a/.i18nrc.json b/.i18nrc.json index 71b68d2c51d85..908963ca4d991 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -26,6 +26,7 @@ "expressionMetric": "src/plugins/expression_metric", "expressionMetricVis": "src/plugins/chart_expressions/expression_metric", "expressionPartitionVis": "src/plugins/chart_expressions/expression_partition_vis", + "expressionXY": "src/plugins/chart_expressions/expression_xy", "expressionRepeatImage": "src/plugins/expression_repeat_image", "expressionRevealImage": "src/plugins/expression_reveal_image", "expressions": "src/plugins/expressions", diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index c00062734239e..4a2e6ddf76b17 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -58,7 +58,6 @@ yarn_install( data = [ "//:.yarnrc", "//:preinstall_check.js", - "//:node_modules/.yarn-integrity", ], exports_directories_only = True, symlink_node_modules = True, diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index b6cac30c1bc88..0b9e48020c680 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -164,6 +164,10 @@ for use in their own application. |Expression Tagcloud plugin adds a tagcloud renderer and function to the expression plugin. The renderer will display the Wordcloud chart. +|{kib-repo}blob/{branch}/src/plugins/chart_expressions/expression_xy/README.md[expressionXY] +|Expression XY plugin adds a xy renderer and function to the expression plugin. The renderer will display the xy chart. + + |{kib-repo}blob/{branch}/src/plugins/field_formats/README.md[fieldFormats] |Index pattern fields formatters diff --git a/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.md b/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.md index defbf79b0ffe2..86117422e5faf 100644 --- a/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.md +++ b/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.md @@ -23,6 +23,7 @@ export interface OverlayFlyoutOpenOptions | [maskProps?](./kibana-plugin-core-public.overlayflyoutopenoptions.maskprops.md) | EuiOverlayMaskProps | (Optional) | | [maxWidth?](./kibana-plugin-core-public.overlayflyoutopenoptions.maxwidth.md) | boolean \| number \| string | (Optional) | | [onClose?](./kibana-plugin-core-public.overlayflyoutopenoptions.onclose.md) | (flyout: OverlayRef) => void | (Optional) EuiFlyout onClose handler. If provided the consumer is responsible for calling flyout.close() to close the flyout; | +| [outsideClickCloses?](./kibana-plugin-core-public.overlayflyoutopenoptions.outsideclickcloses.md) | boolean | (Optional) | | [ownFocus?](./kibana-plugin-core-public.overlayflyoutopenoptions.ownfocus.md) | boolean | (Optional) | | [size?](./kibana-plugin-core-public.overlayflyoutopenoptions.size.md) | EuiFlyoutSize | (Optional) | diff --git a/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.outsideclickcloses.md b/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.outsideclickcloses.md new file mode 100644 index 0000000000000..acb9bac6f55da --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.overlayflyoutopenoptions.outsideclickcloses.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [OverlayFlyoutOpenOptions](./kibana-plugin-core-public.overlayflyoutopenoptions.md) > [outsideClickCloses](./kibana-plugin-core-public.overlayflyoutopenoptions.outsideclickcloses.md) + +## OverlayFlyoutOpenOptions.outsideClickCloses property + +Signature: + +```typescript +outsideClickCloses?: boolean; +``` diff --git a/docs/settings/alert-action-settings.asciidoc b/docs/settings/alert-action-settings.asciidoc index 8f365381f1b8e..51fa0b71f9601 100644 --- a/docs/settings/alert-action-settings.asciidoc +++ b/docs/settings/alert-action-settings.asciidoc @@ -185,13 +185,6 @@ For example, `20m`, `24h`, `7d`, `1w`. Default: `60s`. `xpack.alerting.maxEphemeralActionsPerAlert`:: Sets the number of actions that will be executed ephemerally. To use this, enable ephemeral tasks in task manager first with <> -`xpack.alerting.defaultRuleTaskTimeout`:: -Specifies the default timeout for the all rule types tasks. The time is formatted as: -+ -`[ms,s,m,h,d,w,M,Y]` -+ -For example, `20m`, `24h`, `7d`, `1w`. Default: `5m`. - `xpack.alerting.cancelAlertsOnRuleTimeout`:: Specifies whether to skip writing alerts and scheduling actions if rule execution is cancelled due to timeout. Default: `true`. This setting can be overridden by individual rule types. @@ -207,3 +200,22 @@ Specifies the behavior when a new or changed rule has a schedule interval less t `xpack.alerting.rules.execution.actions.max`:: Specifies the maximum number of actions that a rule can trigger each time detection checks run. + +`xpack.alerting.rules.execution.timeout`:: +Specifies the default timeout for tasks associated with all types of rules. The time is formatted as: ++ +`[ms,s,m,h,d,w,M,Y]` ++ +For example, `20m`, `24h`, `7d`, `1w`. Default: `5m`. + +`xpack.alerting.rules.execution.ruleTypeOverrides`:: +Overrides the configs under `xpack.alerting.rules.execution` for the rule type with the given ID. List the rule identifier and its settings in an array of objects. ++ +For example: +``` +xpack.alerting.rules.execution: + timeout: '5m' + ruleTypeOverrides: + - id: '.index-threshold' + timeout: '15m' +``` \ No newline at end of file diff --git a/package.json b/package.json index ca95f41569310..b8ec92ab796d6 100644 --- a/package.json +++ b/package.json @@ -418,7 +418,7 @@ "usng.js": "^0.4.5", "utility-types": "^3.10.0", "uuid": "3.3.2", - "vega": "^5.22.0", + "vega": "^5.22.1", "vega-interpreter": "^1.0.4", "vega-lite": "^5.2.0", "vega-schema-url-parser": "^2.2.0", diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 526c1ff5dad82..34c2285016086 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -124,4 +124,5 @@ pageLoadAssetSize: sessionView: 77750 cloudSecurityPosture: 19109 visTypeGauge: 24113 + expressionXY: 41392 eventAnnotation: 19334 diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index 99ab81d2b539f..b086f398faea4 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -8921,15 +8921,11 @@ const BootstrapCommand = { ms: Date.now() - start }); } - }; // Force install is set in case a flag is passed or - // if the `.yarn-integrity` file is not found which - // will be indicated by the return of yarnIntegrityFileExists. + }; // Force install is set in case a flag is passed into yarn kbn bootstrap or if the `.yarn-integrity` + // file is not found which will be indicated by the return of yarnIntegrityFileExists. - const forceInstall = !!options && options['force-install'] === true || !(await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["yarnIntegrityFileExists"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(kibanaProjectPath, 'node_modules'))); // Ensure we have a `node_modules/.yarn-integrity` file as we depend on it - // for bazel to know it has to re-install the node_modules after a reset or a clean - - await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["ensureYarnIntegrityFileExists"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(kibanaProjectPath, 'node_modules')); // Install bazel machinery tools if needed + const forceInstall = !!options && options['force-install'] === true || !(await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["yarnIntegrityFileExists"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(kibanaProjectPath, 'node_modules'))); // Install bazel machinery tools if needed await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["installBazelTools"])(rootPath); // Setup remote cache settings in .bazelrc.cache if needed @@ -8945,6 +8941,8 @@ const BootstrapCommand = { if (forceInstall) { await time('force install dependencies', async () => { + await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["removeYarnIntegrityFileIfExists"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(kibanaProjectPath, 'node_modules')); + await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["runBazel"])(['clean']); await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["runBazel"])(['run', '@nodejs//:yarn'], runOffline, { env: { SASS_BINARY_SITE: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-sass', @@ -52653,25 +52651,25 @@ function addProjectToTree(tree, pathParts, project) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _yarn_integrity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(423); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "yarnIntegrityFileExists", function() { return _yarn_integrity__WEBPACK_IMPORTED_MODULE_0__["yarnIntegrityFileExists"]; }); +/* harmony import */ var _get_cache_folders__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(423); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBazelDiskCacheFolder", function() { return _get_cache_folders__WEBPACK_IMPORTED_MODULE_0__["getBazelDiskCacheFolder"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ensureYarnIntegrityFileExists", function() { return _yarn_integrity__WEBPACK_IMPORTED_MODULE_0__["ensureYarnIntegrityFileExists"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBazelRepositoryCacheFolder", function() { return _get_cache_folders__WEBPACK_IMPORTED_MODULE_0__["getBazelRepositoryCacheFolder"]; }); -/* harmony import */ var _get_cache_folders__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(424); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBazelDiskCacheFolder", function() { return _get_cache_folders__WEBPACK_IMPORTED_MODULE_1__["getBazelDiskCacheFolder"]; }); +/* harmony import */ var _install_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(424); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBazelBinAvailable", function() { return _install_tools__WEBPACK_IMPORTED_MODULE_1__["isBazelBinAvailable"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBazelRepositoryCacheFolder", function() { return _get_cache_folders__WEBPACK_IMPORTED_MODULE_1__["getBazelRepositoryCacheFolder"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "installBazelTools", function() { return _install_tools__WEBPACK_IMPORTED_MODULE_1__["installBazelTools"]; }); -/* harmony import */ var _install_tools__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(425); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBazelBinAvailable", function() { return _install_tools__WEBPACK_IMPORTED_MODULE_2__["isBazelBinAvailable"]; }); +/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(425); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runBazel", function() { return _run__WEBPACK_IMPORTED_MODULE_2__["runBazel"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "installBazelTools", function() { return _install_tools__WEBPACK_IMPORTED_MODULE_2__["installBazelTools"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runIBazel", function() { return _run__WEBPACK_IMPORTED_MODULE_2__["runIBazel"]; }); -/* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(426); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runBazel", function() { return _run__WEBPACK_IMPORTED_MODULE_3__["runBazel"]; }); +/* harmony import */ var _yarn_integrity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(527); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeYarnIntegrityFileIfExists", function() { return _yarn_integrity__WEBPACK_IMPORTED_MODULE_3__["removeYarnIntegrityFileIfExists"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "runIBazel", function() { return _run__WEBPACK_IMPORTED_MODULE_3__["runIBazel"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "yarnIntegrityFileExists", function() { return _yarn_integrity__WEBPACK_IMPORTED_MODULE_3__["yarnIntegrityFileExists"]; }); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one @@ -52689,53 +52687,6 @@ __webpack_require__.r(__webpack_exports__); /* 423 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "yarnIntegrityFileExists", function() { return yarnIntegrityFileExists; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureYarnIntegrityFileExists", function() { return ensureYarnIntegrityFileExists; }); -/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); -/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(231); -/* - * 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. - */ - - -async function yarnIntegrityFileExists(nodeModulesPath) { - try { - const nodeModulesRealPath = await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["tryRealpath"])(nodeModulesPath); - const yarnIntegrityFilePath = Object(path__WEBPACK_IMPORTED_MODULE_0__["join"])(nodeModulesRealPath, '.yarn-integrity'); // check if the file already exists - - if (await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["isFile"])(yarnIntegrityFilePath)) { - return true; - } - } catch {// no-op - } - - return false; -} -async function ensureYarnIntegrityFileExists(nodeModulesPath) { - try { - const nodeModulesRealPath = await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["tryRealpath"])(nodeModulesPath); - const yarnIntegrityFilePath = Object(path__WEBPACK_IMPORTED_MODULE_0__["join"])(nodeModulesRealPath, '.yarn-integrity'); // ensure node_modules folder is created - - await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["mkdirp"])(nodeModulesRealPath); // write a blank file in case it doesn't exists - - await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["writeFile"])(yarnIntegrityFilePath, '', { - flag: 'wx' - }); - } catch {// no-op - } -} - -/***/ }), -/* 424 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBazelDiskCacheFolder", function() { return getBazelDiskCacheFolder; }); @@ -52770,7 +52721,7 @@ async function getBazelRepositoryCacheFolder() { } /***/ }), -/* 425 */ +/* 424 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -52889,7 +52840,7 @@ async function installBazelTools(repoRootPath) { } /***/ }), -/* 426 */ +/* 425 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -52899,8 +52850,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(114); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9); -/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(427); -/* harmony import */ var _kbn_dev_utils_stdio__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(525); +/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(426); +/* harmony import */ var _kbn_dev_utils_stdio__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(524); /* harmony import */ var _kbn_dev_utils_stdio__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_kbn_dev_utils_stdio__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _child_process__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(221); /* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(220); @@ -52966,141 +52917,141 @@ async function runIBazel(bazelArgs, offline = false, runOpts = {}) { } /***/ }), -/* 427 */ +/* 426 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(428); +/* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(427); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; }); -/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(429); +/* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(428); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; }); -/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(430); +/* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(429); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; }); -/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(431); +/* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(430); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; }); -/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(432); +/* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(431); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; }); -/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(433); +/* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(432); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; }); -/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(434); +/* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(433); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; }); -/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(435); +/* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(434); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; }); -/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(436); +/* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(435); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; }); -/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(437); +/* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(436); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; }); -/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(438); +/* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(437); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; }); /* harmony import */ var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; }); -/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(439); +/* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(438); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; }); -/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(440); +/* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(439); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; }); -/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(441); +/* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(440); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; }); -/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(442); +/* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(441); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; }); -/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(443); +/* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(442); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; }); -/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(444); +/* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(443); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; }); -/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(445); +/* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(444); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; }); -/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(447); +/* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(446); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; }); -/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(448); +/* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(447); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; }); -/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(449); +/* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(448); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; }); -/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(450); +/* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(449); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; }); -/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(451); +/* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(450); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; }); -/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(452); +/* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(451); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; }); -/* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(455); +/* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(454); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__["endWith"]; }); -/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(456); +/* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(455); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__["every"]; }); -/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(457); +/* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(456); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__["exhaust"]; }); -/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(458); +/* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(457); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__["exhaustMap"]; }); -/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(459); +/* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(458); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__["expand"]; }); /* harmony import */ var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(106); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__["filter"]; }); -/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(460); +/* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(459); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__["finalize"]; }); -/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(461); +/* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(460); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__["find"]; }); -/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(462); +/* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(461); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__["findIndex"]; }); -/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(463); +/* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(462); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__["first"]; }); /* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(32); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__["groupBy"]; }); -/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(464); +/* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(463); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__["ignoreElements"]; }); -/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(465); +/* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(464); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__["isEmpty"]; }); -/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(466); +/* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(465); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__["last"]; }); /* harmony import */ var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(67); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__["map"]; }); -/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(468); +/* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(467); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__["mapTo"]; }); -/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(469); +/* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(468); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__["materialize"]; }); -/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(470); +/* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(469); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__["max"]; }); -/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(473); +/* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(472); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__["merge"]; }); /* harmony import */ var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(82); @@ -53111,175 +53062,175 @@ __webpack_require__.r(__webpack_exports__); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["flatMap"]; }); -/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(474); +/* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(473); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__["mergeMapTo"]; }); -/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(475); +/* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(474); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__["mergeScan"]; }); -/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(476); +/* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(475); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__["min"]; }); -/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(477); +/* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(476); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__["multicast"]; }); /* harmony import */ var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(42); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__["observeOn"]; }); -/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(478); +/* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(477); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__["onErrorResumeNext"]; }); -/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(479); +/* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(478); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__["pairwise"]; }); -/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(480); +/* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(479); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__["partition"]; }); -/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(481); +/* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(480); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__["pluck"]; }); -/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(482); +/* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(481); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__["publish"]; }); -/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(483); +/* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(482); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__["publishBehavior"]; }); -/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(484); +/* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(483); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__["publishLast"]; }); -/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(485); +/* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(484); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__["publishReplay"]; }); -/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(486); +/* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(485); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__["race"]; }); -/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(471); +/* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(470); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__["reduce"]; }); -/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(487); +/* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(486); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__["repeat"]; }); -/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(488); +/* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(487); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__["repeatWhen"]; }); -/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(489); +/* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(488); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__["retry"]; }); -/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(490); +/* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(489); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__["retryWhen"]; }); /* harmony import */ var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(31); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__["refCount"]; }); -/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(491); +/* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(490); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__["sample"]; }); -/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(492); +/* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(491); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__["sampleTime"]; }); -/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(472); +/* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(471); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__["scan"]; }); -/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(493); +/* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(492); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__["sequenceEqual"]; }); -/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(494); +/* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(493); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__["share"]; }); -/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(495); +/* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(494); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__["shareReplay"]; }); -/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(496); +/* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(495); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__["single"]; }); -/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(497); +/* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(496); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__["skip"]; }); -/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(498); +/* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(497); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__["skipLast"]; }); -/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(499); +/* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(498); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__["skipUntil"]; }); -/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(500); +/* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(499); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__["skipWhile"]; }); -/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(501); +/* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(500); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__["startWith"]; }); -/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(502); +/* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(501); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__["subscribeOn"]; }); -/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(504); +/* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(503); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__["switchAll"]; }); -/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(505); +/* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(504); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__["switchMap"]; }); -/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(506); +/* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(505); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__["switchMapTo"]; }); -/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(454); +/* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(453); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__["take"]; }); -/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(467); +/* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(466); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__["takeLast"]; }); -/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(507); +/* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(506); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__["takeUntil"]; }); -/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(508); +/* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(507); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__["takeWhile"]; }); -/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(509); +/* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(508); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__["tap"]; }); -/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(510); +/* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(509); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__["throttle"]; }); -/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(511); +/* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(510); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__["throttleTime"]; }); -/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(453); +/* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(452); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__["throwIfEmpty"]; }); -/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(512); +/* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(511); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__["timeInterval"]; }); -/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(513); +/* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(512); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__["timeout"]; }); -/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(514); +/* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(513); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__["timeoutWith"]; }); -/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(515); +/* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(514); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__["timestamp"]; }); -/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(516); +/* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(515); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__["toArray"]; }); -/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(517); +/* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(516); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__["window"]; }); -/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(518); +/* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(517); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__["windowCount"]; }); -/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(519); +/* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(518); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__["windowTime"]; }); -/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(520); +/* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(519); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__["windowToggle"]; }); -/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(521); +/* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(520); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__["windowWhen"]; }); -/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(522); +/* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(521); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__["withLatestFrom"]; }); -/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(523); +/* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(522); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__["zip"]; }); -/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(524); +/* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(523); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__["zipAll"]; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ @@ -53390,7 +53341,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }), -/* 428 */ +/* 427 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53469,14 +53420,14 @@ var AuditSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 429 */ +/* 428 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56); -/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(428); +/* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(427); /* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(109); /** PURE_IMPORTS_START _scheduler_async,_audit,_observable_timer PURE_IMPORTS_END */ @@ -53492,7 +53443,7 @@ function auditTime(duration, scheduler) { /***/ }), -/* 430 */ +/* 429 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53539,7 +53490,7 @@ var BufferSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 431 */ +/* 430 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53640,7 +53591,7 @@ var BufferSkipCountSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 432 */ +/* 431 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53801,7 +53752,7 @@ function dispatchBufferClose(arg) { /***/ }), -/* 433 */ +/* 432 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -53920,7 +53871,7 @@ var BufferToggleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 434 */ +/* 433 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54013,7 +53964,7 @@ var BufferWhenSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 435 */ +/* 434 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54073,7 +54024,7 @@ var CatchSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 436 */ +/* 435 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54089,7 +54040,7 @@ function combineAll(project) { /***/ }), -/* 437 */ +/* 436 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54121,7 +54072,7 @@ function combineLatest() { /***/ }), -/* 438 */ +/* 437 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54141,7 +54092,7 @@ function concat() { /***/ }), -/* 439 */ +/* 438 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54157,13 +54108,13 @@ function concatMap(project, resultSelector) { /***/ }), -/* 440 */ +/* 439 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; }); -/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(439); +/* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(438); /** PURE_IMPORTS_START _concatMap PURE_IMPORTS_END */ function concatMapTo(innerObservable, resultSelector) { @@ -54173,7 +54124,7 @@ function concatMapTo(innerObservable, resultSelector) { /***/ }), -/* 441 */ +/* 440 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54238,7 +54189,7 @@ var CountSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 442 */ +/* 441 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54323,7 +54274,7 @@ var DebounceSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 443 */ +/* 442 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54399,7 +54350,7 @@ function dispatchNext(subscriber) { /***/ }), -/* 444 */ +/* 443 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54449,7 +54400,7 @@ var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 445 */ +/* 444 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54457,7 +54408,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56); -/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(446); +/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(445); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12); /* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(43); /** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */ @@ -54556,7 +54507,7 @@ var DelayMessage = /*@__PURE__*/ (function () { /***/ }), -/* 446 */ +/* 445 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54570,7 +54521,7 @@ function isDate(value) { /***/ }), -/* 447 */ +/* 446 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54716,7 +54667,7 @@ var SubscriptionDelaySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 448 */ +/* 447 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54754,7 +54705,7 @@ var DeMaterializeSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 449 */ +/* 448 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54830,7 +54781,7 @@ var DistinctSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 450 */ +/* 449 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54901,13 +54852,13 @@ var DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 451 */ +/* 450 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; }); -/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(450); +/* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(449); /** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */ function distinctUntilKeyChanged(key, compare) { @@ -54917,7 +54868,7 @@ function distinctUntilKeyChanged(key, compare) { /***/ }), -/* 452 */ +/* 451 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -54925,9 +54876,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; }); /* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(106); -/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(453); -/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(444); -/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(454); +/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(452); +/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(443); +/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(453); /** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */ @@ -54949,7 +54900,7 @@ function elementAt(index, defaultValue) { /***/ }), -/* 453 */ +/* 452 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55015,7 +54966,7 @@ function defaultErrorFactory() { /***/ }), -/* 454 */ +/* 453 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55077,7 +55028,7 @@ var TakeSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 455 */ +/* 454 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55099,7 +55050,7 @@ function endWith() { /***/ }), -/* 456 */ +/* 455 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55161,7 +55112,7 @@ var EverySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 457 */ +/* 456 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55215,7 +55166,7 @@ var SwitchFirstSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 458 */ +/* 457 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55309,7 +55260,7 @@ var ExhaustMapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 459 */ +/* 458 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55421,7 +55372,7 @@ var ExpandSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 460 */ +/* 459 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55459,7 +55410,7 @@ var FinallySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 461 */ +/* 460 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55531,13 +55482,13 @@ var FindValueSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 462 */ +/* 461 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; }); -/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(461); +/* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(460); /** PURE_IMPORTS_START _operators_find PURE_IMPORTS_END */ function findIndex(predicate, thisArg) { @@ -55547,7 +55498,7 @@ function findIndex(predicate, thisArg) { /***/ }), -/* 463 */ +/* 462 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55555,9 +55506,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(106); -/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(454); -/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(444); -/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(453); +/* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(453); +/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(443); +/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(452); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26); /** PURE_IMPORTS_START _util_EmptyError,_filter,_take,_defaultIfEmpty,_throwIfEmpty,_util_identity PURE_IMPORTS_END */ @@ -55574,7 +55525,7 @@ function first(predicate, defaultValue) { /***/ }), -/* 464 */ +/* 463 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55611,7 +55562,7 @@ var IgnoreElementsSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 465 */ +/* 464 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55655,7 +55606,7 @@ var IsEmptySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 466 */ +/* 465 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55663,9 +55614,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(106); -/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(467); -/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(453); -/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(444); +/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(466); +/* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(452); +/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(443); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26); /** PURE_IMPORTS_START _util_EmptyError,_filter,_takeLast,_throwIfEmpty,_defaultIfEmpty,_util_identity PURE_IMPORTS_END */ @@ -55682,7 +55633,7 @@ function last(predicate, defaultValue) { /***/ }), -/* 467 */ +/* 466 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55759,7 +55710,7 @@ var TakeLastSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 468 */ +/* 467 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55798,7 +55749,7 @@ var MapToSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 469 */ +/* 468 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55848,13 +55799,13 @@ var MaterializeSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 470 */ +/* 469 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; }); -/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(471); +/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(470); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function max(comparer) { @@ -55867,15 +55818,15 @@ function max(comparer) { /***/ }), -/* 471 */ +/* 470 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; }); -/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(472); -/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(467); -/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(444); +/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(471); +/* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(466); +/* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(443); /* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25); /** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */ @@ -55896,7 +55847,7 @@ function reduce(accumulator, seed) { /***/ }), -/* 472 */ +/* 471 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55978,7 +55929,7 @@ var ScanSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 473 */ +/* 472 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -55998,7 +55949,7 @@ function merge() { /***/ }), -/* 474 */ +/* 473 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56023,7 +55974,7 @@ function mergeMapTo(innerObservable, resultSelector, concurrent) { /***/ }), -/* 475 */ +/* 474 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56132,13 +56083,13 @@ var MergeScanSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 476 */ +/* 475 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; }); -/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(471); +/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(470); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function min(comparer) { @@ -56151,7 +56102,7 @@ function min(comparer) { /***/ }), -/* 477 */ +/* 476 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56200,7 +56151,7 @@ var MulticastOperator = /*@__PURE__*/ (function () { /***/ }), -/* 478 */ +/* 477 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56290,7 +56241,7 @@ var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 479 */ +/* 478 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56338,7 +56289,7 @@ var PairwiseSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 480 */ +/* 479 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56361,7 +56312,7 @@ function partition(predicate, thisArg) { /***/ }), -/* 481 */ +/* 480 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56401,14 +56352,14 @@ function plucker(props, length) { /***/ }), -/* 482 */ +/* 481 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; }); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(477); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(476); /** PURE_IMPORTS_START _Subject,_multicast PURE_IMPORTS_END */ @@ -56421,14 +56372,14 @@ function publish(selector) { /***/ }), -/* 483 */ +/* 482 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; }); /* harmony import */ var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(477); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(476); /** PURE_IMPORTS_START _BehaviorSubject,_multicast PURE_IMPORTS_END */ @@ -56439,14 +56390,14 @@ function publishBehavior(value) { /***/ }), -/* 484 */ +/* 483 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; }); /* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(477); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(476); /** PURE_IMPORTS_START _AsyncSubject,_multicast PURE_IMPORTS_END */ @@ -56457,14 +56408,14 @@ function publishLast() { /***/ }), -/* 485 */ +/* 484 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; }); /* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(477); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(476); /** PURE_IMPORTS_START _ReplaySubject,_multicast PURE_IMPORTS_END */ @@ -56480,7 +56431,7 @@ function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) { /***/ }), -/* 486 */ +/* 485 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56507,7 +56458,7 @@ function race() { /***/ }), -/* 487 */ +/* 486 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56572,7 +56523,7 @@ var RepeatSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 488 */ +/* 487 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56666,7 +56617,7 @@ var RepeatWhenSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 489 */ +/* 488 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56719,7 +56670,7 @@ var RetrySubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 490 */ +/* 489 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56805,7 +56756,7 @@ var RetryWhenSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 491 */ +/* 490 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56860,7 +56811,7 @@ var SampleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 492 */ +/* 491 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -56920,7 +56871,7 @@ function dispatchNotification(state) { /***/ }), -/* 493 */ +/* 492 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57043,13 +56994,13 @@ var SequenceEqualCompareToSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 494 */ +/* 493 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return share; }); -/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(477); +/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(476); /* harmony import */ var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28); /** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */ @@ -57066,7 +57017,7 @@ function share() { /***/ }), -/* 495 */ +/* 494 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57135,7 +57086,7 @@ function shareReplayOperator(_a) { /***/ }), -/* 496 */ +/* 495 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57215,7 +57166,7 @@ var SingleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 497 */ +/* 496 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57257,7 +57208,7 @@ var SkipSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 498 */ +/* 497 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57319,7 +57270,7 @@ var SkipLastSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 499 */ +/* 498 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57376,7 +57327,7 @@ var SkipUntilSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 500 */ +/* 499 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57432,7 +57383,7 @@ var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 501 */ +/* 500 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57461,13 +57412,13 @@ function startWith() { /***/ }), -/* 502 */ +/* 501 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; }); -/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(503); +/* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(502); /** PURE_IMPORTS_START _observable_SubscribeOnObservable PURE_IMPORTS_END */ function subscribeOn(scheduler, delay) { @@ -57492,7 +57443,7 @@ var SubscribeOnOperator = /*@__PURE__*/ (function () { /***/ }), -/* 503 */ +/* 502 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57556,13 +57507,13 @@ var SubscribeOnObservable = /*@__PURE__*/ (function (_super) { /***/ }), -/* 504 */ +/* 503 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; }); -/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(505); +/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(504); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26); /** PURE_IMPORTS_START _switchMap,_util_identity PURE_IMPORTS_END */ @@ -57574,7 +57525,7 @@ function switchAll() { /***/ }), -/* 505 */ +/* 504 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57662,13 +57613,13 @@ var SwitchMapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 506 */ +/* 505 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; }); -/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(505); +/* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(504); /** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */ function switchMapTo(innerObservable, resultSelector) { @@ -57678,7 +57629,7 @@ function switchMapTo(innerObservable, resultSelector) { /***/ }), -/* 507 */ +/* 506 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57726,7 +57677,7 @@ var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 508 */ +/* 507 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57794,7 +57745,7 @@ var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 509 */ +/* 508 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57882,7 +57833,7 @@ var TapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 510 */ +/* 509 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57984,7 +57935,7 @@ var ThrottleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 511 */ +/* 510 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -57993,7 +57944,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56); -/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(510); +/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(509); /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async,_throttle PURE_IMPORTS_END */ @@ -58082,7 +58033,7 @@ function dispatchNext(arg) { /***/ }), -/* 512 */ +/* 511 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58090,7 +58041,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56); -/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(472); +/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(471); /* harmony import */ var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(92); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67); /** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */ @@ -58126,7 +58077,7 @@ var TimeInterval = /*@__PURE__*/ (function () { /***/ }), -/* 513 */ +/* 512 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58134,7 +58085,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56); /* harmony import */ var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65); -/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(514); +/* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(513); /* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(50); /** PURE_IMPORTS_START _scheduler_async,_util_TimeoutError,_timeoutWith,_observable_throwError PURE_IMPORTS_END */ @@ -58151,7 +58102,7 @@ function timeout(due, scheduler) { /***/ }), -/* 514 */ +/* 513 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58159,7 +58110,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56); -/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(446); +/* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(445); /* harmony import */ var _innerSubscribe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91); /** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_innerSubscribe PURE_IMPORTS_END */ @@ -58230,7 +58181,7 @@ var TimeoutWithSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 515 */ +/* 514 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58260,13 +58211,13 @@ var Timestamp = /*@__PURE__*/ (function () { /***/ }), -/* 516 */ +/* 515 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; }); -/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(471); +/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(470); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function toArrayReducer(arr, item, index) { @@ -58283,7 +58234,7 @@ function toArray() { /***/ }), -/* 517 */ +/* 516 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58361,7 +58312,7 @@ var WindowSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 518 */ +/* 517 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58451,7 +58402,7 @@ var WindowCountSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 519 */ +/* 518 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58621,7 +58572,7 @@ function dispatchWindowClose(state) { /***/ }), -/* 520 */ +/* 519 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58764,7 +58715,7 @@ var WindowToggleSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 521 */ +/* 520 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58861,7 +58812,7 @@ var WindowSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 522 */ +/* 521 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58956,7 +58907,7 @@ var WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 523 */ +/* 522 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58978,7 +58929,7 @@ function zip() { /***/ }), -/* 524 */ +/* 523 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -58994,7 +58945,7 @@ function zipAll(project) { /***/ }), -/* 525 */ +/* 524 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59004,7 +58955,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _observe_lines = __webpack_require__(526); +var _observe_lines = __webpack_require__(525); Object.keys(_observe_lines).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -59017,7 +58968,7 @@ Object.keys(_observe_lines).forEach(function (key) { }); }); -var _observe_readable = __webpack_require__(527); +var _observe_readable = __webpack_require__(526); Object.keys(_observe_readable).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -59031,7 +58982,7 @@ Object.keys(_observe_readable).forEach(function (key) { }); /***/ }), -/* 526 */ +/* 525 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59044,9 +58995,9 @@ exports.observeLines = observeLines; var Rx = _interopRequireWildcard(__webpack_require__(9)); -var _operators = __webpack_require__(427); +var _operators = __webpack_require__(426); -var _observe_readable = __webpack_require__(527); +var _observe_readable = __webpack_require__(526); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } @@ -59109,7 +59060,7 @@ function observeLines(readable) { } /***/ }), -/* 527 */ +/* 526 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59122,7 +59073,7 @@ exports.observeReadable = observeReadable; var Rx = _interopRequireWildcard(__webpack_require__(9)); -var _operators = __webpack_require__(427); +var _operators = __webpack_require__(426); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } @@ -59145,6 +59096,51 @@ function observeReadable(readable) { return Rx.race(Rx.fromEvent(readable, 'end').pipe((0, _operators.first)(), (0, _operators.ignoreElements)()), Rx.fromEvent(readable, 'error').pipe((0, _operators.first)(), (0, _operators.mergeMap)(err => Rx.throwError(err)))); } +/***/ }), +/* 527 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeYarnIntegrityFileIfExists", function() { return removeYarnIntegrityFileIfExists; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "yarnIntegrityFileExists", function() { return yarnIntegrityFileExists; }); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4); +/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(231); +/* + * 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. + */ + + +async function removeYarnIntegrityFileIfExists(nodeModulesPath) { + try { + const nodeModulesRealPath = await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["tryRealpath"])(nodeModulesPath); + const yarnIntegrityFilePath = Object(path__WEBPACK_IMPORTED_MODULE_0__["join"])(nodeModulesRealPath, '.yarn-integrity'); // check if the file exists and delete it in that case + + if (await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["isFile"])(yarnIntegrityFilePath)) { + await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["unlink"])(yarnIntegrityFilePath); + } + } catch {// no-op + } +} +async function yarnIntegrityFileExists(nodeModulesPath) { + try { + const nodeModulesRealPath = await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["tryRealpath"])(nodeModulesPath); + const yarnIntegrityFilePath = Object(path__WEBPACK_IMPORTED_MODULE_0__["join"])(nodeModulesRealPath, '.yarn-integrity'); // check if the file already exists + + if (await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["isFile"])(yarnIntegrityFilePath)) { + return true; + } + } catch {// no-op + } + + return false; +} + /***/ }), /* 528 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -59315,7 +59311,7 @@ __webpack_require__.r(__webpack_exports__); const CleanCommand = { - description: 'Deletes output directories, node_modules and resets internal caches.', + description: 'Deletes output directories and resets internal caches.', name: 'clean', reportTiming: { group: 'scripts/kbn clean', @@ -59324,20 +59320,15 @@ const CleanCommand = { async run(projects) { _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].warning(dedent__WEBPACK_IMPORTED_MODULE_0___default.a` - This command is only necessary for the rare circumstance where you need to recover a consistent + This command is only necessary for the circumstance where you need to recover a consistent state when problems arise. If you need to run this command often, please let us know by - filling out this form: https://ela.st/yarn-kbn-clean + filling out this form: https://ela.st/yarn-kbn-clean. + Please not it might not solve problems with node_modules. To solve problems around node_modules + you might need to run 'yarn kbn reset'. `); const toDelete = []; for (const project of projects.values()) { - if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_5__["isDirectory"])(project.nodeModulesLocation)) { - toDelete.push({ - cwd: project.path, - pattern: Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(project.path, project.nodeModulesLocation) - }); - } - if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_5__["isDirectory"])(project.targetLocation)) { toDelete.push({ cwd: project.path, @@ -61599,7 +61590,8 @@ const ResetCommand = { async run(projects) { _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].warning(dedent__WEBPACK_IMPORTED_MODULE_0___default.a` In most cases, 'yarn kbn clean' is all that should be needed to recover a consistent state when - problems arise. If you need to use this command, please let us know, as it should not be necessary. + problems arise. However for the rare cases where something get corrupt on node_modules you might need this command. + If you think you need to use this command very often (which is not normal), please let us know. `); const toDelete = []; diff --git a/packages/kbn-pm/src/commands/bootstrap.ts b/packages/kbn-pm/src/commands/bootstrap.ts index 26ca93d26c052..7b5c8c2b6b37d 100644 --- a/packages/kbn-pm/src/commands/bootstrap.ts +++ b/packages/kbn-pm/src/commands/bootstrap.ts @@ -18,8 +18,8 @@ import { readYarnLock } from '../utils/yarn_lock'; import { sortPackageJson } from '../utils/sort_package_json'; import { validateDependencies } from '../utils/validate_dependencies'; import { - ensureYarnIntegrityFileExists, installBazelTools, + removeYarnIntegrityFileIfExists, runBazel, yarnIntegrityFileExists, } from '../utils/bazel'; @@ -54,17 +54,12 @@ export const BootstrapCommand: ICommand = { } }; - // Force install is set in case a flag is passed or - // if the `.yarn-integrity` file is not found which - // will be indicated by the return of yarnIntegrityFileExists. + // Force install is set in case a flag is passed into yarn kbn bootstrap or if the `.yarn-integrity` + // file is not found which will be indicated by the return of yarnIntegrityFileExists. const forceInstall = (!!options && options['force-install'] === true) || !(await yarnIntegrityFileExists(resolve(kibanaProjectPath, 'node_modules'))); - // Ensure we have a `node_modules/.yarn-integrity` file as we depend on it - // for bazel to know it has to re-install the node_modules after a reset or a clean - await ensureYarnIntegrityFileExists(resolve(kibanaProjectPath, 'node_modules')); - // Install bazel machinery tools if needed await installBazelTools(rootPath); @@ -83,6 +78,8 @@ export const BootstrapCommand: ICommand = { if (forceInstall) { await time('force install dependencies', async () => { + await removeYarnIntegrityFileIfExists(resolve(kibanaProjectPath, 'node_modules')); + await runBazel(['clean']); await runBazel(['run', '@nodejs//:yarn'], runOffline, { env: { SASS_BINARY_SITE: diff --git a/packages/kbn-pm/src/commands/clean.ts b/packages/kbn-pm/src/commands/clean.ts index 89552946faeea..12f6d674ca9e6 100644 --- a/packages/kbn-pm/src/commands/clean.ts +++ b/packages/kbn-pm/src/commands/clean.ts @@ -17,7 +17,7 @@ import { log } from '../utils/log'; import { ICommand } from './'; export const CleanCommand: ICommand = { - description: 'Deletes output directories, node_modules and resets internal caches.', + description: 'Deletes output directories and resets internal caches.', name: 'clean', reportTiming: { @@ -27,20 +27,15 @@ export const CleanCommand: ICommand = { async run(projects) { log.warning(dedent` - This command is only necessary for the rare circumstance where you need to recover a consistent + This command is only necessary for the circumstance where you need to recover a consistent state when problems arise. If you need to run this command often, please let us know by - filling out this form: https://ela.st/yarn-kbn-clean + filling out this form: https://ela.st/yarn-kbn-clean. + Please not it might not solve problems with node_modules. To solve problems around node_modules + you might need to run 'yarn kbn reset'. `); const toDelete = []; for (const project of projects.values()) { - if (await isDirectory(project.nodeModulesLocation)) { - toDelete.push({ - cwd: project.path, - pattern: relative(project.path, project.nodeModulesLocation), - }); - } - if (await isDirectory(project.targetLocation)) { toDelete.push({ cwd: project.path, diff --git a/packages/kbn-pm/src/commands/reset.ts b/packages/kbn-pm/src/commands/reset.ts index 0d5fd72427a9f..1a3f7c748f79e 100644 --- a/packages/kbn-pm/src/commands/reset.ts +++ b/packages/kbn-pm/src/commands/reset.ts @@ -34,7 +34,8 @@ export const ResetCommand: ICommand = { async run(projects) { log.warning(dedent` In most cases, 'yarn kbn clean' is all that should be needed to recover a consistent state when - problems arise. If you need to use this command, please let us know, as it should not be necessary. + problems arise. However for the rare cases where something get corrupt on node_modules you might need this command. + If you think you need to use this command very often (which is not normal), please let us know. `); const toDelete = []; diff --git a/packages/kbn-pm/src/utils/bazel/index.ts b/packages/kbn-pm/src/utils/bazel/index.ts index a3651039161b8..84e26a0b914e1 100644 --- a/packages/kbn-pm/src/utils/bazel/index.ts +++ b/packages/kbn-pm/src/utils/bazel/index.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -export * from './yarn_integrity'; export * from './get_cache_folders'; export * from './install_tools'; export * from './run'; +export * from './yarn_integrity'; diff --git a/packages/kbn-pm/src/utils/bazel/yarn_integrity.ts b/packages/kbn-pm/src/utils/bazel/yarn_integrity.ts index 3a72f5ca080b8..76910786898aa 100644 --- a/packages/kbn-pm/src/utils/bazel/yarn_integrity.ts +++ b/packages/kbn-pm/src/utils/bazel/yarn_integrity.ts @@ -7,35 +7,34 @@ */ import { join } from 'path'; -import { isFile, mkdirp, tryRealpath, writeFile } from '../fs'; +import { isFile, tryRealpath, unlink } from '../fs'; -export async function yarnIntegrityFileExists(nodeModulesPath: string) { +export async function removeYarnIntegrityFileIfExists(nodeModulesPath: string) { try { const nodeModulesRealPath = await tryRealpath(nodeModulesPath); const yarnIntegrityFilePath = join(nodeModulesRealPath, '.yarn-integrity'); - // check if the file already exists + // check if the file exists and delete it in that case if (await isFile(yarnIntegrityFilePath)) { - return true; + await unlink(yarnIntegrityFilePath); } } catch { // no-op } - - return false; } -export async function ensureYarnIntegrityFileExists(nodeModulesPath: string) { +export async function yarnIntegrityFileExists(nodeModulesPath: string) { try { const nodeModulesRealPath = await tryRealpath(nodeModulesPath); const yarnIntegrityFilePath = join(nodeModulesRealPath, '.yarn-integrity'); - // ensure node_modules folder is created - await mkdirp(nodeModulesRealPath); - - // write a blank file in case it doesn't exists - await writeFile(yarnIntegrityFilePath, '', { flag: 'wx' }); + // check if the file already exists + if (await isFile(yarnIntegrityFilePath)) { + return true; + } } catch { // no-op } + + return false; } diff --git a/packages/kbn-test/jest-preset.js b/packages/kbn-test/jest-preset.js index ba515865e5323..fd14c973683f7 100644 --- a/packages/kbn-test/jest-preset.js +++ b/packages/kbn-test/jest-preset.js @@ -16,7 +16,7 @@ module.exports = { coverageDirectory: '/target/kibana-coverage/jest', // An array of regexp pattern strings used to skip coverage collection - coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts'], + coveragePathIgnorePatterns: ['/node_modules/', '.*\\.d\\.ts', 'jest\\.config\\.js'], // A list of reporter names that Jest uses when writing coverage reports coverageReporters: !!process.env.CODE_COVERAGE diff --git a/src/core/public/core_system.ts b/src/core/public/core_system.ts index 1aa01c13dd375..ee36ae4a728cd 100644 --- a/src/core/public/core_system.ts +++ b/src/core/public/core_system.ts @@ -134,8 +134,11 @@ export class CoreSystem { // Setup FatalErrorsService and it's dependencies first so that we're // able to render any errors. const injectedMetadata = this.injectedMetadata.setup(); + const theme = this.theme.setup({ injectedMetadata }); + this.fatalErrorsSetup = this.fatalErrors.setup({ injectedMetadata, + theme, i18n: this.i18n.getContext(), }); await this.integrations.setup(); @@ -149,7 +152,6 @@ export class CoreSystem { }); const uiSettings = this.uiSettings.setup({ http, injectedMetadata }); const notifications = this.notifications.setup({ uiSettings }); - const theme = this.theme.setup({ injectedMetadata }); const application = this.application.setup({ http }); this.coreApp.setup({ application, http, injectedMetadata, notifications }); diff --git a/src/core/public/fatal_errors/__snapshots__/fatal_errors_service.test.ts.snap b/src/core/public/fatal_errors/__snapshots__/fatal_errors_service.test.ts.snap index df60b228972fc..b00d8be49739c 100644 --- a/src/core/public/fatal_errors/__snapshots__/fatal_errors_service.test.ts.snap +++ b/src/core/public/fatal_errors/__snapshots__/fatal_errors_service.test.ts.snap @@ -3,12 +3,24 @@ exports[`#add() deletes all children of rootDomElement and renders into it: fatal error screen component 1`] = ` Array [ Array [ - + - , + ,
, ], ] diff --git a/src/core/public/fatal_errors/fatal_errors_service.test.ts b/src/core/public/fatal_errors/fatal_errors_service.test.ts index 140e7542e8e79..4b243979c8e4d 100644 --- a/src/core/public/fatal_errors/fatal_errors_service.test.ts +++ b/src/core/public/fatal_errors/fatal_errors_service.test.ts @@ -15,6 +15,7 @@ expect.addSnapshotSerializer({ import { mockRender } from './fatal_errors_service.test.mocks'; import { injectedMetadataServiceMock } from '../injected_metadata/injected_metadata_service.mock'; +import { themeServiceMock } from '../theme/theme_service.mock'; import { FatalErrorsService } from './fatal_errors_service'; @@ -22,6 +23,7 @@ function setupService() { const rootDomElement = document.createElement('div'); const injectedMetadata = injectedMetadataServiceMock.createSetupContract(); + const theme = themeServiceMock.createSetupContract(); const stopCoreSystem = jest.fn(); @@ -37,7 +39,7 @@ function setupService() { rootDomElement, injectedMetadata, stopCoreSystem, - fatalErrors: fatalErrorsService.setup({ injectedMetadata, i18n }), + fatalErrors: fatalErrorsService.setup({ injectedMetadata, i18n, theme }), }; } diff --git a/src/core/public/fatal_errors/fatal_errors_service.tsx b/src/core/public/fatal_errors/fatal_errors_service.tsx index 262ee9e702f40..0e72b99bc6b92 100644 --- a/src/core/public/fatal_errors/fatal_errors_service.tsx +++ b/src/core/public/fatal_errors/fatal_errors_service.tsx @@ -13,11 +13,14 @@ import { first, tap } from 'rxjs/operators'; import { I18nStart } from '../i18n'; import { InjectedMetadataSetup } from '../injected_metadata'; +import { ThemeServiceSetup } from '../theme'; +import { CoreContextProvider } from '../utils'; import { FatalErrorsScreen } from './fatal_errors_screen'; import { FatalErrorInfo, getErrorInfo } from './get_error_info'; export interface Deps { i18n: I18nStart; + theme: ThemeServiceSetup; injectedMetadata: InjectedMetadataSetup; } @@ -64,13 +67,13 @@ export class FatalErrorsService { */ constructor(private rootDomElement: HTMLElement, private onFirstErrorCb: () => void) {} - public setup({ i18n, injectedMetadata }: Deps) { + public setup(deps: Deps) { this.errorInfo$ .pipe( first(), tap(() => { this.onFirstErrorCb(); - this.renderError(injectedMetadata, i18n); + this.renderError(deps); }) ) .subscribe({ @@ -99,7 +102,7 @@ export class FatalErrorsService { }, }; - this.setupGlobalErrorHandlers(this.fatalErrors!); + this.setupGlobalErrorHandlers(); return this.fatalErrors!; } @@ -112,7 +115,7 @@ export class FatalErrorsService { return fatalErrors; } - private renderError(injectedMetadata: InjectedMetadataSetup, i18n: I18nStart) { + private renderError({ i18n, theme, injectedMetadata }: Deps) { // delete all content in the rootDomElement this.rootDomElement.textContent = ''; @@ -121,20 +124,20 @@ export class FatalErrorsService { this.rootDomElement.appendChild(container); render( - + - , + , container ); } - private setupGlobalErrorHandlers(fatalErrorsSetup: FatalErrorsSetup) { + private setupGlobalErrorHandlers() { if (window.addEventListener) { - window.addEventListener('unhandledrejection', function (e) { + window.addEventListener('unhandledrejection', (e) => { console.log(`Detected an unhandled Promise rejection.\n${e.reason}`); // eslint-disable-line no-console }); } diff --git a/src/core/public/overlays/flyout/flyout_service.tsx b/src/core/public/overlays/flyout/flyout_service.tsx index 600e1e0e97b25..94c0ffdf95b23 100644 --- a/src/core/public/overlays/flyout/flyout_service.tsx +++ b/src/core/public/overlays/flyout/flyout_service.tsx @@ -87,6 +87,7 @@ export interface OverlayFlyoutOpenOptions { size?: EuiFlyoutSize; maxWidth?: boolean | number | string; hideCloseButton?: boolean; + outsideClickCloses?: boolean; maskProps?: EuiOverlayMaskProps; /** * EuiFlyout onClose handler. diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 4ce68770d7f18..44224e6fcaea7 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -829,6 +829,8 @@ export interface OverlayFlyoutOpenOptions { maxWidth?: boolean | number | string; onClose?: (flyout: OverlayRef) => void; // (undocumented) + outsideClickCloses?: boolean; + // (undocumented) ownFocus?: boolean; // (undocumented) size?: EuiFlyoutSize; @@ -1534,6 +1536,6 @@ export interface UserProvidedValues { // Warnings were encountered during analysis: // -// src/core/public/core_system.ts:183:21 - (ae-forgotten-export) The symbol "InternalApplicationStart" needs to be exported by the entry point index.d.ts +// src/core/public/core_system.ts:185:21 - (ae-forgotten-export) The symbol "InternalApplicationStart" needs to be exported by the entry point index.d.ts ``` diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 83a542c93d12b..191f53208df72 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -199,6 +199,8 @@ kibana_vars=( xpack.alerting.invalidateApiKeysTask.interval xpack.alerting.invalidateApiKeysTask.removalDelay xpack.alerting.defaultRuleTaskTimeout + xpack.alerting.rules.execution.timeout + xpack.alerting.rules.execution.ruleTypeOverrides xpack.alerting.cancelAlertsOnRuleTimeout xpack.alerting.rules.minimumScheduleInterval.value xpack.alerting.rules.minimumScheduleInterval.enforce diff --git a/src/plugins/chart_expressions/expression_gauge/common/expression_functions/__snapshots__/gauge_function.test.ts.snap b/src/plugins/chart_expressions/expression_gauge/common/expression_functions/__snapshots__/gauge_function.test.ts.snap index c640ed8884d98..5bb924a71a2a1 100644 --- a/src/plugins/chart_expressions/expression_gauge/common/expression_functions/__snapshots__/gauge_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_gauge/common/expression_functions/__snapshots__/gauge_function.test.ts.snap @@ -39,6 +39,7 @@ Object { "centralMajor": "Some label", "centralMajorMode": "custom", "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -89,6 +90,7 @@ Object { "centralMajor": undefined, "centralMajorMode": "auto", "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -137,6 +139,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "auto", @@ -185,6 +188,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -233,6 +237,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -283,6 +288,7 @@ Object { "centralMajor": "Some label", "centralMajorMode": "custom", "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -333,6 +339,7 @@ Object { "centralMajor": undefined, "centralMajorMode": "auto", "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -381,6 +388,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -429,6 +437,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -477,6 +486,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -525,6 +535,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -573,6 +584,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "none", @@ -621,6 +633,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "palette", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", @@ -669,6 +682,7 @@ Object { "args": Object { "ariaLabel": undefined, "colorMode": "none", + "commonLabel": undefined, "goal": undefined, "labelMajor": "title", "labelMajorMode": "custom", diff --git a/src/plugins/chart_expressions/expression_gauge/common/expression_functions/gauge_function.ts b/src/plugins/chart_expressions/expression_gauge/common/expression_functions/gauge_function.ts index 133c8114bdb50..ba40821948526 100644 --- a/src/plugins/chart_expressions/expression_gauge/common/expression_functions/gauge_function.ts +++ b/src/plugins/chart_expressions/expression_gauge/common/expression_functions/gauge_function.ts @@ -160,6 +160,12 @@ export const gaugeFunction = (): GaugeExpressionFunctionDefinition => ({ defaultMessage: 'Enables relative precentage mode', }), }, + commonLabel: { + types: ['string'], + help: i18n.translate('expressionGauge.functions.gauge.args.commonLabel.help', { + defaultMessage: 'Specifies the common label outside the chart', + }), + }, ariaLabel: { types: ['string'], help: i18n.translate('expressionGauge.functions.gaugeChart.config.ariaLabel.help', { diff --git a/src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts index 3cd6d566d4870..b6add118a6747 100644 --- a/src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_gauge/common/types/expression_functions.ts @@ -47,6 +47,7 @@ export interface GaugeState { shape: GaugeShape; /** @deprecated This field is deprecated and going to be removed in the futher release versions. */ percentageMode?: boolean; + commonLabel?: string; } export type GaugeArguments = GaugeState & { diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/gauge.scss b/src/plugins/chart_expressions/expression_gauge/public/components/gauge.scss new file mode 100644 index 0000000000000..cb7d6718d4dcd --- /dev/null +++ b/src/plugins/chart_expressions/expression_gauge/public/components/gauge.scss @@ -0,0 +1,12 @@ +.gauge__wrapper { + flex: 1 1 0; + display: flex; + flex-direction: column; + // it is used for rendering at `Canvas`. + height: 100%; +} + +.gauge__label { + width: 100%; + text-align: center; +} diff --git a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx index 9db6b81acefce..8258063dfdd69 100644 --- a/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx +++ b/src/plugins/chart_expressions/expression_gauge/public/components/gauge_component.tsx @@ -34,6 +34,8 @@ import './index.scss'; import { GaugeCentralMajorMode } from '../../common/types'; import { isBulletShape, isRoundShape } from '../../common/utils'; +import './gauge.scss'; + declare global { interface Window { /** @@ -211,6 +213,7 @@ export const GaugeComponent: FC = memo( centralMajor, centralMajorMode, ticksPosition, + commonLabel, } = args; const getColor = useCallback( @@ -377,50 +380,52 @@ export const GaugeComponent: FC = memo( : {}; return ( - - - = bands[0] && goal <= bands[bands.length - 1] ? goal : undefined} - actual={actualValue} - tickValueFormatter={({ value: tickValue }) => tickFormatter.convert(tickValue)} - tooltipValueFormatter={(tooltipValue) => tickFormatter.convert(tooltipValue)} - bands={bands} - ticks={ticks} - bandFillColor={ - colorMode === GaugeColorModes.PALETTE - ? (val) => { - const value = getPreviousSectionValue(val.value, bands); - - const overridedColor = overrideColor( - value, - args.percentageMode ? bands : args.palette?.params?.stops ?? [], - args.percentageMode ? tickFormatter : undefined - ); - - if (overridedColor) { - return overridedColor; +
+ + + = bands[0] && goal <= bands[bands.length - 1] ? goal : undefined} + actual={actualValue} + tickValueFormatter={({ value: tickValue }) => tickFormatter.convert(tickValue)} + tooltipValueFormatter={(tooltipValue) => tickFormatter.convert(tooltipValue)} + bands={bands} + ticks={ticks} + bandFillColor={ + colorMode === GaugeColorModes.PALETTE + ? (val) => { + const value = getPreviousSectionValue(val.value, bands); + + const overridedColor = overrideColor( + value, + args.percentageMode ? bands : args.palette?.params?.stops ?? [], + args.percentageMode ? tickFormatter : undefined + ); + + if (overridedColor) { + return overridedColor; + } + return args.palette + ? getColor(value, args.palette, bands, args.percentageMode) ?? TRANSPARENT + : TRANSPARENT; } - - return args.palette - ? getColor(value, args.palette, bands, args.percentageMode) ?? TRANSPARENT - : TRANSPARENT; - } - : () => TRANSPARENT - } - labelMajor={labelMajorTitle ? `${labelMajorTitle}${majorExtraSpaces}` : labelMajorTitle} - labelMinor={labelMinor ? `${labelMinor}${minorExtraSpaces}` : ''} - {...extraTitles} - {...goalConfig} - /> - + : () => TRANSPARENT + } + labelMajor={labelMajorTitle ? `${labelMajorTitle}${majorExtraSpaces}` : labelMajorTitle} + labelMinor={labelMinor ? `${labelMinor}${minorExtraSpaces}` : ''} + {...extraTitles} + {...goalConfig} + /> + + {commonLabel &&
{commonLabel}
} +
); } ); diff --git a/src/plugins/chart_expressions/expression_xy/README.md b/src/plugins/chart_expressions/expression_xy/README.md new file mode 100755 index 0000000000000..5ad68bebd40fb --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/README.md @@ -0,0 +1,9 @@ +# expressionXY + +Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. + +--- + +## Development + +See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment. diff --git a/src/plugins/chart_expressions/expression_xy/common/__mocks__/index.ts b/src/plugins/chart_expressions/expression_xy/common/__mocks__/index.ts new file mode 100644 index 0000000000000..4bafffc065835 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/__mocks__/index.ts @@ -0,0 +1,128 @@ +/* + * 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 { Position } from '@elastic/charts'; +import { PaletteOutput } from 'src/plugins/charts/common'; +import { Datatable, DatatableRow } from 'src/plugins/expressions'; +import { LayerTypes } from '../constants'; +import { DataLayerConfigResult, LensMultiTable, XYArgs } from '../types'; + +export const mockPaletteOutput: PaletteOutput = { + type: 'palette', + name: 'mock', + params: {}, +}; + +export const createSampleDatatableWithRows = (rows: DatatableRow[]): Datatable => ({ + type: 'datatable', + columns: [ + { + id: 'a', + name: 'a', + meta: { type: 'number', params: { id: 'number', params: { pattern: '0,0.000' } } }, + }, + { + id: 'b', + name: 'b', + meta: { type: 'number', params: { id: 'number', params: { pattern: '000,0' } } }, + }, + { + id: 'c', + name: 'c', + meta: { + type: 'date', + field: 'order_date', + sourceParams: { type: 'date-histogram', params: { interval: 'auto' } }, + params: { id: 'string' }, + }, + }, + { id: 'd', name: 'ColD', meta: { type: 'string' } }, + ], + rows, +}); + +export const sampleLayer: DataLayerConfigResult = { + type: 'dataLayer', + layerId: 'first', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'c', + accessors: ['a', 'b'], + splitAccessor: 'd', + columnToLabel: '{"a": "Label A", "b": "Label B", "d": "Label D"}', + xScaleType: 'ordinal', + yScaleType: 'linear', + isHistogram: false, + palette: mockPaletteOutput, +}; + +export const createArgsWithLayers = (layers: DataLayerConfigResult[] = [sampleLayer]): XYArgs => ({ + xTitle: '', + yTitle: '', + yRightTitle: '', + legend: { + type: 'legendConfig', + isVisible: false, + position: Position.Top, + }, + valueLabels: 'hide', + valuesInLegend: false, + axisTitlesVisibilitySettings: { + type: 'axisTitlesVisibilityConfig', + x: true, + yLeft: true, + yRight: true, + }, + tickLabelsVisibilitySettings: { + type: 'tickLabelsConfig', + x: true, + yLeft: false, + yRight: false, + }, + labelsOrientation: { + type: 'labelsOrientationConfig', + x: 0, + yLeft: -90, + yRight: -45, + }, + gridlinesVisibilitySettings: { + type: 'gridlinesConfig', + x: true, + yLeft: false, + yRight: false, + }, + yLeftExtent: { + mode: 'full', + type: 'axisExtentConfig', + }, + yRightExtent: { + mode: 'full', + type: 'axisExtentConfig', + }, + layers, +}); + +export function sampleArgs() { + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: createSampleDatatableWithRows([ + { a: 1, b: 2, c: 'I', d: 'Foo' }, + { a: 1, b: 5, c: 'J', d: 'Bar' }, + ]), + }, + dateRange: { + fromDate: new Date('2019-01-02T05:00:00.000Z'), + toDate: new Date('2019-01-03T05:00:00.000Z'), + }, + }; + + const args: XYArgs = createArgsWithLayers(); + + return { data, args }; +} diff --git a/src/plugins/chart_expressions/expression_xy/common/constants.ts b/src/plugins/chart_expressions/expression_xy/common/constants.ts new file mode 100644 index 0000000000000..bf1e43b205843 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/constants.ts @@ -0,0 +1,111 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const XY_VIS = 'xyVis'; +export const Y_CONFIG = 'yConfig'; +export const MULTITABLE = 'lens_multitable'; +export const DATA_LAYER = 'dataLayer'; +export const LEGEND_CONFIG = 'legendConfig'; +export const XY_VIS_RENDERER = 'xyVis'; +export const GRID_LINES_CONFIG = 'gridlinesConfig'; +export const ANNOTATION_LAYER = 'annotationLayer'; +export const TICK_LABELS_CONFIG = 'tickLabelsConfig'; +export const AXIS_EXTENT_CONFIG = 'axisExtentConfig'; +export const REFERENCE_LINE_LAYER = 'referenceLineLayer'; +export const LABELS_ORIENTATION_CONFIG = 'labelsOrientationConfig'; +export const AXIS_TITLES_VISIBILITY_CONFIG = 'axisTitlesVisibilityConfig'; + +export const LayerTypes = { + DATA: 'data', + REFERENCELINE: 'referenceLine', + ANNOTATIONS: 'annotations', +} as const; + +export const FittingFunctions = { + NONE: 'None', + ZERO: 'Zero', + LINEAR: 'Linear', + CARRY: 'Carry', + LOOKAHEAD: 'Lookahead', +} as const; + +export const EndValues = { + NONE: 'None', + ZERO: 'Zero', + NEAREST: 'Nearest', +} as const; + +export const YAxisModes = { + AUTO: 'auto', + LEFT: 'left', + RIGHT: 'right', + BOTTOM: 'bottom', +} as const; + +export const AxisExtentModes = { + FULL: 'full', + CUSTOM: 'custom', + DATA_BOUNDS: 'dataBounds', +} as const; + +export const LineStyles = { + SOLID: 'solid', + DASHED: 'dashed', + DOTTED: 'dotted', +} as const; + +export const FillStyles = { + NONE: 'none', + ABOVE: 'above', + BELOW: 'below', +} as const; + +export const IconPositions = { + AUTO: 'auto', + LEFT: 'left', + RIGHT: 'right', + ABOVE: 'above', + BELOW: 'below', +} as const; + +export const SeriesTypes = { + BAR: 'bar', + LINE: 'line', + AREA: 'area', + BAR_STACKED: 'bar_stacked', + AREA_STACKED: 'area_stacked', + BAR_HORIZONTAL: 'bar_horizontal', + BAR_PERCENTAGE_STACKED: 'bar_percentage_stacked', + BAR_HORIZONTAL_STACKED: 'bar_horizontal_stacked', + AREA_PERCENTAGE_STACKED: 'area_percentage_stacked', + BAR_HORIZONTAL_PERCENTAGE_STACKED: 'bar_horizontal_percentage_stacked', +} as const; + +export const YScaleTypes = { + TIME: 'time', + LINEAR: 'linear', + LOG: 'log', + SQRT: 'sqrt', +} as const; + +export const XScaleTypes = { + TIME: 'time', + LINEAR: 'linear', + ORDINAL: 'ordinal', +} as const; + +export const XYCurveTypes = { + LINEAR: 'LINEAR', + CURVE_MONOTONE_X: 'CURVE_MONOTONE_X', +} as const; + +export const ValueLabelModes = { + HIDE: 'hide', + INSIDE: 'inside', + OUTSIDE: 'outside', +} as const; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/annotation_layer_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/annotation_layer_config.ts new file mode 100644 index 0000000000000..0862b69ca44f2 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/annotation_layer_config.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 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 { ExpressionFunctionDefinition } from '../../../../expressions/common'; +import { LayerTypes, ANNOTATION_LAYER } from '../constants'; +import { AnnotationLayerArgs, AnnotationLayerConfigResult } from '../types'; + +export function annotationLayerConfigFunction(): ExpressionFunctionDefinition< + typeof ANNOTATION_LAYER, + null, + AnnotationLayerArgs, + AnnotationLayerConfigResult +> { + return { + name: ANNOTATION_LAYER, + aliases: [], + type: ANNOTATION_LAYER, + inputTypes: ['null'], + help: 'Annotation layer in lens', + args: { + layerId: { + types: ['string'], + help: '', + }, + hide: { + types: ['boolean'], + default: false, + help: 'Show details', + }, + annotations: { + types: ['manual_event_annotation'], + help: '', + multi: true, + }, + }, + fn: (input, args) => { + return { + type: ANNOTATION_LAYER, + ...args, + layerType: LayerTypes.ANNOTATIONS, + }; + }, + }; +} diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/axis_extent_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/axis_extent_config.ts new file mode 100644 index 0000000000000..c5cf89a4663c9 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/axis_extent_config.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 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 type { ExpressionFunctionDefinition } from '../../../../expressions/common'; +import { AxisExtentConfig, AxisExtentConfigResult } from '../types'; +import { AxisExtentModes, AXIS_EXTENT_CONFIG } from '../constants'; + +export const axisExtentConfigFunction: ExpressionFunctionDefinition< + typeof AXIS_EXTENT_CONFIG, + null, + AxisExtentConfig, + AxisExtentConfigResult +> = { + name: AXIS_EXTENT_CONFIG, + aliases: [], + type: AXIS_EXTENT_CONFIG, + help: i18n.translate('expressionXY.axisExtentConfig.help', { + defaultMessage: `Configure the xy chart's axis extents`, + }), + inputTypes: ['null'], + args: { + mode: { + types: ['string'], + options: [...Object.values(AxisExtentModes)], + help: i18n.translate('expressionXY.axisExtentConfig.extentMode.help', { + defaultMessage: 'The extent mode', + }), + }, + lowerBound: { + types: ['number'], + help: i18n.translate('expressionXY.axisExtentConfig.lowerBound.help', { + defaultMessage: 'Lower bound', + }), + }, + upperBound: { + types: ['number'], + help: i18n.translate('expressionXY.axisExtentConfig.upperBound.help', { + defaultMessage: 'Upper bound', + }), + }, + }, + fn(input, args) { + return { + type: AXIS_EXTENT_CONFIG, + ...args, + }; + }, +}; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/axis_titles_visibility_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/axis_titles_visibility_config.ts new file mode 100644 index 0000000000000..50302214fc37c --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/axis_titles_visibility_config.ts @@ -0,0 +1,53 @@ +/* + * 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 type { ExpressionFunctionDefinition } from '../../../../expressions/common'; +import { AXIS_TITLES_VISIBILITY_CONFIG } from '../constants'; +import { AxesSettingsConfig, AxisTitlesVisibilityConfigResult } from '../types'; + +export const axisTitlesVisibilityConfigFunction: ExpressionFunctionDefinition< + typeof AXIS_TITLES_VISIBILITY_CONFIG, + null, + AxesSettingsConfig, + AxisTitlesVisibilityConfigResult +> = { + name: AXIS_TITLES_VISIBILITY_CONFIG, + aliases: [], + type: AXIS_TITLES_VISIBILITY_CONFIG, + help: i18n.translate('expressionXY.axisTitlesVisibilityConfig.help', { + defaultMessage: `Configure the xy chart's axis titles appearance`, + }), + inputTypes: ['null'], + args: { + x: { + types: ['boolean'], + help: i18n.translate('expressionXY.axisTitlesVisibilityConfig.x.help', { + defaultMessage: 'Specifies whether or not the title of the x-axis are visible.', + }), + }, + yLeft: { + types: ['boolean'], + help: i18n.translate('expressionXY.axisTitlesVisibilityConfig.yLeft.help', { + defaultMessage: 'Specifies whether or not the title of the left y-axis are visible.', + }), + }, + yRight: { + types: ['boolean'], + help: i18n.translate('expressionXY.axisTitlesVisibilityConfig.yRight.help', { + defaultMessage: 'Specifies whether or not the title of the right y-axis are visible.', + }), + }, + }, + fn(inputn, args) { + return { + type: AXIS_TITLES_VISIBILITY_CONFIG, + ...args, + }; + }, +}; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/data_layer_config.test.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/data_layer_config.test.ts new file mode 100644 index 0000000000000..ba7fafd3b3685 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/data_layer_config.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 { DataLayerArgs } from '../types'; +import { dataLayerConfigFunction } from '../expression_functions'; +import { createMockExecutionContext } from '../../../../expressions/common/mocks'; +import { mockPaletteOutput } from '../__mocks__'; +import { LayerTypes } from '../constants'; + +describe('dataLayerConfig', () => { + test('produces the correct arguments', () => { + const args: DataLayerArgs = { + layerId: 'first', + seriesType: 'line', + xAccessor: 'c', + accessors: ['a', 'b'], + splitAccessor: 'd', + xScaleType: 'linear', + yScaleType: 'linear', + isHistogram: false, + palette: mockPaletteOutput, + }; + + const result = dataLayerConfigFunction.fn(null, args, createMockExecutionContext()); + + expect(result).toEqual({ type: 'dataLayer', layerType: LayerTypes.DATA, ...args }); + }); +}); diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/data_layer_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/data_layer_config.ts new file mode 100644 index 0000000000000..3aac992d674d9 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/data_layer_config.ts @@ -0,0 +1,123 @@ +/* + * 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 type { ExpressionFunctionDefinition } from '../../../../expressions/common'; +import { DataLayerArgs, DataLayerConfigResult } from '../types'; +import { + DATA_LAYER, + LayerTypes, + SeriesTypes, + XScaleTypes, + YScaleTypes, + Y_CONFIG, +} from '../constants'; + +export const dataLayerConfigFunction: ExpressionFunctionDefinition< + typeof DATA_LAYER, + null, + DataLayerArgs, + DataLayerConfigResult +> = { + name: DATA_LAYER, + aliases: [], + type: DATA_LAYER, + help: i18n.translate('expressionXY.dataLayer.help', { + defaultMessage: `Configure a layer in the xy chart`, + }), + inputTypes: ['null'], + args: { + hide: { + types: ['boolean'], + default: false, + help: i18n.translate('expressionXY.dataLayer.hide.help', { + defaultMessage: 'Show / hide axis', + }), + }, + layerId: { + types: ['string'], + help: i18n.translate('expressionXY.dataLayer.layerId.help', { + defaultMessage: 'Layer ID', + }), + }, + xAccessor: { + types: ['string'], + help: i18n.translate('expressionXY.dataLayer.xAccessor.help', { + defaultMessage: 'X-axis', + }), + }, + seriesType: { + types: ['string'], + options: [...Object.values(SeriesTypes)], + help: i18n.translate('expressionXY.dataLayer.seriesType.help', { + defaultMessage: 'The type of chart to display.', + }), + }, + xScaleType: { + options: [...Object.values(XScaleTypes)], + help: i18n.translate('expressionXY.dataLayer.xScaleType.help', { + defaultMessage: 'The scale type of the x axis', + }), + default: XScaleTypes.ORDINAL, + }, + isHistogram: { + types: ['boolean'], + default: false, + help: i18n.translate('expressionXY.dataLayer.isHistogram.help', { + defaultMessage: 'Whether to layout the chart as a histogram', + }), + }, + yScaleType: { + options: [...Object.values(YScaleTypes)], + help: i18n.translate('expressionXY.dataLayer.yScaleType.help', { + defaultMessage: 'The scale type of the y axes', + }), + default: YScaleTypes.LINEAR, + }, + splitAccessor: { + types: ['string'], + help: i18n.translate('expressionXY.dataLayer.splitAccessor.help', { + defaultMessage: 'The column to split by', + }), + }, + accessors: { + types: ['string'], + help: i18n.translate('expressionXY.dataLayer.accessors.help', { + defaultMessage: 'The columns to display on the y axis.', + }), + multi: true, + }, + yConfig: { + types: [Y_CONFIG], + help: i18n.translate('expressionXY.dataLayer.yConfig.help', { + defaultMessage: 'Additional configuration for y axes', + }), + multi: true, + }, + columnToLabel: { + types: ['string'], + help: i18n.translate('expressionXY.dataLayer.columnToLabel.help', { + defaultMessage: 'JSON key-value pairs of column ID to label', + }), + }, + palette: { + default: `{theme "palette" default={system_palette name="default"} }`, + help: i18n.translate('expressionXY.dataLayer.palette.help', { + defaultMessage: 'Palette', + }), + types: ['palette'], + }, + }, + fn(input, args) { + return { + type: DATA_LAYER, + ...args, + layerType: LayerTypes.DATA, + }; + }, +}; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/grid_lines_config.test.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/grid_lines_config.test.ts new file mode 100644 index 0000000000000..91bfbc8fbe6f0 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/grid_lines_config.test.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 { AxesSettingsConfig } from '../types'; +import { gridlinesConfigFunction } from '../expression_functions'; +import { createMockExecutionContext } from '../../../../../plugins/expressions/common/mocks'; + +describe('gridlinesConfig', () => { + test('produces the correct arguments', () => { + const args: AxesSettingsConfig = { x: true, yLeft: false, yRight: false }; + const result = gridlinesConfigFunction.fn(null, args, createMockExecutionContext()); + + expect(result).toEqual({ type: 'gridlinesConfig', ...args }); + }); +}); diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/grid_lines_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/grid_lines_config.ts similarity index 51% rename from x-pack/plugins/lens/common/expressions/xy_chart/grid_lines_config.ts rename to src/plugins/chart_expressions/expression_xy/common/expression_functions/grid_lines_config.ts index 6338e9f039937..b94b8b5709c03 100644 --- a/x-pack/plugins/lens/common/expressions/xy_chart/grid_lines_config.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/grid_lines_config.ts @@ -1,50 +1,52 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; import type { ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions/common'; -import type { AxesSettingsConfig } from './axis_config'; +import { GRID_LINES_CONFIG } from '../constants'; +import { AxesSettingsConfig, GridlinesConfigResult } from '../types'; -export type GridlinesConfigResult = AxesSettingsConfig & { type: 'lens_xy_gridlinesConfig' }; - -export const gridlinesConfig: ExpressionFunctionDefinition< - 'lens_xy_gridlinesConfig', +export const gridlinesConfigFunction: ExpressionFunctionDefinition< + typeof GRID_LINES_CONFIG, null, AxesSettingsConfig, GridlinesConfigResult > = { - name: 'lens_xy_gridlinesConfig', + name: GRID_LINES_CONFIG, aliases: [], - type: 'lens_xy_gridlinesConfig', - help: `Configure the xy chart's gridlines appearance`, + type: GRID_LINES_CONFIG, + help: i18n.translate('expressionXY.gridlinesConfig.help', { + defaultMessage: `Configure the xy chart's gridlines appearance`, + }), inputTypes: ['null'], args: { x: { types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.xAxisGridlines.help', { + help: i18n.translate('expressionXY.gridlinesConfig.x.help', { defaultMessage: 'Specifies whether or not the gridlines of the x-axis are visible.', }), }, yLeft: { types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.yLeftAxisgridlines.help', { + help: i18n.translate('expressionXY.gridlinesConfig.yLeft.help', { defaultMessage: 'Specifies whether or not the gridlines of the left y-axis are visible.', }), }, yRight: { types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.yRightAxisgridlines.help', { + help: i18n.translate('expressionXY.gridlinesConfig.yRight.help', { defaultMessage: 'Specifies whether or not the gridlines of the right y-axis are visible.', }), }, }, - fn: function fn(input: unknown, args: AxesSettingsConfig) { + fn(input, args) { return { - type: 'lens_xy_gridlinesConfig', + type: GRID_LINES_CONFIG, ...args, }; }, diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/index.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/index.ts new file mode 100644 index 0000000000000..5c7e013a91332 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './xy_vis'; +export * from './legend_config'; +export * from './annotation_layer_config'; +export * from './y_axis_config'; +export * from './data_layer_config'; +export * from './grid_lines_config'; +export * from './axis_extent_config'; +export * from './tick_labels_config'; +export * from './labels_orientation_config'; +export * from './reference_line_layer_config'; +export * from './axis_titles_visibility_config'; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/labels_orientation_config.test.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/labels_orientation_config.test.ts new file mode 100644 index 0000000000000..2d54a729d3e5a --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/labels_orientation_config.test.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 { LabelsOrientationConfig } from '../types'; +import { labelsOrientationConfigFunction } from '../expression_functions'; +import { createMockExecutionContext } from '../../../../../plugins/expressions/common/mocks'; + +describe('labelsOrientationConfig', () => { + test('produces the correct arguments', () => { + const args: LabelsOrientationConfig = { x: 0, yLeft: -90, yRight: -45 }; + const result = labelsOrientationConfigFunction.fn(null, args, createMockExecutionContext()); + + expect(result).toEqual({ type: 'labelsOrientationConfig', ...args }); + }); +}); diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/labels_orientation_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/labels_orientation_config.ts similarity index 50% rename from x-pack/plugins/lens/common/expressions/xy_chart/labels_orientation_config.ts rename to src/plugins/chart_expressions/expression_xy/common/expression_functions/labels_orientation_config.ts index 773ce61a102f9..94d726c56f3b2 100644 --- a/x-pack/plugins/lens/common/expressions/xy_chart/labels_orientation_config.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/labels_orientation_config.ts @@ -1,59 +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. + * 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 type { ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions/common'; +import { LABELS_ORIENTATION_CONFIG } from '../constants'; +import { LabelsOrientationConfig, LabelsOrientationConfigResult } from '../types'; -export interface LabelsOrientationConfig { - x: number; - yLeft: number; - yRight: number; -} - -export type LabelsOrientationConfigResult = LabelsOrientationConfig & { - type: 'lens_xy_labelsOrientationConfig'; -}; - -export const labelsOrientationConfig: ExpressionFunctionDefinition< - 'lens_xy_labelsOrientationConfig', +export const labelsOrientationConfigFunction: ExpressionFunctionDefinition< + typeof LABELS_ORIENTATION_CONFIG, null, LabelsOrientationConfig, LabelsOrientationConfigResult > = { - name: 'lens_xy_labelsOrientationConfig', + name: LABELS_ORIENTATION_CONFIG, aliases: [], - type: 'lens_xy_labelsOrientationConfig', - help: `Configure the xy chart's tick labels orientation`, + type: LABELS_ORIENTATION_CONFIG, + help: i18n.translate('expressionXY.labelsOrientationConfig.help', { + defaultMessage: `Configure the xy chart's tick labels orientation`, + }), inputTypes: ['null'], args: { x: { types: ['number'], options: [0, -90, -45], - help: i18n.translate('xpack.lens.xyChart.xAxisLabelsOrientation.help', { + help: i18n.translate('expressionXY.labelsOrientationConfig.x.help', { defaultMessage: 'Specifies the labels orientation of the x-axis.', }), }, yLeft: { types: ['number'], options: [0, -90, -45], - help: i18n.translate('xpack.lens.xyChart.yLeftAxisLabelsOrientation.help', { + help: i18n.translate('expressionXY.labelsOrientationConfig.yLeft.help', { defaultMessage: 'Specifies the labels orientation of the left y-axis.', }), }, yRight: { types: ['number'], options: [0, -90, -45], - help: i18n.translate('xpack.lens.xyChart.yRightAxisLabelsOrientation.help', { + help: i18n.translate('expressionXY.labelsOrientationConfig.yRight.help', { defaultMessage: 'Specifies the labels orientation of the right y-axis.', }), }, }, - fn: function fn(input: unknown, args: LabelsOrientationConfig) { + fn(input, args) { return { - type: 'lens_xy_labelsOrientationConfig', + type: LABELS_ORIENTATION_CONFIG, ...args, }; }, diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/legend_config.test.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/legend_config.test.ts new file mode 100644 index 0000000000000..2c673ab990ded --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/legend_config.test.ts @@ -0,0 +1,21 @@ +/* + * 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 { Position } from '@elastic/charts'; +import { createMockExecutionContext } from '../../../../expressions/common/mocks'; +import { LegendConfig } from '../types'; +import { legendConfigFunction } from './legend_config'; + +describe('legendConfigFunction', () => { + test('produces the correct arguments', () => { + const args: LegendConfig = { isVisible: true, position: Position.Left }; + const result = legendConfigFunction.fn(null, args, createMockExecutionContext()); + + expect(result).toEqual({ type: 'legendConfig', ...args }); + }); +}); diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/legend_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/legend_config.ts new file mode 100644 index 0000000000000..384f23aee811a --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/legend_config.ts @@ -0,0 +1,102 @@ +/* + * 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 { HorizontalAlignment, Position, VerticalAlignment } from '@elastic/charts'; +import { i18n } from '@kbn/i18n'; +import type { ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions/common'; +import { LEGEND_CONFIG } from '../constants'; +import { LegendConfig, LegendConfigResult } from '../types'; + +export const legendConfigFunction: ExpressionFunctionDefinition< + typeof LEGEND_CONFIG, + null, + LegendConfig, + LegendConfigResult +> = { + name: LEGEND_CONFIG, + aliases: [], + type: LEGEND_CONFIG, + help: i18n.translate('expressionXY.legendConfig.help', { + defaultMessage: `Configure the xy chart's legend`, + }), + inputTypes: ['null'], + args: { + isVisible: { + types: ['boolean'], + help: i18n.translate('expressionXY.legendConfig.isVisible.help', { + defaultMessage: 'Specifies whether or not the legend is visible.', + }), + }, + position: { + types: ['string'], + options: [Position.Top, Position.Right, Position.Bottom, Position.Left], + help: i18n.translate('expressionXY.legendConfig.position.help', { + defaultMessage: 'Specifies the legend position.', + }), + }, + showSingleSeries: { + types: ['boolean'], + help: i18n.translate('expressionXY.legendConfig.showSingleSeries.help', { + defaultMessage: 'Specifies whether a legend with just a single entry should be shown', + }), + }, + isInside: { + types: ['boolean'], + help: i18n.translate('expressionXY.legendConfig.isInside.help', { + defaultMessage: 'Specifies whether a legend is inside the chart', + }), + }, + horizontalAlignment: { + types: ['string'], + options: [HorizontalAlignment.Right, HorizontalAlignment.Left], + help: i18n.translate('expressionXY.legendConfig.horizontalAlignment.help', { + defaultMessage: + 'Specifies the horizontal alignment of the legend when it is displayed inside chart.', + }), + }, + verticalAlignment: { + types: ['string'], + options: [VerticalAlignment.Top, VerticalAlignment.Bottom], + help: i18n.translate('expressionXY.legendConfig.verticalAlignment.help', { + defaultMessage: + 'Specifies the vertical alignment of the legend when it is displayed inside chart.', + }), + }, + floatingColumns: { + types: ['number'], + help: i18n.translate('expressionXY.legendConfig.floatingColumns.help', { + defaultMessage: 'Specifies the number of columns when legend is displayed inside chart.', + }), + }, + maxLines: { + types: ['number'], + help: i18n.translate('expressionXY.legendConfig.maxLines.help', { + defaultMessage: 'Specifies the number of lines per legend item.', + }), + }, + shouldTruncate: { + types: ['boolean'], + default: true, + help: i18n.translate('expressionXY.legendConfig.shouldTruncate.help', { + defaultMessage: 'Specifies whether the legend items will be truncated or not', + }), + }, + legendSize: { + types: ['number'], + help: i18n.translate('expressionXY.legendConfig.legendSize.help', { + defaultMessage: 'Specifies the legend size in pixels.', + }), + }, + }, + fn(input, args) { + return { + type: LEGEND_CONFIG, + ...args, + }; + }, +}; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/reference_line_layer_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/reference_line_layer_config.ts new file mode 100644 index 0000000000000..c5d0f17ff138d --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/reference_line_layer_config.ts @@ -0,0 +1,62 @@ +/* + * 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 type { ExpressionFunctionDefinition } from '../../../../expressions/common'; +import { LayerTypes, REFERENCE_LINE_LAYER, Y_CONFIG } from '../constants'; +import { ReferenceLineLayerArgs, ReferenceLineLayerConfigResult } from '../types'; + +export const referenceLineLayerConfigFunction: ExpressionFunctionDefinition< + typeof REFERENCE_LINE_LAYER, + null, + ReferenceLineLayerArgs, + ReferenceLineLayerConfigResult +> = { + name: REFERENCE_LINE_LAYER, + aliases: [], + type: REFERENCE_LINE_LAYER, + help: i18n.translate('expressionXY.referenceLineLayer.help', { + defaultMessage: `Configure a reference line in the xy chart`, + }), + inputTypes: ['null'], + args: { + layerId: { + types: ['string'], + help: i18n.translate('expressionXY.referenceLineLayer.layerId.help', { + defaultMessage: `Layer ID`, + }), + }, + accessors: { + types: ['string'], + help: i18n.translate('expressionXY.referenceLineLayer.accessors.help', { + defaultMessage: 'The columns to display on the y axis.', + }), + multi: true, + }, + yConfig: { + types: [Y_CONFIG], + help: i18n.translate('expressionXY.referenceLineLayer.yConfig.help', { + defaultMessage: 'Additional configuration for y axes', + }), + multi: true, + }, + columnToLabel: { + types: ['string'], + help: i18n.translate('expressionXY.referenceLineLayer.columnToLabel.help', { + defaultMessage: 'JSON key-value pairs of column ID to label', + }), + }, + }, + fn(input, args) { + return { + type: REFERENCE_LINE_LAYER, + ...args, + layerType: LayerTypes.REFERENCELINE, + }; + }, +}; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/tick_labels_config.test.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/tick_labels_config.test.ts new file mode 100644 index 0000000000000..8b31258377dd9 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/tick_labels_config.test.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 { AxesSettingsConfig } from '../types'; +import { tickLabelsConfigFunction } from '../expression_functions'; +import { createMockExecutionContext } from '../../../../../plugins/expressions/common/mocks'; + +describe('tickLabelsConfig', () => { + test('produces the correct arguments', () => { + const args: AxesSettingsConfig = { x: true, yLeft: false, yRight: false }; + const result = tickLabelsConfigFunction.fn(null, args, createMockExecutionContext()); + + expect(result).toEqual({ type: 'tickLabelsConfig', ...args }); + }); +}); diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/tick_labels_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/tick_labels_config.ts similarity index 51% rename from x-pack/plugins/lens/common/expressions/xy_chart/tick_labels_config.ts rename to src/plugins/chart_expressions/expression_xy/common/expression_functions/tick_labels_config.ts index 4af78d8355786..6a882094a56d2 100644 --- a/x-pack/plugins/lens/common/expressions/xy_chart/tick_labels_config.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/tick_labels_config.ts @@ -1,50 +1,52 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; import type { ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions/common'; -import type { AxesSettingsConfig } from './axis_config'; +import { TICK_LABELS_CONFIG } from '../constants'; +import { AxesSettingsConfig, TickLabelsConfigResult } from '../types'; -export type TickLabelsConfigResult = AxesSettingsConfig & { type: 'lens_xy_tickLabelsConfig' }; - -export const tickLabelsConfig: ExpressionFunctionDefinition< - 'lens_xy_tickLabelsConfig', +export const tickLabelsConfigFunction: ExpressionFunctionDefinition< + typeof TICK_LABELS_CONFIG, null, AxesSettingsConfig, TickLabelsConfigResult > = { - name: 'lens_xy_tickLabelsConfig', + name: TICK_LABELS_CONFIG, aliases: [], - type: 'lens_xy_tickLabelsConfig', - help: `Configure the xy chart's tick labels appearance`, + type: TICK_LABELS_CONFIG, + help: i18n.translate('expressionXY.tickLabelsConfig.help', { + defaultMessage: `Configure the xy chart's tick labels appearance`, + }), inputTypes: ['null'], args: { x: { types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.xAxisTickLabels.help', { + help: i18n.translate('expressionXY.tickLabelsConfig.x.help', { defaultMessage: 'Specifies whether or not the tick labels of the x-axis are visible.', }), }, yLeft: { types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.yLeftAxisTickLabels.help', { + help: i18n.translate('expressionXY.tickLabelsConfig.yLeft.help', { defaultMessage: 'Specifies whether or not the tick labels of the left y-axis are visible.', }), }, yRight: { types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.yRightAxisTickLabels.help', { + help: i18n.translate('expressionXY.tickLabelsConfig.yRight.help', { defaultMessage: 'Specifies whether or not the tick labels of the right y-axis are visible.', }), }, }, - fn: function fn(input: unknown, args: AxesSettingsConfig) { + fn(input, args) { return { - type: 'lens_xy_tickLabelsConfig', + type: TICK_LABELS_CONFIG, ...args, }; }, diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.test.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.test.ts new file mode 100644 index 0000000000000..69d0bf51b3d64 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.test.ts @@ -0,0 +1,21 @@ +/* + * 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 { xyVisFunction } from '../expression_functions'; +import { createMockExecutionContext } from '../../../../../plugins/expressions/common/mocks'; +import { sampleArgs } from '../__mocks__'; +import { XY_VIS } from '../constants'; + +describe('xyVis', () => { + test('it renders with the specified data and args', () => { + const { data, args } = sampleArgs(); + const result = xyVisFunction.fn(data, args, createMockExecutionContext()); + + expect(result).toEqual({ type: 'render', as: XY_VIS, value: { data, args } }); + }); +}); diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/xy_chart.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.ts similarity index 53% rename from x-pack/plugins/lens/common/expressions/xy_chart/xy_chart.ts rename to src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.ts index 3c68837defdd9..0f83aeecc7a20 100644 --- a/x-pack/plugins/lens/common/expressions/xy_chart/xy_chart.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.ts @@ -1,58 +1,64 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import { i18n } from '@kbn/i18n'; -import type { ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions/common'; -import type { ExpressionValueSearchContext } from '../../../../../../src/plugins/data/common'; -import type { LensMultiTable } from '../../types'; -import type { XYArgs } from './xy_args'; -import { fittingFunctionDefinitions } from './fitting_function'; +import type { ExpressionFunctionDefinition } from '../../../../expressions'; +import { LensMultiTable, XYArgs, XYRender } from '../types'; import { prepareLogTable } from '../../../../../../src/plugins/visualizations/common/utils'; -import { endValueDefinitions } from './end_value'; - -export interface XYChartProps { - data: LensMultiTable; - args: XYArgs; -} +import { + XY_VIS, + DATA_LAYER, + MULTITABLE, + XYCurveTypes, + LEGEND_CONFIG, + ValueLabelModes, + FittingFunctions, + GRID_LINES_CONFIG, + XY_VIS_RENDERER, + AXIS_EXTENT_CONFIG, + TICK_LABELS_CONFIG, + REFERENCE_LINE_LAYER, + LABELS_ORIENTATION_CONFIG, + AXIS_TITLES_VISIBILITY_CONFIG, + EndValues, + ANNOTATION_LAYER, + LayerTypes, +} from '../constants'; const strings = { getMetricHelp: () => - i18n.translate('xpack.lens.xy.logDatatable.metric', { + i18n.translate('expressionXY.xyVis.logDatatable.metric', { defaultMessage: 'Vertical axis', }), getXAxisHelp: () => - i18n.translate('xpack.lens.xy.logDatatable.x', { + i18n.translate('expressionXY.xyVis.logDatatable.x', { defaultMessage: 'Horizontal axis', }), getBreakdownHelp: () => - i18n.translate('xpack.lens.xy.logDatatable.breakDown', { + i18n.translate('expressionXY.xyVis.logDatatable.breakDown', { defaultMessage: 'Break down by', }), getReferenceLineHelp: () => - i18n.translate('xpack.lens.xy.logDatatable.breakDown', { + i18n.translate('expressionXY.xyVis.logDatatable.breakDown', { defaultMessage: 'Break down by', }), }; -export interface XYRender { - type: 'render'; - as: 'lens_xy_chart_renderer'; - value: XYChartProps; -} - -export const xyChart: ExpressionFunctionDefinition< - 'lens_xy_chart', - LensMultiTable | ExpressionValueSearchContext | null, +export const xyVisFunction: ExpressionFunctionDefinition< + typeof XY_VIS, + LensMultiTable, XYArgs, XYRender > = { - name: 'lens_xy_chart', + name: XY_VIS, type: 'render', - inputTypes: ['lens_multitable', 'kibana_context', 'null'], - help: i18n.translate('xpack.lens.xyChart.help', { + inputTypes: [MULTITABLE], + help: i18n.translate('expressionXY.xyVis.help', { defaultMessage: 'An X/Y chart', }), args: { @@ -66,51 +72,53 @@ export const xyChart: ExpressionFunctionDefinition< }, xTitle: { types: ['string'], - help: i18n.translate('xpack.lens.xyChart.xTitle.help', { + help: i18n.translate('expressionXY.xyVis.xTitle.help', { defaultMessage: 'X axis title', }), }, yTitle: { types: ['string'], - help: i18n.translate('xpack.lens.xyChart.yLeftTitle.help', { + help: i18n.translate('expressionXY.xyVis.yLeftTitle.help', { defaultMessage: 'Y left axis title', }), }, yRightTitle: { types: ['string'], - help: i18n.translate('xpack.lens.xyChart.yRightTitle.help', { + help: i18n.translate('expressionXY.xyVis.yRightTitle.help', { defaultMessage: 'Y right axis title', }), }, yLeftExtent: { - types: ['lens_xy_axisExtentConfig'], - help: i18n.translate('xpack.lens.xyChart.yLeftExtent.help', { + types: [AXIS_EXTENT_CONFIG], + help: i18n.translate('expressionXY.xyVis.yLeftExtent.help', { defaultMessage: 'Y left axis extents', }), }, yRightExtent: { - types: ['lens_xy_axisExtentConfig'], - help: i18n.translate('xpack.lens.xyChart.yRightExtent.help', { + types: [AXIS_EXTENT_CONFIG], + help: i18n.translate('expressionXY.xyVis.yRightExtent.help', { defaultMessage: 'Y right axis extents', }), }, legend: { - types: ['lens_xy_legendConfig'], - help: i18n.translate('xpack.lens.xyChart.legend.help', { + types: [LEGEND_CONFIG], + help: i18n.translate('expressionXY.xyVis.legend.help', { defaultMessage: 'Configure the chart legend.', }), }, fittingFunction: { types: ['string'], - options: [...fittingFunctionDefinitions.map(({ id }) => id)], - help: i18n.translate('xpack.lens.xyChart.fittingFunction.help', { + options: [...Object.values(FittingFunctions)], + help: i18n.translate('expressionXY.xyVis.fittingFunction.help', { defaultMessage: 'Define how missing values are treated', }), }, endValue: { types: ['string'], - options: [...endValueDefinitions.map(({ id }) => id)], - help: '', + options: [...Object.values(EndValues)], + help: i18n.translate('expressionXY.xyVis.endValue.help', { + defaultMessage: 'End value', + }), }, emphasizeFitting: { types: ['boolean'], @@ -119,85 +127,92 @@ export const xyChart: ExpressionFunctionDefinition< }, valueLabels: { types: ['string'], - options: ['hide', 'inside'], - help: '', + options: [...Object.values(ValueLabelModes)], + help: i18n.translate('expressionXY.xyVis.valueLabels.help', { + defaultMessage: 'Value labels mode', + }), }, tickLabelsVisibilitySettings: { - types: ['lens_xy_tickLabelsConfig'], - help: i18n.translate('xpack.lens.xyChart.tickLabelsSettings.help', { + types: [TICK_LABELS_CONFIG], + help: i18n.translate('expressionXY.xyVis.tickLabelsVisibilitySettings.help', { defaultMessage: 'Show x and y axes tick labels', }), }, labelsOrientation: { - types: ['lens_xy_labelsOrientationConfig'], - help: i18n.translate('xpack.lens.xyChart.labelsOrientation.help', { + types: [LABELS_ORIENTATION_CONFIG], + help: i18n.translate('expressionXY.xyVis.labelsOrientation.help', { defaultMessage: 'Defines the rotation of the axis labels', }), }, gridlinesVisibilitySettings: { - types: ['lens_xy_gridlinesConfig'], - help: i18n.translate('xpack.lens.xyChart.gridlinesSettings.help', { + types: [GRID_LINES_CONFIG], + help: i18n.translate('expressionXY.xyVis.gridlinesVisibilitySettings.help', { defaultMessage: 'Show x and y axes gridlines', }), }, axisTitlesVisibilitySettings: { - types: ['lens_xy_axisTitlesVisibilityConfig'], - help: i18n.translate('xpack.lens.xyChart.axisTitlesSettings.help', { + types: [AXIS_TITLES_VISIBILITY_CONFIG], + help: i18n.translate('expressionXY.xyVis.axisTitlesVisibilitySettings.help', { defaultMessage: 'Show x and y axes titles', }), }, layers: { - types: [ - 'lens_xy_data_layer', - 'lens_xy_referenceLine_layer', - 'lens_xy_annotation_layer', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ] as any, - help: 'Layers of visual series', + types: [DATA_LAYER, REFERENCE_LINE_LAYER, ANNOTATION_LAYER], + help: i18n.translate('expressionXY.xyVis.layers.help', { + defaultMessage: 'Layers of visual series', + }), multi: true, }, curveType: { types: ['string'], - options: ['LINEAR', 'CURVE_MONOTONE_X'], - help: i18n.translate('xpack.lens.xyChart.curveType.help', { + options: [...Object.values(XYCurveTypes)], + help: i18n.translate('expressionXY.xyVis.curveType.help', { defaultMessage: 'Define how curve type is rendered for a line chart', }), }, fillOpacity: { types: ['number'], - help: i18n.translate('xpack.lens.xyChart.fillOpacity.help', { + help: i18n.translate('expressionXY.xyVis.fillOpacity.help', { defaultMessage: 'Define the area chart fill opacity', }), }, hideEndzones: { types: ['boolean'], default: false, - help: i18n.translate('xpack.lens.xyChart.hideEndzones.help', { + help: i18n.translate('expressionXY.xyVis.hideEndzones.help', { defaultMessage: 'Hide endzone markers for partial data', }), }, valuesInLegend: { types: ['boolean'], default: false, - help: i18n.translate('xpack.lens.xyChart.valuesInLegend.help', { + help: i18n.translate('expressionXY.xyVis.valuesInLegend.help', { defaultMessage: 'Show values in legend', }), }, ariaLabel: { types: ['string'], - help: i18n.translate('xpack.lens.xyChart.ariaLabel.help', { + help: i18n.translate('expressionXY.xyVis.ariaLabel.help', { defaultMessage: 'Specifies the aria label of the xy chart', }), required: false, }, }, - fn(data: LensMultiTable, args: XYArgs, handlers) { + fn(data, args, handlers) { if (handlers?.inspectorAdapters?.tables) { args.layers.forEach((layer) => { - if (layer.layerType === 'annotations') { + if (layer.layerType === LayerTypes.ANNOTATIONS) { return; } - const { layerId, accessors, xAccessor, splitAccessor, layerType } = layer; + + let xAccessor; + let splitAccessor; + if (layer.layerType === LayerTypes.DATA) { + xAccessor = layer.xAccessor; + splitAccessor = layer.splitAccessor; + } + + const { layerId, accessors, layerType } = layer; const logTable = prepareLogTable( data.tables[layerId], [ @@ -214,9 +229,10 @@ export const xyChart: ExpressionFunctionDefinition< handlers.inspectorAdapters.tables.logDatatable(layerId, logTable); }); } + return { type: 'render', - as: 'lens_xy_chart_renderer', + as: XY_VIS_RENDERER, value: { data, args: { diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/y_axis_config.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/y_axis_config.ts new file mode 100644 index 0000000000000..e665fc2b8cea0 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/y_axis_config.ts @@ -0,0 +1,93 @@ +/* + * 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 type { ExpressionFunctionDefinition } from '../../../../expressions/common'; +import { FillStyles, IconPositions, LineStyles, YAxisModes, Y_CONFIG } from '../constants'; +import { YConfig, YConfigResult } from '../types'; + +export const yAxisConfigFunction: ExpressionFunctionDefinition< + typeof Y_CONFIG, + null, + YConfig, + YConfigResult +> = { + name: Y_CONFIG, + aliases: [], + type: Y_CONFIG, + help: i18n.translate('expressionXY.yConfig.help', { + defaultMessage: `Configure the behavior of a xy chart's y axis metric`, + }), + inputTypes: ['null'], + args: { + forAccessor: { + types: ['string'], + help: i18n.translate('expressionXY.yConfig.forAccessor.help', { + defaultMessage: 'The accessor this configuration is for', + }), + }, + axisMode: { + types: ['string'], + options: [...Object.values(YAxisModes)], + help: i18n.translate('expressionXY.yConfig.axisMode.help', { + defaultMessage: 'The axis mode of the metric', + }), + }, + color: { + types: ['string'], + help: i18n.translate('expressionXY.yConfig.color.help', { + defaultMessage: 'The color of the series', + }), + }, + lineStyle: { + types: ['string'], + options: [...Object.values(LineStyles)], + help: i18n.translate('expressionXY.yConfig.lineStyle.help', { + defaultMessage: 'The style of the reference line', + }), + }, + lineWidth: { + types: ['number'], + help: i18n.translate('expressionXY.yConfig.lineWidth.help', { + defaultMessage: 'The width of the reference line', + }), + }, + icon: { + types: ['string'], + help: i18n.translate('expressionXY.yConfig.icon.help', { + defaultMessage: 'An optional icon used for reference lines', + }), + }, + iconPosition: { + types: ['string'], + options: [...Object.values(IconPositions)], + help: i18n.translate('expressionXY.yConfig.iconPosition.help', { + defaultMessage: 'The placement of the icon for the reference line', + }), + }, + textVisibility: { + types: ['boolean'], + help: i18n.translate('expressionXY.yConfig.textVisibility.help', { + defaultMessage: 'Visibility of the label on the reference line', + }), + }, + fill: { + types: ['string'], + options: [...Object.values(FillStyles)], + help: i18n.translate('expressionXY.yConfig.fill.help', { + defaultMessage: 'Fill', + }), + }, + }, + fn(input, args) { + return { + type: Y_CONFIG, + ...args, + }; + }, +}; diff --git a/src/plugins/chart_expressions/expression_xy/common/index.ts b/src/plugins/chart_expressions/expression_xy/common/index.ts new file mode 100755 index 0000000000000..68f9f946baeb0 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/index.ts @@ -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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export const PLUGIN_ID = 'expressionXy'; +export const PLUGIN_NAME = 'expressionXy'; + +export { + xyVisFunction, + yAxisConfigFunction, + legendConfigFunction, + gridlinesConfigFunction, + dataLayerConfigFunction, + axisExtentConfigFunction, + tickLabelsConfigFunction, + annotationLayerConfigFunction, + labelsOrientationConfigFunction, + referenceLineLayerConfigFunction, + axisTitlesVisibilityConfigFunction, +} from './expression_functions'; + +export type { + XYArgs, + YConfig, + EndValue, + XYRender, + LayerType, + YAxisMode, + LineStyle, + FillStyle, + SeriesType, + YScaleType, + XScaleType, + AxisConfig, + ValidLayer, + XYLayerArgs, + XYCurveType, + XYChartProps, + LegendConfig, + IconPosition, + YConfigResult, + DataLayerArgs, + LensMultiTable, + ValueLabelMode, + AxisExtentMode, + FittingFunction, + AxisExtentConfig, + LegendConfigResult, + AxesSettingsConfig, + AnnotationLayerArgs, + XYLayerConfigResult, + GridlinesConfigResult, + DataLayerConfigResult, + TickLabelsConfigResult, + AxisExtentConfigResult, + ReferenceLineLayerArgs, + LabelsOrientationConfig, + AnnotationLayerConfigResult, + LabelsOrientationConfigResult, + ReferenceLineLayerConfigResult, + AxisTitlesVisibilityConfigResult, +} from './types'; diff --git a/src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts new file mode 100644 index 0000000000000..98889da771c04 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts @@ -0,0 +1,239 @@ +/* + * 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 { HorizontalAlignment, Position, VerticalAlignment } from '@elastic/charts'; +import { $Values } from '@kbn/utility-types'; +import { Datatable } from '../../../../expressions'; +import { PaletteOutput } from '../../../../charts/common'; +import { EventAnnotationOutput } from '../../../../event_annotation/common'; +import { + AxisExtentModes, + FillStyles, + FittingFunctions, + IconPositions, + LayerTypes, + MULTITABLE, + LineStyles, + SeriesTypes, + ValueLabelModes, + XScaleTypes, + XYCurveTypes, + YAxisModes, + YScaleTypes, + REFERENCE_LINE_LAYER, + Y_CONFIG, + AXIS_TITLES_VISIBILITY_CONFIG, + LABELS_ORIENTATION_CONFIG, + TICK_LABELS_CONFIG, + GRID_LINES_CONFIG, + LEGEND_CONFIG, + DATA_LAYER, + AXIS_EXTENT_CONFIG, + ANNOTATION_LAYER, + EndValues, +} from '../constants'; + +export type EndValue = $Values; +export type LayerType = $Values; +export type YAxisMode = $Values; +export type LineStyle = $Values; +export type FillStyle = $Values; +export type SeriesType = $Values; +export type YScaleType = $Values; +export type XScaleType = $Values; +export type XYCurveType = $Values; +export type IconPosition = $Values; +export type ValueLabelMode = $Values; +export type AxisExtentMode = $Values; +export type FittingFunction = $Values; + +export interface AxesSettingsConfig { + x: boolean; + yLeft: boolean; + yRight: boolean; +} + +export interface AxisExtentConfig { + mode: AxisExtentMode; + lowerBound?: number; + upperBound?: number; +} + +export interface AxisConfig { + title: string; + hide?: boolean; +} + +export interface YConfig { + forAccessor: string; + axisMode?: YAxisMode; + color?: string; + icon?: string; + lineWidth?: number; + lineStyle?: LineStyle; + fill?: FillStyle; + iconPosition?: IconPosition; + textVisibility?: boolean; +} + +export interface ValidLayer extends DataLayerConfigResult { + xAccessor: NonNullable; +} + +export interface DataLayerArgs { + layerId: string; + accessors: string[]; + seriesType: SeriesType; + xAccessor?: string; + hide?: boolean; + splitAccessor?: string; + columnToLabel?: string; // Actually a JSON key-value pair + yScaleType: YScaleType; + xScaleType: XScaleType; + isHistogram: boolean; + // palette will always be set on the expression + palette: PaletteOutput; + yConfig?: YConfigResult[]; +} + +export interface LegendConfig { + /** + * Flag whether the legend should be shown. If there is just a single series, it will be hidden + */ + isVisible: boolean; + /** + * Position of the legend relative to the chart + */ + position: Position; + /** + * Flag whether the legend should be shown even with just a single series + */ + showSingleSeries?: boolean; + /** + * Flag whether the legend is inside the chart + */ + isInside?: boolean; + /** + * Horizontal Alignment of the legend when it is set inside chart + */ + horizontalAlignment?: HorizontalAlignment; + /** + * Vertical Alignment of the legend when it is set inside chart + */ + verticalAlignment?: VerticalAlignment; + /** + * Number of columns when legend is set inside chart + */ + floatingColumns?: number; + /** + * Maximum number of lines per legend item + */ + maxLines?: number; + + /** + * Flag whether the legend items are truncated or not + */ + shouldTruncate?: boolean; + + /** + * Exact legend width (vertical) or height (horizontal) + * Limited to max of 70% of the chart container dimension Vertical legends limited to min of 30% of computed width + */ + legendSize?: number; +} + +export interface LabelsOrientationConfig { + x: number; + yLeft: number; + yRight: number; +} + +// Arguments to XY chart expression, with computed properties +export interface XYArgs { + title?: string; + description?: string; + xTitle: string; + yTitle: string; + yRightTitle: string; + yLeftExtent: AxisExtentConfigResult; + yRightExtent: AxisExtentConfigResult; + legend: LegendConfigResult; + valueLabels: ValueLabelMode; + layers: XYLayerConfigResult[]; + endValue?: EndValue; + emphasizeFitting?: boolean; + fittingFunction?: FittingFunction; + axisTitlesVisibilitySettings?: AxisTitlesVisibilityConfigResult; + tickLabelsVisibilitySettings?: TickLabelsConfigResult; + gridlinesVisibilitySettings?: GridlinesConfigResult; + labelsOrientation?: LabelsOrientationConfigResult; + curveType?: XYCurveType; + fillOpacity?: number; + hideEndzones?: boolean; + valuesInLegend?: boolean; + ariaLabel?: string; +} + +export interface AnnotationLayerArgs { + annotations: EventAnnotationOutput[]; + layerId: string; + hide?: boolean; +} + +export type AnnotationLayerConfigResult = AnnotationLayerArgs & { + type: typeof ANNOTATION_LAYER; + layerType: typeof LayerTypes.ANNOTATIONS; +}; + +export interface ReferenceLineLayerArgs { + layerId: string; + accessors: string[]; + columnToLabel?: string; + yConfig?: YConfigResult[]; +} + +export type XYLayerArgs = DataLayerArgs | ReferenceLineLayerArgs | AnnotationLayerArgs; + +export type XYLayerConfigResult = + | DataLayerConfigResult + | ReferenceLineLayerConfigResult + | AnnotationLayerConfigResult; + +export interface LensMultiTable { + type: typeof MULTITABLE; + tables: Record; + dateRange?: { + fromDate: Date; + toDate: Date; + }; +} + +export type ReferenceLineLayerConfigResult = ReferenceLineLayerArgs & { + type: typeof REFERENCE_LINE_LAYER; + layerType: typeof LayerTypes.REFERENCELINE; +}; + +export type DataLayerConfigResult = DataLayerArgs & { + type: typeof DATA_LAYER; + layerType: typeof LayerTypes.DATA; +}; + +export type YConfigResult = YConfig & { type: typeof Y_CONFIG }; + +export type AxisTitlesVisibilityConfigResult = AxesSettingsConfig & { + type: typeof AXIS_TITLES_VISIBILITY_CONFIG; +}; + +export type LabelsOrientationConfigResult = LabelsOrientationConfig & { + type: typeof LABELS_ORIENTATION_CONFIG; +}; + +export type LegendConfigResult = LegendConfig & { type: typeof LEGEND_CONFIG }; +export type AxisExtentConfigResult = AxisExtentConfig & { type: typeof AXIS_EXTENT_CONFIG }; +export type GridlinesConfigResult = AxesSettingsConfig & { type: typeof GRID_LINES_CONFIG }; +export type TickLabelsConfigResult = AxesSettingsConfig & { type: typeof TICK_LABELS_CONFIG }; diff --git a/src/plugins/chart_expressions/expression_xy/common/types/expression_renderers.ts b/src/plugins/chart_expressions/expression_xy/common/types/expression_renderers.ts new file mode 100644 index 0000000000000..1acb98903d06b --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/types/expression_renderers.ts @@ -0,0 +1,21 @@ +/* + * 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 { XY_VIS_RENDERER } from '../constants'; +import { LensMultiTable, XYArgs } from './expression_functions'; + +export interface XYChartProps { + data: LensMultiTable; + args: XYArgs; +} + +export interface XYRender { + type: 'render'; + as: typeof XY_VIS_RENDERER; + value: XYChartProps; +} diff --git a/src/plugins/chart_expressions/expression_xy/common/types/index.ts b/src/plugins/chart_expressions/expression_xy/common/types/index.ts new file mode 100644 index 0000000000000..9c50bfab1305d --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/common/types/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './expression_functions'; +export * from './expression_renderers'; diff --git a/src/plugins/chart_expressions/expression_xy/jest.config.js b/src/plugins/chart_expressions/expression_xy/jest.config.js new file mode 100644 index 0000000000000..6d742af9a6f3d --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/jest.config.js @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../', + roots: ['/src/plugins/chart_expressions/expression_xy'], + coverageDirectory: + '/target/kibana-coverage/jest/src/plugins/chart_expressions/expression_xy', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/src/plugins/chart_expressions/expression_xy/{common,public,server}/**/*.{ts,tsx}', + ], +}; diff --git a/src/plugins/chart_expressions/expression_xy/kibana.json b/src/plugins/chart_expressions/expression_xy/kibana.json new file mode 100755 index 0000000000000..e9680d9b85163 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/kibana.json @@ -0,0 +1,15 @@ +{ + "id": "expressionXY", + "version": "1.0.0", + "kibanaVersion": "kibana", + "owner": { + "name": "Vis Editors", + "githubTeam": "kibana-vis-editors" + }, + "description": "Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart.", + "server": true, + "ui": true, + "requiredPlugins": ["expressions", "charts", "data", "fieldFormats", "uiActions", "eventAnnotation", "visualizations"], + "requiredBundles": ["kibanaReact"], + "optionalPlugins": [] +} diff --git a/src/plugins/chart_expressions/expression_xy/public/__mocks__/index.tsx b/src/plugins/chart_expressions/expression_xy/public/__mocks__/index.tsx new file mode 100644 index 0000000000000..cc73950438f38 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/__mocks__/index.tsx @@ -0,0 +1,224 @@ +/* + * 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 { chartPluginMock } from '../../../../../plugins/charts/public/mocks'; +import { DataLayerConfigResult, LensMultiTable, XYArgs } from '../../common'; +import { LayerTypes } from '../../common/constants'; +import { mockPaletteOutput, sampleArgs } from '../../common/__mocks__'; + +const chartSetupContract = chartPluginMock.createSetupContract(); +const chartStartContract = chartPluginMock.createStartContract(); + +export const chartsThemeService = chartSetupContract.theme; +export const chartsActiveCursorService = chartStartContract.activeCursor; + +export const paletteService = chartPluginMock.createPaletteRegistry(); + +export const dateHistogramData: LensMultiTable = { + type: 'lens_multitable', + tables: { + timeLayer: { + type: 'datatable', + rows: [ + { + xAccessorId: 1585758120000, + splitAccessorId: "Men's Clothing", + yAccessorId: 1, + }, + { + xAccessorId: 1585758360000, + splitAccessorId: "Women's Accessories", + yAccessorId: 1, + }, + { + xAccessorId: 1585758360000, + splitAccessorId: "Women's Clothing", + yAccessorId: 1, + }, + { + xAccessorId: 1585759380000, + splitAccessorId: "Men's Clothing", + yAccessorId: 1, + }, + { + xAccessorId: 1585759380000, + splitAccessorId: "Men's Shoes", + yAccessorId: 1, + }, + { + xAccessorId: 1585759380000, + splitAccessorId: "Women's Clothing", + yAccessorId: 1, + }, + { + xAccessorId: 1585760700000, + splitAccessorId: "Men's Clothing", + yAccessorId: 1, + }, + { + xAccessorId: 1585760760000, + splitAccessorId: "Men's Clothing", + yAccessorId: 1, + }, + { + xAccessorId: 1585760760000, + splitAccessorId: "Men's Shoes", + yAccessorId: 1, + }, + { + xAccessorId: 1585761120000, + splitAccessorId: "Men's Shoes", + yAccessorId: 1, + }, + ], + columns: [ + { + id: 'xAccessorId', + name: 'order_date per minute', + meta: { + type: 'date', + field: 'order_date', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'date_histogram', + appliedTimeRange: { + from: '2020-04-01T16:14:16.246Z', + to: '2020-04-01T17:15:41.263Z', + }, + params: { + field: 'order_date', + timeRange: { from: '2020-04-01T16:14:16.246Z', to: '2020-04-01T17:15:41.263Z' }, + useNormalizedEsInterval: true, + scaleMetricValues: false, + interval: '1m', + drop_partials: false, + min_doc_count: 0, + extended_bounds: {}, + }, + }, + params: { id: 'date', params: { pattern: 'HH:mm' } }, + }, + }, + { + id: 'splitAccessorId', + name: 'Top values of category.keyword', + meta: { + type: 'string', + field: 'category.keyword', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'terms', + params: { + field: 'category.keyword', + orderBy: 'yAccessorId', + order: 'desc', + size: 3, + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + }, + params: { + id: 'terms', + params: { + id: 'string', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + parsedUrl: { + origin: 'http://localhost:5601', + pathname: '/jiy/app/kibana', + basePath: '/jiy', + }, + }, + }, + }, + }, + { + id: 'yAccessorId', + name: 'Count of records', + meta: { + type: 'number', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + params: {}, + }, + params: { id: 'number' }, + }, + }, + ], + }, + }, + dateRange: { + fromDate: new Date('2020-04-01T16:14:16.246Z'), + toDate: new Date('2020-04-01T17:15:41.263Z'), + }, +}; + +export const dateHistogramLayer: DataLayerConfigResult = { + type: 'dataLayer', + layerId: 'timeLayer', + layerType: LayerTypes.DATA, + hide: false, + xAccessor: 'xAccessorId', + yScaleType: 'linear', + xScaleType: 'time', + isHistogram: true, + splitAccessor: 'splitAccessorId', + seriesType: 'bar_stacked', + accessors: ['yAccessorId'], + palette: mockPaletteOutput, +}; + +export function sampleArgsWithReferenceLine(value: number = 150) { + const { data, args } = sampleArgs(); + + return { + data: { + ...data, + tables: { + ...data.tables, + referenceLine: { + type: 'datatable', + columns: [ + { + id: 'referenceLine-a', + meta: { params: { id: 'number' }, type: 'number' }, + name: 'Static value', + }, + ], + rows: [{ 'referenceLine-a': value }], + }, + }, + } as LensMultiTable, + args: { + ...args, + layers: [ + ...args.layers, + { + layerType: LayerTypes.REFERENCELINE, + accessors: ['referenceLine-a'], + layerId: 'referenceLine', + seriesType: 'line', + xScaleType: 'linear', + yScaleType: 'linear', + palette: mockPaletteOutput, + isHistogram: false, + hide: true, + yConfig: [{ axisMode: 'left', forAccessor: 'referenceLine-a', type: 'yConfig' }], + }, + ], + } as XYArgs, + }; +} diff --git a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap b/src/plugins/chart_expressions/expression_xy/public/components/__snapshots__/xy_chart.test.tsx.snap similarity index 97% rename from x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap rename to src/plugins/chart_expressions/expression_xy/public/components/__snapshots__/xy_chart.test.tsx.snap index fdde8eb6ad3f2..828a62c85cce3 100644 --- a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/expression.test.tsx.snap +++ b/src/plugins/chart_expressions/expression_xy/public/components/__snapshots__/xy_chart.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`xy_expression XYChart component annotations should render basic annotation 1`] = ` +exports[`XYChart component annotations should render basic annotation 1`] = ` `; -exports[`xy_expression XYChart component annotations should render grouped annotations preserving the shared styles 1`] = ` +exports[`XYChart component annotations should render grouped annotations preserving the shared styles 1`] = ` `; -exports[`xy_expression XYChart component annotations should render grouped annotations with default styles 1`] = ` +exports[`XYChart component annotations should render grouped annotations with default styles 1`] = ` `; -exports[`xy_expression XYChart component annotations should render simplified annotation when hide is true 1`] = ` +exports[`XYChart component annotations should render simplified annotation when hide is true 1`] = ` `; -exports[`xy_expression XYChart component it renders area 1`] = ` +exports[`XYChart component it renders area 1`] = ` @@ -447,7 +447,7 @@ exports[`xy_expression XYChart component it renders area 1`] = ` `; -exports[`xy_expression XYChart component it renders bar 1`] = ` +exports[`XYChart component it renders bar 1`] = ` @@ -693,7 +693,7 @@ exports[`xy_expression XYChart component it renders bar 1`] = ` `; -exports[`xy_expression XYChart component it renders horizontal bar 1`] = ` +exports[`XYChart component it renders horizontal bar 1`] = ` @@ -939,7 +939,7 @@ exports[`xy_expression XYChart component it renders horizontal bar 1`] = ` `; -exports[`xy_expression XYChart component it renders line 1`] = ` +exports[`XYChart component it renders line 1`] = ` @@ -1173,7 +1173,7 @@ exports[`xy_expression XYChart component it renders line 1`] = ` `; -exports[`xy_expression XYChart component it renders stacked area 1`] = ` +exports[`XYChart component it renders stacked area 1`] = ` @@ -1415,7 +1415,7 @@ exports[`xy_expression XYChart component it renders stacked area 1`] = ` `; -exports[`xy_expression XYChart component it renders stacked bar 1`] = ` +exports[`XYChart component it renders stacked bar 1`] = ` @@ -1669,7 +1669,7 @@ exports[`xy_expression XYChart component it renders stacked bar 1`] = ` `; -exports[`xy_expression XYChart component it renders stacked horizontal bar 1`] = ` +exports[`XYChart component it renders stacked horizontal bar 1`] = ` diff --git a/src/plugins/chart_expressions/expression_xy/public/components/annotations.scss b/src/plugins/chart_expressions/expression_xy/public/components/annotations.scss new file mode 100644 index 0000000000000..88881ae718925 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/components/annotations.scss @@ -0,0 +1,18 @@ +.xyAnnotationNumberIcon { + border-radius: $euiSize; + min-width: $euiSize; + height: $euiSize; + background-color: currentColor; +} + +.xyAnnotationNumberIcon__text { + font-weight: 500; + font-size: 9px; + letter-spacing: -.5px; + line-height: 11px; +} + +.xyAnnotationIcon_rotate90 { + transform: rotate(45deg); + transform-origin: center; +} diff --git a/x-pack/plugins/lens/public/xy_visualization/annotations/expression.tsx b/src/plugins/chart_expressions/expression_xy/public/components/annotations.tsx similarity index 66% rename from x-pack/plugins/lens/public/xy_visualization/annotations/expression.tsx rename to src/plugins/chart_expressions/expression_xy/public/components/annotations.tsx index fa41a752cc09b..4e8fa1b95775f 100644 --- a/x-pack/plugins/lens/public/xy_visualization/annotations/expression.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/annotations.tsx @@ -1,11 +1,14 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import './expression.scss'; +import './annotations.scss'; +import './reference_lines.scss'; + import React from 'react'; import { snakeCase } from 'lodash'; import { @@ -14,20 +17,20 @@ import { LineAnnotation, Position, } from '@elastic/charts'; -import type { FieldFormat } from 'src/plugins/field_formats/common'; -import type { EventAnnotationArgs } from 'src/plugins/event_annotation/common'; import moment from 'moment'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiIconProps, EuiText } from '@elastic/eui'; +import classnames from 'classnames'; +import type { EventAnnotationArgs } from '../../../../event_annotation/common'; +import type { FieldFormat } from '../../../../field_formats/common'; import { defaultAnnotationColor } from '../../../../../../src/plugins/event_annotation/public'; -import type { AnnotationLayerArgs } from '../../../common/expressions'; -import { hasIcon } from '../xy_config_panel/shared/icon_select'; -import { - mapVerticalToHorizontalPlacement, - LINES_MARKER_SIZE, - MarkerBody, - Marker, - AnnotationIcon, -} from '../annotations_helpers'; +import type { + AnnotationLayerArgs, + AnnotationLayerConfigResult, + IconPosition, + YAxisMode, +} from '../../common/types'; +import { annotationsIconSet, hasIcon, isNumericalString } from '../helpers'; +import { mapVerticalToHorizontalPlacement, LINES_MARKER_SIZE } from '../helpers'; const getRoundedTimestamp = (timestamp: number, firstTimestamp?: number, minInterval?: number) => { if (!firstTimestamp || !minInterval) { @@ -124,7 +127,7 @@ const getCommonStyles = (configArr: EventAnnotationArgs[]) => { }; export const getAnnotationsGroupedByInterval = ( - layers: AnnotationLayerArgs[], + layers: AnnotationLayerConfigResult[], minInterval?: number, firstTimestamp?: number, formatter?: FieldFormat @@ -187,7 +190,7 @@ export const Annotations = ({ isHorizontal: !isHorizontal, hasReducedPadding, label: annotation.label, - rotateClassName: isHorizontal ? 'lnsXyAnnotationIcon_rotate90' : undefined, + rotateClassName: isHorizontal ? 'xyAnnotationIcon_rotate90' : undefined, }} /> ) : undefined @@ -232,3 +235,123 @@ export const Annotations = ({ ); }; + +export function MarkerBody({ + label, + isHorizontal, +}: { + label: string | undefined; + isHorizontal: boolean; +}) { + if (!label) { + return null; + } + if (isHorizontal) { + return ( +
+ {label} +
+ ); + } + return ( +
+
+ {label} +
+
+ ); +} + +function NumberIcon({ number }: { number: number }) { + return ( + + + {number < 10 ? number : `9+`} + + + ); +} + +export const AnnotationIcon = ({ + type, + rotateClassName = '', + isHorizontal, + renderedInChart, + ...rest +}: { + type: string; + rotateClassName?: string; + isHorizontal?: boolean; + renderedInChart?: boolean; +} & EuiIconProps) => { + if (isNumericalString(type)) { + return ; + } + const iconConfig = annotationsIconSet.find((i) => i.value === type); + if (!iconConfig) { + return null; + } + return ( + + ); +}; + +interface MarkerConfig { + axisMode?: YAxisMode; + icon?: string; + textVisibility?: boolean; + iconPosition?: IconPosition; +} + +export function Marker({ + config, + isHorizontal, + hasReducedPadding, + label, + rotateClassName, +}: { + config: MarkerConfig; + isHorizontal: boolean; + hasReducedPadding: boolean; + label?: string; + rotateClassName?: string; +}) { + if (hasIcon(config.icon)) { + return ( + + ); + } + + // if there's some text, check whether to show it as marker, or just show some padding for the icon + if (config.textVisibility) { + if (hasReducedPadding) { + return ; + } + return ; + } + return null; +} diff --git a/src/plugins/chart_expressions/expression_xy/public/components/index.ts b/src/plugins/chart_expressions/expression_xy/public/components/index.ts new file mode 100644 index 0000000000000..be06610fa8922 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/components/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './legend_action_popover'; +export * from './reference_lines'; +export * from './legend_action'; +export * from './x_domain'; +export * from './xy_chart'; diff --git a/x-pack/plugins/lens/public/xy_visualization/get_legend_action.test.tsx b/src/plugins/chart_expressions/expression_xy/public/components/legend_action.test.tsx similarity index 92% rename from x-pack/plugins/lens/public/xy_visualization/get_legend_action.test.tsx rename to src/plugins/chart_expressions/expression_xy/public/components/legend_action.test.tsx index faa3ecc976d9b..0f1cdebc5bf59 100644 --- a/x-pack/plugins/lens/public/xy_visualization/get_legend_action.test.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/legend_action.test.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; @@ -11,14 +12,15 @@ import { EuiPopover } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { ComponentType, ReactWrapper } from 'enzyme'; import type { LensMultiTable } from '../../common'; -import { layerTypes } from '../../common'; -import type { DataLayerArgs } from '../../common/expressions'; -import { getLegendAction } from './get_legend_action'; -import { LegendActionPopover } from '../shared_components'; +import { LayerTypes } from '../../common/constants'; +import type { DataLayerArgs } from '../../common'; +import { getLegendAction } from './legend_action'; +import { LegendActionPopover } from './legend_action_popover'; +import { mockPaletteOutput } from '../../common/__mocks__'; const sampleLayer = { layerId: 'first', - layerType: layerTypes.DATA, + layerType: LayerTypes.DATA, seriesType: 'line', xAccessor: 'c', accessors: ['a', 'b'], @@ -27,6 +29,7 @@ const sampleLayer = { xScaleType: 'ordinal', yScaleType: 'linear', isHistogram: false, + palette: mockPaletteOutput, } as DataLayerArgs; const tables = { diff --git a/x-pack/plugins/lens/public/xy_visualization/get_legend_action.tsx b/src/plugins/chart_expressions/expression_xy/public/components/legend_action.tsx similarity index 79% rename from x-pack/plugins/lens/public/xy_visualization/get_legend_action.tsx rename to src/plugins/chart_expressions/expression_xy/public/components/legend_action.tsx index 00532314e045b..9bbdec3635fa8 100644 --- a/x-pack/plugins/lens/public/xy_visualization/get_legend_action.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/legend_action.tsx @@ -1,21 +1,22 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; import type { LegendAction, XYChartSeriesIdentifier } from '@elastic/charts'; -import type { LensFilterEvent } from '../types'; -import type { LensMultiTable, FormatFactory } from '../../common'; -import type { DataLayerArgs } from '../../common/expressions'; -import { LegendActionPopover } from '../shared_components'; +import type { FilterEvent } from '../types'; +import type { LensMultiTable, DataLayerArgs } from '../../common'; +import type { FormatFactory } from '../types'; +import { LegendActionPopover } from './legend_action_popover'; export const getLegendAction = ( filteredLayers: DataLayerArgs[], tables: LensMultiTable['tables'], - onFilter: (data: LensFilterEvent['data']) => void, + onFilter: (data: FilterEvent['data']) => void, formatFactory: FormatFactory, layersAlreadyFormatted: Record ): LegendAction => @@ -55,7 +56,7 @@ export const getLegendAction = ( }, ]; - const context: LensFilterEvent['data'] = { + const context: FilterEvent['data'] = { data, }; diff --git a/src/plugins/chart_expressions/expression_xy/public/components/legend_action_popover.tsx b/src/plugins/chart_expressions/expression_xy/public/components/legend_action_popover.tsx new file mode 100644 index 0000000000000..a1ab31a993edf --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/components/legend_action_popover.tsx @@ -0,0 +1,108 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import { EuiContextMenuPanelDescriptor, EuiIcon, EuiPopover, EuiContextMenu } from '@elastic/eui'; +import { useLegendAction } from '@elastic/charts'; +import type { FilterEvent } from '../types'; + +export interface LegendActionPopoverProps { + /** + * Determines the panels label + */ + label: string; + /** + * Callback on filter value + */ + onFilter: (data: FilterEvent['data']) => void; + /** + * Determines the filter event data + */ + context: FilterEvent['data']; +} + +export const LegendActionPopover: React.FunctionComponent = ({ + label, + onFilter, + context, +}) => { + const [popoverOpen, setPopoverOpen] = useState(false); + const [ref, onClose] = useLegendAction(); + const panels: EuiContextMenuPanelDescriptor[] = [ + { + id: 'main', + title: label, + items: [ + { + name: i18n.translate('expressionXY.legend.filterForValueButtonAriaLabel', { + defaultMessage: 'Filter for value', + }), + 'data-test-subj': `legend-${label}-filterIn`, + icon: , + onClick: () => { + setPopoverOpen(false); + onFilter(context); + }, + }, + { + name: i18n.translate('expressionXY.legend.filterOutValueButtonAriaLabel', { + defaultMessage: 'Filter out value', + }), + 'data-test-subj': `legend-${label}-filterOut`, + icon: , + onClick: () => { + setPopoverOpen(false); + onFilter({ ...context, negate: true }); + }, + }, + ], + }, + ]; + + const Button = ( +
setPopoverOpen(!popoverOpen)} + onClick={() => setPopoverOpen(!popoverOpen)} + > + +
+ ); + return ( + { + setPopoverOpen(false); + onClose(); + }} + panelPaddingSize="none" + anchorPosition="upLeft" + title={i18n.translate('expressionXY.legend.filterOptionsLegend', { + defaultMessage: '{legendDataLabel}, filter options', + values: { legendDataLabel: label }, + })} + > + + + ); +}; diff --git a/x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.scss b/src/plugins/chart_expressions/expression_xy/public/components/reference_lines.scss similarity index 79% rename from x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.scss rename to src/plugins/chart_expressions/expression_xy/public/components/reference_lines.scss index 07946b52b0000..2cd7fb9c26915 100644 --- a/x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.scss +++ b/src/plugins/chart_expressions/expression_xy/public/components/reference_lines.scss @@ -1,9 +1,9 @@ -.lnsXyDecorationRotatedWrapper { +.xyDecorationRotatedWrapper { display: inline-block; overflow: hidden; line-height: 1.5; - .lnsXyDecorationRotatedWrapper__label { + .xyDecorationRotatedWrapper__label { display: inline-block; white-space: nowrap; transform: translate(0, 100%) rotate(-90deg); diff --git a/x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.test.tsx b/src/plugins/chart_expressions/expression_xy/public/components/reference_lines.test.tsx similarity index 93% rename from x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.test.tsx rename to src/plugins/chart_expressions/expression_xy/public/components/reference_lines.test.tsx index 4ec38f31b85af..a0d6351dad7f9 100644 --- a/x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.test.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/reference_lines.test.tsx @@ -1,23 +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. + * 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 { LineAnnotation, RectAnnotation } from '@elastic/charts'; import { shallow } from 'enzyme'; import React from 'react'; -import { chartPluginMock } from 'src/plugins/charts/public/mocks'; -import { FieldFormat } from 'src/plugins/field_formats/common'; +import { FieldFormat } from '../../../../field_formats/common'; import { LensMultiTable } from '../../common'; -import { ReferenceLineLayerArgs, YConfig } from '../../common/expressions'; -import { - ReferenceLineAnnotations, - ReferenceLineAnnotationsProps, -} from './expression_reference_lines'; - -const paletteService = chartPluginMock.createPaletteRegistry(); +import { ReferenceLineLayerArgs, YConfig } from '../../common/types'; +import { ReferenceLineAnnotations, ReferenceLineAnnotationsProps } from './reference_lines'; const row: Record = { xAccessorFirstId: 1, @@ -54,7 +49,6 @@ function createLayers(yConfigs: ReferenceLineLayerArgs['yConfig']): ReferenceLin return [ { layerId: 'firstLayer', - layerType: 'referenceLine', accessors: (yConfigs || []).map(({ forAccessor }) => forAccessor), yConfig: yConfigs, }, @@ -90,8 +84,6 @@ describe('ReferenceLineAnnotations', () => { defaultProps = { formatters, - paletteService, - syncColors: false, isHorizontal: false, axesMap: { left: true, right: false }, paddingMap: {}, @@ -117,6 +109,7 @@ describe('ReferenceLineAnnotations', () => { axisMode, lineStyle: 'solid', fill, + type: 'yConfig', }, ])} /> @@ -154,6 +147,7 @@ describe('ReferenceLineAnnotations', () => { forAccessor: `${layerPrefix}FirstId`, axisMode: 'bottom', lineStyle: 'solid', + type: 'yConfig', fill, }, ])} @@ -195,12 +189,14 @@ describe('ReferenceLineAnnotations', () => { forAccessor: `${layerPrefix}FirstId`, axisMode, lineStyle: 'solid', + type: 'yConfig', fill, }, { forAccessor: `${layerPrefix}SecondId`, axisMode, lineStyle: 'solid', + type: 'yConfig', fill, }, ])} @@ -243,12 +239,14 @@ describe('ReferenceLineAnnotations', () => { forAccessor: `${layerPrefix}FirstId`, axisMode: 'bottom', lineStyle: 'solid', + type: 'yConfig', fill, }, { forAccessor: `${layerPrefix}SecondId`, axisMode: 'bottom', lineStyle: 'solid', + type: 'yConfig', fill, }, ])} @@ -291,12 +289,14 @@ describe('ReferenceLineAnnotations', () => { axisMode, lineStyle: 'solid', fill: 'above', + type: 'yConfig', }, { forAccessor: `${layerPrefix}SecondId`, axisMode, lineStyle: 'solid', fill: 'below', + type: 'yConfig', }, ])} /> @@ -339,12 +339,14 @@ describe('ReferenceLineAnnotations', () => { axisMode: 'left', lineStyle: 'solid', fill, + type: 'yConfig', }, { forAccessor: `yAccessorRightSecondId`, axisMode: 'right', lineStyle: 'solid', fill, + type: 'yConfig', }, ])} /> diff --git a/src/plugins/chart_expressions/expression_xy/public/components/reference_lines.tsx b/src/plugins/chart_expressions/expression_xy/public/components/reference_lines.tsx new file mode 100644 index 0000000000000..65bc91c06efe5 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/components/reference_lines.tsx @@ -0,0 +1,366 @@ +/* + * 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 './reference_lines.scss'; + +import React from 'react'; +import { groupBy } from 'lodash'; +import { EuiIcon } from '@elastic/eui'; +import { RectAnnotation, AnnotationDomainType, LineAnnotation, Position } from '@elastic/charts'; +import { euiLightVars } from '@kbn/ui-theme'; +import type { FieldFormat } from '../../../../field_formats/common'; +import type { IconPosition, ReferenceLineLayerArgs, YAxisMode } from '../../common/types'; +import type { LensMultiTable } from '../../common/types'; +import { hasIcon } from '../helpers'; + +export const REFERENCE_LINE_MARKER_SIZE = 20; + +export const computeChartMargins = ( + referenceLinePaddings: Partial>, + labelVisibility: Partial>, + titleVisibility: Partial>, + axesMap: Record<'left' | 'right', unknown>, + isHorizontal: boolean +) => { + const result: Partial> = {}; + if (!labelVisibility?.x && !titleVisibility?.x && referenceLinePaddings.bottom) { + const placement = isHorizontal ? mapVerticalToHorizontalPlacement('bottom') : 'bottom'; + result[placement] = referenceLinePaddings.bottom; + } + if ( + referenceLinePaddings.left && + (isHorizontal || (!labelVisibility?.yLeft && !titleVisibility?.yLeft)) + ) { + const placement = isHorizontal ? mapVerticalToHorizontalPlacement('left') : 'left'; + result[placement] = referenceLinePaddings.left; + } + if ( + referenceLinePaddings.right && + (isHorizontal || !axesMap.right || (!labelVisibility?.yRight && !titleVisibility?.yRight)) + ) { + const placement = isHorizontal ? mapVerticalToHorizontalPlacement('right') : 'right'; + result[placement] = referenceLinePaddings.right; + } + // there's no top axis, so just check if a margin has been computed + if (referenceLinePaddings.top) { + const placement = isHorizontal ? mapVerticalToHorizontalPlacement('top') : 'top'; + result[placement] = referenceLinePaddings.top; + } + return result; +}; + +// Note: it does not take into consideration whether the reference line is in view or not +export const getReferenceLineRequiredPaddings = ( + referenceLineLayers: ReferenceLineLayerArgs[], + axesMap: Record<'left' | 'right', unknown> +) => { + // collect all paddings for the 4 axis: if any text is detected double it. + const paddings: Partial> = {}; + const icons: Partial> = {}; + referenceLineLayers.forEach((layer) => { + layer.yConfig?.forEach(({ axisMode, icon, iconPosition, textVisibility }) => { + if (axisMode && (hasIcon(icon) || textVisibility)) { + const placement = getBaseIconPlacement(iconPosition, axisMode, axesMap); + paddings[placement] = Math.max( + paddings[placement] || 0, + REFERENCE_LINE_MARKER_SIZE * (textVisibility ? 2 : 1) // double the padding size if there's text + ); + icons[placement] = (icons[placement] || 0) + (hasIcon(icon) ? 1 : 0); + } + }); + }); + // post-process the padding based on the icon presence: + // if no icon is present for the placement, just reduce the padding + (Object.keys(paddings) as Position[]).forEach((placement) => { + if (!icons[placement]) { + paddings[placement] = REFERENCE_LINE_MARKER_SIZE; + } + }); + + return paddings; +}; + +function mapVerticalToHorizontalPlacement(placement: Position) { + switch (placement) { + case Position.Top: + return Position.Right; + case Position.Bottom: + return Position.Left; + case Position.Left: + return Position.Bottom; + case Position.Right: + return Position.Top; + } +} + +// if there's just one axis, put it on the other one +// otherwise use the same axis +// this function assume the chart is vertical +function getBaseIconPlacement( + iconPosition: IconPosition | undefined, + axisMode: YAxisMode | undefined, + axesMap: Record +) { + if (iconPosition === 'auto') { + if (axisMode === 'bottom') { + return Position.Top; + } + if (axisMode === 'left') { + return axesMap.right ? Position.Left : Position.Right; + } + return axesMap.left ? Position.Right : Position.Left; + } + + if (iconPosition === 'left') { + return Position.Left; + } + if (iconPosition === 'right') { + return Position.Right; + } + if (iconPosition === 'below') { + return Position.Bottom; + } + return Position.Top; +} + +function getMarkerBody(label: string | undefined, isHorizontal: boolean) { + if (!label) { + return; + } + if (isHorizontal) { + return ( +
+ {label} +
+ ); + } + return ( +
+
+ {label} +
+
+ ); +} + +interface MarkerConfig { + axisMode?: YAxisMode; + icon?: string; + textVisibility?: boolean; +} + +function getMarkerToShow( + markerConfig: MarkerConfig, + label: string | undefined, + isHorizontal: boolean, + hasReducedPadding: boolean +) { + // show an icon if present + if (hasIcon(markerConfig.icon)) { + return ; + } + // if there's some text, check whether to show it as marker, or just show some padding for the icon + if (markerConfig.textVisibility) { + if (hasReducedPadding) { + return getMarkerBody( + label, + (!isHorizontal && markerConfig.axisMode === 'bottom') || + (isHorizontal && markerConfig.axisMode !== 'bottom') + ); + } + return ; + } +} + +export interface ReferenceLineAnnotationsProps { + layers: ReferenceLineLayerArgs[]; + data: LensMultiTable; + formatters: Record<'left' | 'right' | 'bottom', FieldFormat | undefined>; + axesMap: Record<'left' | 'right', boolean>; + isHorizontal: boolean; + paddingMap: Partial>; +} + +export const ReferenceLineAnnotations = ({ + layers, + data, + formatters, + axesMap, + isHorizontal, + paddingMap, +}: ReferenceLineAnnotationsProps) => { + return ( + <> + {layers.flatMap((layer) => { + if (!layer.yConfig) { + return []; + } + const { columnToLabel, yConfig: yConfigs, layerId } = layer; + const columnToLabelMap: Record = columnToLabel + ? JSON.parse(columnToLabel) + : {}; + const table = data.tables[layerId]; + + const row = table.rows[0]; + + const yConfigByValue = yConfigs.sort( + ({ forAccessor: idA }, { forAccessor: idB }) => row[idA] - row[idB] + ); + + const groupedByDirection = groupBy(yConfigByValue, 'fill'); + if (groupedByDirection.below) { + groupedByDirection.below.reverse(); + } + + return yConfigByValue.flatMap((yConfig, i) => { + // Find the formatter for the given axis + const groupId = + yConfig.axisMode === 'bottom' + ? undefined + : yConfig.axisMode === 'right' + ? 'right' + : 'left'; + + const formatter = formatters[groupId || 'bottom']; + + const defaultColor = euiLightVars.euiColorDarkShade; + + // get the position for vertical chart + const markerPositionVertical = getBaseIconPlacement( + yConfig.iconPosition, + yConfig.axisMode, + axesMap + ); + // the padding map is built for vertical chart + const hasReducedPadding = + paddingMap[markerPositionVertical] === REFERENCE_LINE_MARKER_SIZE; + + const props = { + groupId, + marker: getMarkerToShow( + yConfig, + columnToLabelMap[yConfig.forAccessor], + isHorizontal, + hasReducedPadding + ), + markerBody: getMarkerBody( + yConfig.textVisibility && !hasReducedPadding + ? columnToLabelMap[yConfig.forAccessor] + : undefined, + (!isHorizontal && yConfig.axisMode === 'bottom') || + (isHorizontal && yConfig.axisMode !== 'bottom') + ), + // rotate the position if required + markerPosition: isHorizontal + ? mapVerticalToHorizontalPlacement(markerPositionVertical) + : markerPositionVertical, + }; + const annotations = []; + + const dashStyle = + yConfig.lineStyle === 'dashed' + ? [(yConfig.lineWidth || 1) * 3, yConfig.lineWidth || 1] + : yConfig.lineStyle === 'dotted' + ? [yConfig.lineWidth || 1, yConfig.lineWidth || 1] + : undefined; + + const sharedStyle = { + strokeWidth: yConfig.lineWidth || 1, + stroke: yConfig.color || defaultColor, + dash: dashStyle, + }; + + annotations.push( + ({ + dataValue: row[yConfig.forAccessor], + header: columnToLabelMap[yConfig.forAccessor], + details: formatter?.convert(row[yConfig.forAccessor]) || row[yConfig.forAccessor], + }))} + domainType={ + yConfig.axisMode === 'bottom' + ? AnnotationDomainType.XDomain + : AnnotationDomainType.YDomain + } + style={{ + line: { + ...sharedStyle, + opacity: 1, + }, + }} + /> + ); + + if (yConfig.fill && yConfig.fill !== 'none') { + const isFillAbove = yConfig.fill === 'above'; + const indexFromSameType = groupedByDirection[yConfig.fill].findIndex( + ({ forAccessor }) => forAccessor === yConfig.forAccessor + ); + const shouldCheckNextReferenceLine = + indexFromSameType < groupedByDirection[yConfig.fill].length - 1; + annotations.push( + { + const nextValue = shouldCheckNextReferenceLine + ? row[groupedByDirection[yConfig.fill!][indexFromSameType + 1].forAccessor] + : undefined; + if (yConfig.axisMode === 'bottom') { + return { + coordinates: { + x0: isFillAbove ? row[yConfig.forAccessor] : nextValue, + y0: undefined, + x1: isFillAbove ? nextValue : row[yConfig.forAccessor], + y1: undefined, + }, + header: columnToLabelMap[yConfig.forAccessor], + details: + formatter?.convert(row[yConfig.forAccessor]) || row[yConfig.forAccessor], + }; + } + return { + coordinates: { + x0: undefined, + y0: isFillAbove ? row[yConfig.forAccessor] : nextValue, + x1: undefined, + y1: isFillAbove ? nextValue : row[yConfig.forAccessor], + }, + header: columnToLabelMap[yConfig.forAccessor], + details: + formatter?.convert(row[yConfig.forAccessor]) || row[yConfig.forAccessor], + }; + })} + style={{ + ...sharedStyle, + fill: yConfig.color || defaultColor, + opacity: 0.1, + }} + /> + ); + } + return annotations; + }); + })} + + ); +}; diff --git a/x-pack/plugins/lens/public/xy_visualization/x_domain.tsx b/src/plugins/chart_expressions/expression_xy/public/components/x_domain.tsx similarity index 89% rename from x-pack/plugins/lens/public/xy_visualization/x_domain.tsx rename to src/plugins/chart_expressions/expression_xy/public/components/x_domain.tsx index eb9de9a2993b4..dbc4c348cb891 100644 --- a/x-pack/plugins/lens/public/xy_visualization/x_domain.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/x_domain.tsx @@ -1,17 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { uniq } from 'lodash'; import React from 'react'; import moment from 'moment'; -import { Endzones } from '../../../../../src/plugins/charts/public'; -import type { LensMultiTable } from '../../common'; -import type { DataLayerArgs } from '../../common/expressions'; -import { search } from '../../../../../src/plugins/data/public'; +import { Endzones } from '../../../../../plugins/charts/public'; +import type { LensMultiTable, DataLayerArgs } from '../../common'; +import { search } from '../../../../../plugins/data/public'; export interface XDomain { min?: number; diff --git a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.scss b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.scss new file mode 100644 index 0000000000000..ba998c863b6ac --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.scss @@ -0,0 +1,7 @@ +.xyChart__empty { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} diff --git a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx new file mode 100644 index 0000000000000..1a8a16c165e9e --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx @@ -0,0 +1,2703 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { mount, shallow } from 'enzyme'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import { + AnnotationLayerConfigResult, + DataLayerConfigResult, + LensMultiTable, + XYArgs, +} from '../../common'; +import { LayerTypes } from '../../common/constants'; +import { + AreaSeries, + Axis, + BarSeries, + Fit, + GeometryValue, + HorizontalAlignment, + LayoutDirection, + LineAnnotation, + LineSeries, + Position, + ScaleType, + SeriesNameFn, + Settings, + VerticalAlignment, + XYChartSeriesIdentifier, +} from '@elastic/charts'; +import { EmptyPlaceholder } from '../../../../../plugins/charts/public'; +import { XyEndzones } from './x_domain'; +import { + chartsActiveCursorService, + chartsThemeService, + dateHistogramData, + dateHistogramLayer, + paletteService, + sampleArgsWithReferenceLine, +} from '../__mocks__'; +import { + mockPaletteOutput, + sampleArgs, + createArgsWithLayers, + createSampleDatatableWithRows, + sampleLayer, +} from '../../common/__mocks__'; +import { XYChart, XYChartRenderProps } from './xy_chart'; +import { eventAnnotationServiceMock } from '../../../../event_annotation/public/mocks'; +import { EventAnnotationOutput } from '../../../../event_annotation/common'; + +const onClickValue = jest.fn(); +const onSelectRange = jest.fn(); + +describe('XYChart component', () => { + let getFormatSpy: jest.Mock; + let convertSpy: jest.Mock; + let defaultProps: Omit; + + const dataWithoutFormats: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: { + type: 'datatable', + columns: [ + { id: 'a', name: 'a', meta: { type: 'number' } }, + { id: 'b', name: 'b', meta: { type: 'number' } }, + { id: 'c', name: 'c', meta: { type: 'string' } }, + { id: 'd', name: 'd', meta: { type: 'string' } }, + ], + rows: [ + { a: 1, b: 2, c: 'I', d: 'Row 1' }, + { a: 1, b: 5, c: 'J', d: 'Row 2' }, + ], + }, + }, + }; + const dataWithFormats: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: { + type: 'datatable', + columns: [ + { id: 'a', name: 'a', meta: { type: 'number' } }, + { id: 'b', name: 'b', meta: { type: 'number' } }, + { id: 'c', name: 'c', meta: { type: 'string' } }, + { id: 'd', name: 'd', meta: { type: 'string', params: { id: 'custom' } } }, + ], + rows: [ + { a: 1, b: 2, c: 'I', d: 'Row 1' }, + { a: 1, b: 5, c: 'J', d: 'Row 2' }, + ], + }, + }, + }; + + const getRenderedComponent = (data: LensMultiTable, args: XYArgs) => { + return shallow(); + }; + + beforeEach(() => { + convertSpy = jest.fn((x) => x); + getFormatSpy = jest.fn(); + getFormatSpy.mockReturnValue({ convert: convertSpy }); + + defaultProps = { + formatFactory: getFormatSpy, + timeZone: 'UTC', + renderMode: 'view', + chartsThemeService, + chartsActiveCursorService, + paletteService, + minInterval: 50, + onClickValue, + onSelectRange, + syncColors: false, + useLegacyTimeAxis: false, + eventAnnotationService: eventAnnotationServiceMock, + }; + }); + + test('it renders line', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + expect(component).toMatchSnapshot(); + expect(component.find(LineSeries)).toHaveLength(2); + expect(component.find(LineSeries).at(0).prop('yAccessors')).toEqual(['a']); + expect(component.find(LineSeries).at(1).prop('yAccessors')).toEqual(['b']); + }); + + describe('date range', () => { + const timeSampleLayer: DataLayerConfigResult = { + type: 'dataLayer', + layerId: 'first', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'c', + accessors: ['a', 'b'], + splitAccessor: 'd', + columnToLabel: '{"a": "Label A", "b": "Label B", "d": "Label D"}', + xScaleType: 'time', + yScaleType: 'linear', + isHistogram: false, + palette: mockPaletteOutput, + }; + const multiLayerArgs = createArgsWithLayers([ + timeSampleLayer, + { + ...timeSampleLayer, + layerId: 'second', + seriesType: 'bar', + xScaleType: 'time', + }, + ]); + test('it uses the full date range', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + c.id !== 'c' + ? c + : { + ...c, + meta: { + type: 'date', + source: 'esaggs', + sourceParams: { + type: 'date_histogram', + params: {}, + appliedTimeRange: { + from: '2019-01-02T05:00:00.000Z', + to: '2019-01-03T05:00:00.000Z', + }, + }, + }, + } + ), + }, + }, + }} + args={{ + ...args, + layers: [ + { + ...(args.layers[0] as DataLayerConfigResult), + seriesType: 'line', + xScaleType: 'time', + }, + ], + }} + minInterval={undefined} + /> + ); + expect(component.find(Settings).prop('xDomain')).toMatchInlineSnapshot(` + Object { + "max": 1546491600000, + "min": 1546405200000, + "minInterval": undefined, + } + `); + }); + + test('it uses passed in minInterval', () => { + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: createSampleDatatableWithRows([{ a: 1, b: 2, c: 'I', d: 'Foo' }]), + second: createSampleDatatableWithRows([]), + }, + }; + + const component = shallow(); + + // real auto interval is 30mins = 1800000 + expect(component.find(Settings).prop('xDomain')).toMatchInlineSnapshot(` + Object { + "max": NaN, + "min": NaN, + "minInterval": 50, + } + `); + }); + + describe('axis time', () => { + const defaultTimeLayer: DataLayerConfigResult = { + type: 'dataLayer', + layerId: 'first', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'c', + accessors: ['a', 'b'], + splitAccessor: 'd', + columnToLabel: '{"a": "Label A", "b": "Label B", "d": "Label D"}', + xScaleType: 'time', + yScaleType: 'linear', + isHistogram: true, + palette: mockPaletteOutput, + }; + test('it should disable the new time axis for a line time layer when isHistogram is set to false', () => { + const { data } = sampleArgs(); + + const instance = shallow( + + ); + + const axisStyle = instance.find(Axis).first().prop('timeAxisLayerCount'); + + expect(axisStyle).toBe(0); + }); + test('it should enable the new time axis for a line time layer when isHistogram is set to true', () => { + const { data } = sampleArgs(); + const timeLayerArgs = createArgsWithLayers([defaultTimeLayer]); + + const instance = shallow( + + ); + + const axisStyle = instance.find(Axis).first().prop('timeAxisLayerCount'); + + expect(axisStyle).toBe(3); + }); + test('it should disable the new time axis for a vertical bar with break down dimension', () => { + const { data } = sampleArgs(); + const timeLayer: DataLayerConfigResult = { + ...defaultTimeLayer, + seriesType: 'bar', + }; + const timeLayerArgs = createArgsWithLayers([timeLayer]); + + const instance = shallow( + + ); + + const axisStyle = instance.find(Axis).first().prop('timeAxisLayerCount'); + + expect(axisStyle).toBe(0); + }); + + test('it should enable the new time axis for a stacked vertical bar with break down dimension', () => { + const { data } = sampleArgs(); + const timeLayer: DataLayerConfigResult = { + ...defaultTimeLayer, + seriesType: 'bar_stacked', + }; + const timeLayerArgs = createArgsWithLayers([timeLayer]); + + const instance = shallow( + + ); + + const axisStyle = instance.find(Axis).first().prop('timeAxisLayerCount'); + + expect(axisStyle).toBe(3); + }); + }); + describe('endzones', () => { + const { args } = sampleArgs(); + const table = createSampleDatatableWithRows([ + { a: 1, b: 2, c: new Date('2021-04-22').valueOf(), d: 'Foo' }, + { a: 1, b: 2, c: new Date('2021-04-23').valueOf(), d: 'Foo' }, + { a: 1, b: 2, c: new Date('2021-04-24').valueOf(), d: 'Foo' }, + ]); + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: { + ...table, + columns: table.columns.map((c) => + c.id !== 'c' + ? c + : { + ...c, + meta: { + type: 'date', + source: 'esaggs', + sourceParams: { + type: 'date_histogram', + params: {}, + appliedTimeRange: { + from: '2021-04-22T12:00:00.000Z', + to: '2021-04-24T12:00:00.000Z', + }, + }, + }, + } + ), + }, + }, + dateRange: { + // first and last bucket are partial + fromDate: new Date('2021-04-22T12:00:00.000Z'), + toDate: new Date('2021-04-24T12:00:00.000Z'), + }, + }; + const timeArgs: XYArgs = { + ...args, + layers: [ + { + ...(args.layers[0] as DataLayerConfigResult), + seriesType: 'line', + xScaleType: 'time', + isHistogram: true, + splitAccessor: undefined, + }, + ], + }; + + test('it extends interval if data is exceeding it', () => { + const component = shallow( + + ); + + expect(component.find(Settings).prop('xDomain')).toEqual({ + // shortened to 24th midnight (elastic-charts automatically adds one min interval) + max: new Date('2021-04-24').valueOf(), + // extended to 22nd midnight because of first bucket + min: new Date('2021-04-22').valueOf(), + minInterval: 24 * 60 * 60 * 1000, + }); + }); + + test('it renders endzone component bridging gap between domain and extended domain', () => { + const component = shallow( + + ); + + expect(component.find(XyEndzones).dive().find('Endzones').props()).toEqual( + expect.objectContaining({ + domainStart: new Date('2021-04-22T12:00:00.000Z').valueOf(), + domainEnd: new Date('2021-04-24T12:00:00.000Z').valueOf(), + domainMin: new Date('2021-04-22').valueOf(), + domainMax: new Date('2021-04-24').valueOf(), + }) + ); + }); + + test('should pass enabled histogram mode and min interval to endzones component', () => { + const component = shallow( + + ); + + expect(component.find(XyEndzones).dive().find('Endzones').props()).toEqual( + expect.objectContaining({ + interval: 24 * 60 * 60 * 1000, + isFullBin: false, + }) + ); + }); + + test('should pass disabled histogram mode and min interval to endzones component', () => { + const component = shallow( + + ); + + expect(component.find(XyEndzones).dive().find('Endzones').props()).toEqual( + expect.objectContaining({ + interval: 24 * 60 * 60 * 1000, + isFullBin: true, + }) + ); + }); + + test('it does not render endzones if disabled via settings', () => { + const component = shallow( + + ); + + expect(component.find(XyEndzones).length).toEqual(0); + }); + }); + }); + + describe('y axis extents', () => { + test('it passes custom y axis extents to elastic-charts axis spec', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ + fit: false, + min: 123, + max: 456, + }); + }); + + test('it passes fit to bounds y axis extents to elastic-charts axis spec', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ + fit: true, + min: NaN, + max: NaN, + }); + }); + + test('it does not allow fit for area chart', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ + fit: false, + min: NaN, + max: NaN, + }); + }); + + test('it does not allow positive lower bound for bar', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ + fit: false, + min: NaN, + max: NaN, + }); + }); + + test('it does include referenceLine values when in full extent mode', () => { + const { data, args } = sampleArgsWithReferenceLine(); + + const component = shallow(); + expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ + fit: false, + min: 0, + max: 150, + }); + }); + + test('it should ignore referenceLine values when set to custom extents', () => { + const { data, args } = sampleArgsWithReferenceLine(); + + const component = shallow( + + ); + expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ + fit: false, + min: 123, + max: 456, + }); + }); + + test('it should work for negative values in referenceLines', () => { + const { data, args } = sampleArgsWithReferenceLine(-150); + + const component = shallow(); + expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ + fit: false, + min: -150, + max: 5, + }); + }); + }); + + test('it has xDomain undefined if the x is not a time scale or a histogram', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + const xDomain = component.find(Settings).prop('xDomain'); + expect(xDomain).toEqual(undefined); + }); + + test('it uses min interval if interval is passed in and visualization is histogram', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + expect(component.find(Settings).prop('xDomain')).toEqual({ + minInterval: 101, + min: NaN, + max: NaN, + }); + }); + + test('disabled legend extra by default', () => { + const { data, args } = sampleArgs(); + const component = shallow(); + expect(component.find(Settings).at(0).prop('showLegendExtra')).toEqual(false); + }); + + test('ignores legend extra for ordinal chart', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component.find(Settings).at(0).prop('showLegendExtra')).toEqual(false); + }); + + test('shows legend extra for histogram chart', () => { + const { args } = sampleArgs(); + const component = shallow( + + ); + expect(component.find(Settings).at(0).prop('showLegendExtra')).toEqual(true); + }); + + test('it renders bar', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component).toMatchSnapshot(); + expect(component.find(BarSeries)).toHaveLength(2); + expect(component.find(BarSeries).at(0).prop('yAccessors')).toEqual(['a']); + expect(component.find(BarSeries).at(1).prop('yAccessors')).toEqual(['b']); + }); + + test('it renders area', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component).toMatchSnapshot(); + expect(component.find(AreaSeries)).toHaveLength(2); + expect(component.find(AreaSeries).at(0).prop('yAccessors')).toEqual(['a']); + expect(component.find(AreaSeries).at(1).prop('yAccessors')).toEqual(['b']); + }); + + test('it renders horizontal bar', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component).toMatchSnapshot(); + expect(component.find(BarSeries)).toHaveLength(2); + expect(component.find(BarSeries).at(0).prop('yAccessors')).toEqual(['a']); + expect(component.find(BarSeries).at(1).prop('yAccessors')).toEqual(['b']); + expect(component.find(Settings).prop('rotation')).toEqual(90); + }); + + test('it renders regular bar empty placeholder for no results', () => { + const { data, args } = sampleArgs(); + + // send empty data to the chart + data.tables.first.rows = []; + + const component = shallow(); + + expect(component.find(BarSeries)).toHaveLength(0); + expect(component.find(EmptyPlaceholder).prop('icon')).toBeDefined(); + }); + + test('onBrushEnd returns correct context data for date histogram data', () => { + const { args } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + wrapper.find(Settings).first().prop('onBrushEnd')!({ x: [1585757732783, 1585758880838] }); + + expect(onSelectRange).toHaveBeenCalledWith({ + column: 0, + table: dateHistogramData.tables.timeLayer, + range: [1585757732783, 1585758880838], + }); + }); + + test('onBrushEnd returns correct context data for number histogram data', () => { + const { args } = sampleArgs(); + + const numberLayer: DataLayerConfigResult = { + type: 'dataLayer', + layerId: 'numberLayer', + layerType: LayerTypes.DATA, + hide: false, + xAccessor: 'xAccessorId', + yScaleType: 'linear', + xScaleType: 'linear', + isHistogram: true, + seriesType: 'bar_stacked', + accessors: ['yAccessorId'], + palette: mockPaletteOutput, + }; + + const numberHistogramData: LensMultiTable = { + type: 'lens_multitable', + tables: { + numberLayer: { + type: 'datatable', + rows: [ + { + xAccessorId: 5, + yAccessorId: 1, + }, + { + xAccessorId: 7, + yAccessorId: 1, + }, + { + xAccessorId: 8, + yAccessorId: 1, + }, + { + xAccessorId: 10, + yAccessorId: 1, + }, + ], + columns: [ + { + id: 'xAccessorId', + name: 'bytes', + meta: { type: 'number' }, + }, + { + id: 'yAccessorId', + name: 'Count of records', + meta: { type: 'number' }, + }, + ], + }, + }, + dateRange: { + fromDate: new Date('2020-04-01T16:14:16.246Z'), + toDate: new Date('2020-04-01T17:15:41.263Z'), + }, + }; + + const wrapper = mountWithIntl( + + ); + + wrapper.find(Settings).first().prop('onBrushEnd')!({ x: [5, 8] }); + + expect(onSelectRange).toHaveBeenCalledWith({ + column: 0, + table: numberHistogramData.tables.numberLayer, + range: [5, 8], + }); + }); + + test('onBrushEnd is not set on non-interactive mode', () => { + const { args, data } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + + expect(wrapper.find(Settings).first().prop('onBrushEnd')).toBeUndefined(); + }); + + test('allowBrushingLastHistogramBin is true for date histogram data', () => { + const { args } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBin')).toEqual(true); + }); + + test('onElementClick returns correct context data', () => { + const geometry: GeometryValue = { x: 5, y: 1, accessor: 'y1', mark: null, datum: {} }; + const series = { + key: 'spec{d}yAccessor{d}splitAccessors{b-2}', + specId: 'd', + yAccessor: 'd', + splitAccessors: {}, + seriesKeys: [2, 'd'], + }; + + const { args, data } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + + wrapper.find(Settings).first().prop('onElementClick')!([ + [geometry, series as XYChartSeriesIdentifier], + ]); + + expect(onClickValue).toHaveBeenCalledWith({ + data: [ + { + column: 1, + row: 1, + table: data.tables.first, + value: 5, + }, + { + column: 1, + row: 0, + table: data.tables.first, + value: 2, + }, + ], + }); + }); + + test('onElementClick returns correct context data for date histogram', () => { + const geometry: GeometryValue = { + x: 1585758120000, + y: 1, + accessor: 'y1', + mark: null, + datum: {}, + }; + const series = { + key: 'spec{d}yAccessor{d}splitAccessors{b-2}', + specId: 'd', + yAccessor: 'yAccessorId', + splitAccessors: {}, + seriesKeys: ['yAccessorId'], + }; + + const { args } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + + wrapper.find(Settings).first().prop('onElementClick')!([ + [geometry, series as XYChartSeriesIdentifier], + ]); + + expect(onClickValue).toHaveBeenCalledWith({ + data: [ + { + column: 0, + row: 0, + table: dateHistogramData.tables.timeLayer, + value: 1585758120000, + }, + ], + }); + }); + + test('onElementClick returns correct context data for numeric histogram', () => { + const { args } = sampleArgs(); + + const numberLayer: DataLayerConfigResult = { + type: 'dataLayer', + layerId: 'numberLayer', + layerType: LayerTypes.DATA, + hide: false, + xAccessor: 'xAccessorId', + yScaleType: 'linear', + xScaleType: 'linear', + isHistogram: true, + seriesType: 'bar_stacked', + accessors: ['yAccessorId'], + palette: mockPaletteOutput, + }; + + const numberHistogramData: LensMultiTable = { + type: 'lens_multitable', + tables: { + numberLayer: { + type: 'datatable', + rows: [ + { + xAccessorId: 5, + yAccessorId: 1, + }, + { + xAccessorId: 7, + yAccessorId: 1, + }, + { + xAccessorId: 8, + yAccessorId: 1, + }, + { + xAccessorId: 10, + yAccessorId: 1, + }, + ], + columns: [ + { + id: 'xAccessorId', + name: 'bytes', + meta: { type: 'number' }, + }, + { + id: 'yAccessorId', + name: 'Count of records', + meta: { type: 'number' }, + }, + ], + }, + }, + dateRange: { + fromDate: new Date('2020-04-01T16:14:16.246Z'), + toDate: new Date('2020-04-01T17:15:41.263Z'), + }, + }; + const geometry: GeometryValue = { + x: 5, + y: 1, + accessor: 'y1', + mark: null, + datum: {}, + }; + const series = { + key: 'spec{d}yAccessor{d}splitAccessors{b-2}', + specId: 'd', + yAccessor: 'yAccessorId', + splitAccessors: {}, + seriesKeys: ['yAccessorId'], + }; + + const wrapper = mountWithIntl( + + ); + + wrapper.find(Settings).first().prop('onElementClick')!([ + [geometry, series as XYChartSeriesIdentifier], + ]); + + expect(onClickValue).toHaveBeenCalledWith({ + data: [ + { + column: 0, + row: 0, + table: numberHistogramData.tables.numberLayer, + value: 5, + }, + ], + timeFieldName: undefined, + }); + }); + + test('returns correct original data for ordinal x axis with special formatter', () => { + const geometry: GeometryValue = { x: 'BAR', y: 1, accessor: 'y1', mark: null, datum: {} }; + const series = { + key: 'spec{d}yAccessor{d}splitAccessors{b-2}', + specId: 'd', + yAccessor: 'a', + splitAccessors: {}, + seriesKeys: ['a'], + }; + + const { args, data } = sampleArgs(); + + convertSpy.mockImplementation((x) => (typeof x === 'string' ? x.toUpperCase() : x)); + + const wrapper = mountWithIntl( + + ); + + wrapper.find(Settings).first().prop('onElementClick')!([ + [geometry, series as XYChartSeriesIdentifier], + ]); + + expect(onClickValue).toHaveBeenCalledWith({ + data: [ + { + column: 3, + row: 1, + table: data.tables.first, + value: 'Bar', + }, + ], + }); + }); + + test('sets up correct yScaleType equal to binary_linear for bytes formatting', () => { + const { args, data } = sampleArgs(); + data.tables.first.columns[0].meta = { + type: 'number', + params: { id: 'bytes', params: { pattern: '0,0.00b' } }, + }; + + const wrapper = mountWithIntl( + + ); + + expect(wrapper.find(LineSeries).at(0).prop('yScaleType')).toEqual('linear_binary'); + }); + + test('allowBrushingLastHistogramBin should be fakse for ordinal data', () => { + const { args, data } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + + expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBin')).toEqual(false); + }); + + test('onElementClick is not triggering event on non-interactive mode', () => { + const { args, data } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + + expect(wrapper.find(Settings).first().prop('onElementClick')).toBeUndefined(); + }); + + test('legendAction is not triggering event on non-interactive mode', () => { + const { args, data } = sampleArgs(); + + const wrapper = mountWithIntl( + + ); + + expect(wrapper.find(Settings).first().prop('legendAction')).toBeUndefined(); + }); + + test('it renders stacked bar', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component).toMatchSnapshot(); + expect(component.find(BarSeries)).toHaveLength(2); + expect(component.find(BarSeries).at(0).prop('stackAccessors')).toHaveLength(1); + expect(component.find(BarSeries).at(1).prop('stackAccessors')).toHaveLength(1); + }); + + test('it renders stacked area', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component).toMatchSnapshot(); + expect(component.find(AreaSeries)).toHaveLength(2); + expect(component.find(AreaSeries).at(0).prop('stackAccessors')).toHaveLength(1); + expect(component.find(AreaSeries).at(1).prop('stackAccessors')).toHaveLength(1); + }); + + test('it renders stacked horizontal bar', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component).toMatchSnapshot(); + expect(component.find(BarSeries)).toHaveLength(2); + expect(component.find(BarSeries).at(0).prop('stackAccessors')).toHaveLength(1); + expect(component.find(BarSeries).at(1).prop('stackAccessors')).toHaveLength(1); + expect(component.find(Settings).prop('rotation')).toEqual(90); + }); + + test('it renders stacked bar empty placeholder for no results', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + + expect(component.find(BarSeries)).toHaveLength(0); + expect(component.find(EmptyPlaceholder).prop('icon')).toBeDefined(); + }); + + test('it passes time zone to the series', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component.find(LineSeries).at(0).prop('timeZone')).toEqual('CEST'); + expect(component.find(LineSeries).at(1).prop('timeZone')).toEqual('CEST'); + }); + + test('it applies histogram mode to the series for single series', () => { + const { data, args } = sampleArgs(); + const firstLayer: DataLayerConfigResult = { + ...args.layers[0], + accessors: ['b'], + seriesType: 'bar', + isHistogram: true, + } as DataLayerConfigResult; + delete firstLayer.splitAccessor; + const component = shallow( + + ); + expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(true); + }); + + test('it does not apply histogram mode to more than one bar series for unstacked bar chart', () => { + const { data, args } = sampleArgs(); + const firstLayer: DataLayerConfigResult = { + ...args.layers[0], + seriesType: 'bar', + isHistogram: true, + } as DataLayerConfigResult; + delete firstLayer.splitAccessor; + const component = shallow( + + ); + expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(false); + expect(component.find(BarSeries).at(1).prop('enableHistogramMode')).toEqual(false); + }); + + test('it applies histogram mode to more than one the series for unstacked line/area chart', () => { + const { data, args } = sampleArgs(); + const firstLayer: DataLayerConfigResult = { + ...args.layers[0], + seriesType: 'line', + isHistogram: true, + } as DataLayerConfigResult; + delete firstLayer.splitAccessor; + const secondLayer: DataLayerConfigResult = { + ...args.layers[0], + seriesType: 'line', + isHistogram: true, + } as DataLayerConfigResult; + delete secondLayer.splitAccessor; + const component = shallow( + + ); + expect(component.find(LineSeries).at(0).prop('enableHistogramMode')).toEqual(true); + expect(component.find(LineSeries).at(1).prop('enableHistogramMode')).toEqual(true); + }); + + test('it applies histogram mode to the series for stacked series', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(true); + expect(component.find(BarSeries).at(1).prop('enableHistogramMode')).toEqual(true); + }); + + test('it does not apply histogram mode for splitted series', () => { + const { data, args } = sampleArgs(); + const component = shallow( + + ); + expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(false); + expect(component.find(BarSeries).at(1).prop('enableHistogramMode')).toEqual(false); + }); + + describe('y axes', () => { + test('single axis if possible', () => { + const args = createArgsWithLayers(); + + const component = getRenderedComponent(dataWithoutFormats, args); + const axes = component.find(Axis); + expect(axes).toHaveLength(2); + }); + + test('multiple axes because of config', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a', 'b'], + yConfig: [ + { + forAccessor: 'a', + axisMode: 'left', + }, + { + forAccessor: 'b', + axisMode: 'right', + }, + ], + }, + ], + } as XYArgs; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + const axes = component.find(Axis); + expect(axes).toHaveLength(3); + expect(component.find(LineSeries).at(0).prop('groupId')).toEqual(axes.at(1).prop('groupId')); + expect(component.find(LineSeries).at(1).prop('groupId')).toEqual(axes.at(2).prop('groupId')); + }); + + test('multiple axes because of incompatible formatters', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['c', 'd'], + }, + ], + } as XYArgs; + + const component = getRenderedComponent(dataWithFormats, newArgs); + const axes = component.find(Axis); + expect(axes).toHaveLength(3); + expect(component.find(LineSeries).at(0).prop('groupId')).toEqual(axes.at(1).prop('groupId')); + expect(component.find(LineSeries).at(1).prop('groupId')).toEqual(axes.at(2).prop('groupId')); + }); + + test('single axis despite different formatters if enforced', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['c', 'd'], + yConfig: [ + { + forAccessor: 'c', + axisMode: 'left', + }, + { + forAccessor: 'd', + axisMode: 'left', + }, + ], + }, + ], + } as XYArgs; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + const axes = component.find(Axis); + expect(axes).toHaveLength(2); + }); + }); + + describe('y series coloring', () => { + test('color is applied to chart for multiple series', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + splitAccessor: undefined, + accessors: ['a', 'b'], + yConfig: [ + { + forAccessor: 'a', + color: '#550000', + }, + { + forAccessor: 'b', + color: '#FFFF00', + }, + ], + }, + { + ...args.layers[0], + splitAccessor: undefined, + accessors: ['c'], + yConfig: [ + { + forAccessor: 'c', + color: '#FEECDF', + }, + ], + }, + ], + } as XYArgs; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + expect( + (component.find(LineSeries).at(0).prop('color') as Function)!({ + yAccessor: 'a', + seriesKeys: ['a'], + }) + ).toEqual('#550000'); + expect( + (component.find(LineSeries).at(1).prop('color') as Function)!({ + yAccessor: 'b', + seriesKeys: ['b'], + }) + ).toEqual('#FFFF00'); + expect( + (component.find(LineSeries).at(2).prop('color') as Function)!({ + yAccessor: 'c', + seriesKeys: ['c'], + }) + ).toEqual('#FEECDF'); + }); + test('color is not applied to chart when splitAccessor is defined or when yConfig is not configured', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a'], + yConfig: [ + { + forAccessor: 'a', + color: '#550000', + }, + ], + }, + { + ...args.layers[0], + splitAccessor: undefined, + accessors: ['c'], + }, + ], + } as XYArgs; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + expect( + (component.find(LineSeries).at(0).prop('color') as Function)!({ + yAccessor: 'a', + seriesKeys: ['a'], + }) + ).toEqual('blue'); + expect( + (component.find(LineSeries).at(1).prop('color') as Function)!({ + yAccessor: 'c', + seriesKeys: ['c'], + }) + ).toEqual('blue'); + }); + }); + + describe('provides correct series naming', () => { + const nameFnArgs = { + seriesKeys: [], + key: '', + specId: 'a', + yAccessor: '', + splitAccessors: new Map(), + }; + + test('simplest xy chart without human-readable name', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a'], + splitAccessor: undefined, + columnToLabel: '', + }, + ], + }; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; + + // In this case, the ID is used as the name. This shouldn't happen in practice + expect(nameFn({ ...nameFnArgs, seriesKeys: ['a'] }, false)).toEqual(''); + expect(nameFn({ ...nameFnArgs, seriesKeys: ['nonsense'] }, false)).toEqual(''); + }); + + test('simplest xy chart with empty name', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a'], + splitAccessor: undefined, + columnToLabel: '{"a":""}', + }, + ], + }; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; + + // In this case, the ID is used as the name. This shouldn't happen in practice + expect(nameFn({ ...nameFnArgs, seriesKeys: ['a'] }, false)).toEqual(''); + expect(nameFn({ ...nameFnArgs, seriesKeys: ['nonsense'] }, false)).toEqual(''); + }); + + test('simplest xy chart with human-readable name', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a'], + splitAccessor: undefined, + columnToLabel: '{"a":"Column A"}', + }, + ], + }; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; + + expect(nameFn({ ...nameFnArgs, seriesKeys: ['a'] }, false)).toEqual('Column A'); + }); + + test('multiple y accessors', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a', 'b'], + splitAccessor: undefined, + columnToLabel: '{"a": "Label A"}', + }, + ], + }; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + const nameFn1 = component.find(LineSeries).at(0).prop('name') as SeriesNameFn; + const nameFn2 = component.find(LineSeries).at(1).prop('name') as SeriesNameFn; + + // This accessor has a human-readable name + expect(nameFn1({ ...nameFnArgs, seriesKeys: ['a'] }, false)).toEqual('Label A'); + // This accessor does not + expect(nameFn2({ ...nameFnArgs, seriesKeys: ['b'] }, false)).toEqual(''); + expect(nameFn1({ ...nameFnArgs, seriesKeys: ['nonsense'] }, false)).toEqual(''); + }); + + test('split series without formatting and single y accessor', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a'], + splitAccessor: 'd', + columnToLabel: '{"a": "Label A"}', + }, + ], + }; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; + + expect(nameFn({ ...nameFnArgs, seriesKeys: ['split1', 'a'] }, false)).toEqual('split1'); + }); + + test('split series with formatting and single y accessor', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a'], + splitAccessor: 'd', + columnToLabel: '{"a": "Label A"}', + }, + ], + }; + + const component = getRenderedComponent(dataWithFormats, newArgs); + const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; + + convertSpy.mockReturnValueOnce('formatted'); + expect(nameFn({ ...nameFnArgs, seriesKeys: ['split1', 'a'] }, false)).toEqual('formatted'); + expect(getFormatSpy).toHaveBeenCalledWith({ id: 'custom' }); + }); + + test('split series without formatting with multiple y accessors', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a', 'b'], + splitAccessor: 'd', + columnToLabel: '{"a": "Label A","b": "Label B"}', + }, + ], + }; + + const component = getRenderedComponent(dataWithoutFormats, newArgs); + const nameFn1 = component.find(LineSeries).at(0).prop('name') as SeriesNameFn; + const nameFn2 = component.find(LineSeries).at(0).prop('name') as SeriesNameFn; + + expect(nameFn1({ ...nameFnArgs, seriesKeys: ['split1', 'a'] }, false)).toEqual( + 'split1 - Label A' + ); + expect(nameFn2({ ...nameFnArgs, seriesKeys: ['split1', 'b'] }, false)).toEqual( + 'split1 - Label B' + ); + }); + + test('split series with formatting with multiple y accessors', () => { + const args = createArgsWithLayers(); + const newArgs = { + ...args, + layers: [ + { + ...args.layers[0], + accessors: ['a', 'b'], + splitAccessor: 'd', + columnToLabel: '{"a": "Label A","b": "Label B"}', + }, + ], + }; + + const component = getRenderedComponent(dataWithFormats, newArgs); + const nameFn1 = component.find(LineSeries).at(0).prop('name') as SeriesNameFn; + const nameFn2 = component.find(LineSeries).at(1).prop('name') as SeriesNameFn; + + convertSpy.mockReturnValueOnce('formatted1').mockReturnValueOnce('formatted2'); + expect(nameFn1({ ...nameFnArgs, seriesKeys: ['split1', 'a'] }, false)).toEqual( + 'formatted1 - Label A' + ); + expect(nameFn2({ ...nameFnArgs, seriesKeys: ['split1', 'b'] }, false)).toEqual( + 'formatted2 - Label B' + ); + }); + }); + + test('it set the scale of the x axis according to the args prop', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + expect(component.find(LineSeries).at(0).prop('xScaleType')).toEqual(ScaleType.Ordinal); + expect(component.find(LineSeries).at(1).prop('xScaleType')).toEqual(ScaleType.Ordinal); + }); + + test('it set the scale of the y axis according to the args prop', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + expect(component.find(LineSeries).at(0).prop('yScaleType')).toEqual(ScaleType.Sqrt); + expect(component.find(LineSeries).at(1).prop('yScaleType')).toEqual(ScaleType.Sqrt); + }); + + test('it gets the formatter for the x axis', () => { + const { data, args } = sampleArgs(); + + shallow(); + + expect(getFormatSpy).toHaveBeenCalledWith({ id: 'string' }); + }); + + test('it gets the formatter for the y axis if there is only one accessor', () => { + const { data, args } = sampleArgs(); + + shallow( + + ); + expect(getFormatSpy).toHaveBeenCalledWith({ + id: 'number', + params: { pattern: '0,0.000' }, + }); + }); + + test('it should pass the formatter function to the axis', () => { + const { data, args } = sampleArgs(); + + const instance = shallow(); + + const tickFormatter = instance.find(Axis).first().prop('tickFormat'); + + if (!tickFormatter) { + throw new Error('tickFormatter prop not found'); + } + + tickFormatter('I'); + + expect(convertSpy).toHaveBeenCalledWith('I'); + }); + + test('it should set the tickLabel visibility on the x axis if the tick labels is hidden', () => { + const { data, args } = sampleArgs(); + + args.tickLabelsVisibilitySettings = { + x: false, + yLeft: true, + yRight: true, + type: 'tickLabelsConfig', + }; + + const instance = shallow(); + + const axisStyle = instance.find(Axis).first().prop('style'); + + expect(axisStyle).toMatchObject({ + tickLabel: { + visible: false, + }, + }); + }); + + test('it should set the tickLabel visibility on the y axis if the tick labels is hidden', () => { + const { data, args } = sampleArgs(); + + args.tickLabelsVisibilitySettings = { + x: true, + yLeft: false, + yRight: false, + type: 'tickLabelsConfig', + }; + + const instance = shallow(); + + const axisStyle = instance.find(Axis).at(1).prop('style'); + + expect(axisStyle).toMatchObject({ + tickLabel: { + visible: false, + }, + }); + }); + + test('it should set the tickLabel visibility on the x axis if the tick labels is shown', () => { + const { data, args } = sampleArgs(); + + args.tickLabelsVisibilitySettings = { + x: true, + yLeft: true, + yRight: true, + type: 'tickLabelsConfig', + }; + + const instance = shallow(); + + const axisStyle = instance.find(Axis).first().prop('style'); + + expect(axisStyle).toMatchObject({ + tickLabel: { + visible: true, + }, + }); + }); + + test('it should set the tickLabel orientation on the x axis', () => { + const { data, args } = sampleArgs(); + + args.labelsOrientation = { + x: -45, + yLeft: 0, + yRight: -90, + type: 'labelsOrientationConfig', + }; + + const instance = shallow(); + + const axisStyle = instance.find(Axis).first().prop('style'); + + expect(axisStyle).toMatchObject({ + tickLabel: { + rotation: -45, + }, + }); + }); + + test('it should set the tickLabel visibility on the y axis if the tick labels is shown', () => { + const { data, args } = sampleArgs(); + + args.tickLabelsVisibilitySettings = { + x: false, + yLeft: true, + yRight: true, + type: 'tickLabelsConfig', + }; + + const instance = shallow(); + + const axisStyle = instance.find(Axis).at(1).prop('style'); + + expect(axisStyle).toMatchObject({ + tickLabel: { + visible: true, + }, + }); + }); + + test('it should set the tickLabel orientation on the y axis', () => { + const { data, args } = sampleArgs(); + + args.labelsOrientation = { + x: -45, + yLeft: -90, + yRight: -90, + type: 'labelsOrientationConfig', + }; + + const instance = shallow(); + + const axisStyle = instance.find(Axis).at(1).prop('style'); + + expect(axisStyle).toMatchObject({ + tickLabel: { + rotation: -90, + }, + }); + }); + + test('it should remove invalid rows', () => { + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: { + type: 'datatable', + columns: [ + { id: 'a', name: 'a', meta: { type: 'number' } }, + { id: 'b', name: 'b', meta: { type: 'number' } }, + { id: 'c', name: 'c', meta: { type: 'string' } }, + ], + rows: [ + { a: undefined, b: 2, c: 'I', d: 'Row 1' }, + { a: 1, b: 5, c: 'J', d: 'Row 2' }, + ], + }, + second: { + type: 'datatable', + columns: [ + { id: 'a', name: 'a', meta: { type: 'number' } }, + { id: 'b', name: 'b', meta: { type: 'number' } }, + { id: 'c', name: 'c', meta: { type: 'string' } }, + ], + rows: [ + { a: undefined, b: undefined, c: undefined }, + { a: undefined, b: undefined, c: undefined }, + ], + }, + }, + }; + + const args: XYArgs = { + xTitle: '', + yTitle: '', + yRightTitle: '', + legend: { type: 'legendConfig', isVisible: false, position: Position.Top }, + valueLabels: 'hide', + tickLabelsVisibilitySettings: { + type: 'tickLabelsConfig', + x: true, + yLeft: true, + yRight: true, + }, + gridlinesVisibilitySettings: { + type: 'gridlinesConfig', + x: true, + yLeft: false, + yRight: false, + }, + labelsOrientation: { + type: 'labelsOrientationConfig', + x: 0, + yLeft: 0, + yRight: 0, + }, + yLeftExtent: { + mode: 'full', + type: 'axisExtentConfig', + }, + yRightExtent: { + mode: 'full', + type: 'axisExtentConfig', + }, + layers: [ + { + type: 'dataLayer', + layerId: 'first', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'a', + accessors: ['c'], + splitAccessor: 'b', + columnToLabel: '', + xScaleType: 'ordinal', + yScaleType: 'linear', + isHistogram: false, + palette: mockPaletteOutput, + }, + { + type: 'dataLayer', + layerId: 'second', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'a', + accessors: ['c'], + splitAccessor: 'b', + columnToLabel: '', + xScaleType: 'ordinal', + yScaleType: 'linear', + isHistogram: false, + palette: mockPaletteOutput, + }, + ], + }; + + const component = shallow(); + + const series = component.find(LineSeries); + + // Only one series should be rendered, even though 2 are configured + // This one series should only have one row, even though 2 are sent + expect(series.prop('data')).toEqual([{ a: 1, b: 5, c: 'J', d: 'Row 2' }]); + }); + + test('it should not remove rows with falsy but non-undefined values', () => { + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: { + type: 'datatable', + columns: [ + { id: 'a', name: 'a', meta: { type: 'number' } }, + { id: 'b', name: 'b', meta: { type: 'number' } }, + { id: 'c', name: 'c', meta: { type: 'number' } }, + ], + rows: [ + { a: 0, b: 2, c: 5 }, + { a: 1, b: 0, c: 7 }, + ], + }, + }, + }; + + const args: XYArgs = { + xTitle: '', + yTitle: '', + yRightTitle: '', + legend: { type: 'legendConfig', isVisible: false, position: Position.Top }, + valueLabels: 'hide', + tickLabelsVisibilitySettings: { + type: 'tickLabelsConfig', + x: true, + yLeft: false, + yRight: false, + }, + gridlinesVisibilitySettings: { + type: 'gridlinesConfig', + x: true, + yLeft: false, + yRight: false, + }, + labelsOrientation: { + type: 'labelsOrientationConfig', + x: 0, + yLeft: 0, + yRight: 0, + }, + yLeftExtent: { + mode: 'full', + type: 'axisExtentConfig', + }, + yRightExtent: { + mode: 'full', + type: 'axisExtentConfig', + }, + layers: [ + { + type: 'dataLayer', + layerId: 'first', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'a', + accessors: ['c'], + splitAccessor: 'b', + columnToLabel: '', + xScaleType: 'ordinal', + yScaleType: 'linear', + isHistogram: false, + palette: mockPaletteOutput, + }, + ], + }; + + const component = shallow(); + + const series = component.find(LineSeries); + + expect(series.prop('data')).toEqual([ + { a: 0, b: 2, c: 5 }, + { a: 1, b: 0, c: 7 }, + ]); + }); + + test('it should show legend for split series, even with one row', () => { + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: { + type: 'datatable', + columns: [ + { id: 'a', name: 'a', meta: { type: 'number' } }, + { id: 'b', name: 'b', meta: { type: 'number' } }, + { id: 'c', name: 'c', meta: { type: 'string' } }, + ], + rows: [{ a: 1, b: 5, c: 'J' }], + }, + }, + }; + + const args: XYArgs = { + xTitle: '', + yTitle: '', + yRightTitle: '', + legend: { type: 'legendConfig', isVisible: true, position: Position.Top }, + valueLabels: 'hide', + tickLabelsVisibilitySettings: { + type: 'tickLabelsConfig', + x: true, + yLeft: false, + yRight: false, + }, + gridlinesVisibilitySettings: { + type: 'gridlinesConfig', + x: true, + yLeft: false, + yRight: false, + }, + labelsOrientation: { + type: 'labelsOrientationConfig', + x: 0, + yLeft: 0, + yRight: 0, + }, + yLeftExtent: { + mode: 'full', + type: 'axisExtentConfig', + }, + yRightExtent: { + mode: 'full', + type: 'axisExtentConfig', + }, + layers: [ + { + type: 'dataLayer', + layerId: 'first', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'a', + accessors: ['c'], + splitAccessor: 'b', + columnToLabel: '', + xScaleType: 'ordinal', + yScaleType: 'linear', + isHistogram: false, + palette: mockPaletteOutput, + }, + ], + }; + + const component = shallow(); + + expect(component.find(Settings).prop('showLegend')).toEqual(true); + }); + + test('it should always show legend if showSingleSeries is set', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + + expect(component.find(Settings).prop('showLegend')).toEqual(true); + }); + + test('it should populate the correct legendPosition if isInside is set', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + + expect(component.find(Settings).prop('legendPosition')).toEqual({ + vAlign: VerticalAlignment.Top, + hAlign: HorizontalAlignment.Right, + direction: LayoutDirection.Vertical, + floating: true, + floatingColumns: 1, + }); + }); + + test('it not show legend if isVisible is set to false', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + + expect(component.find(Settings).prop('showLegend')).toEqual(false); + }); + + test('it should show legend on right side', () => { + const { data, args } = sampleArgs(); + + const component = shallow( + + ); + + expect(component.find(Settings).prop('legendPosition')).toEqual('top'); + }); + + test('it should apply the fitting function to all non-bar series', () => { + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: createSampleDatatableWithRows([ + { a: 1, b: 2, c: 'I', d: 'Foo' }, + { a: 1, b: 5, c: 'J', d: 'Bar' }, + ]), + }, + }; + + const args: XYArgs = createArgsWithLayers([ + { ...sampleLayer, accessors: ['a'] }, + { ...sampleLayer, seriesType: 'bar', accessors: ['a'] }, + { ...sampleLayer, seriesType: 'area', accessors: ['a'] }, + { ...sampleLayer, seriesType: 'area_stacked', accessors: ['a'] }, + ]); + + const component = shallow( + + ); + + expect(component.find(LineSeries).prop('fit')).toEqual({ type: Fit.Carry }); + expect(component.find(BarSeries).prop('fit')).toEqual(undefined); + expect(component.find(AreaSeries).at(0).prop('fit')).toEqual({ type: Fit.Carry }); + expect(component.find(AreaSeries).at(0).prop('stackAccessors')).toEqual([]); + expect(component.find(AreaSeries).at(1).prop('fit')).toEqual({ type: Fit.Carry }); + expect(component.find(AreaSeries).at(1).prop('stackAccessors')).toEqual(['c']); + }); + + test('it should apply None fitting function if not specified', () => { + const { data, args } = sampleArgs(); + + (args.layers[0] as DataLayerConfigResult).accessors = ['a']; + + const component = shallow(); + + expect(component.find(LineSeries).prop('fit')).toEqual({ type: Fit.None }); + }); + + test('it should apply the xTitle if is specified', () => { + const { data, args } = sampleArgs(); + + args.xTitle = 'My custom x-axis title'; + + const component = shallow(); + + expect(component.find(Axis).at(0).prop('title')).toEqual('My custom x-axis title'); + }); + + test('it should hide the X axis title if the corresponding switch is off', () => { + const { data, args } = sampleArgs(); + + args.axisTitlesVisibilitySettings = { + x: false, + yLeft: true, + yRight: true, + type: 'axisTitlesVisibilityConfig', + }; + + const component = shallow(); + + const axisStyle = component.find(Axis).first().prop('style'); + + expect(axisStyle).toMatchObject({ + axisTitle: { + visible: false, + }, + }); + }); + + test('it should show the X axis gridlines if the setting is on', () => { + const { data, args } = sampleArgs(); + + args.gridlinesVisibilitySettings = { + x: true, + yLeft: false, + yRight: false, + type: 'gridlinesConfig', + }; + + const component = shallow(); + + expect(component.find(Axis).at(0).prop('gridLine')).toMatchObject({ + visible: true, + }); + }); + + test('it should format the boolean values correctly', () => { + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: { + type: 'datatable', + columns: [ + { + id: 'a', + name: 'a', + meta: { type: 'number', params: { id: 'number', params: { pattern: '0,0.000' } } }, + }, + { + id: 'b', + name: 'b', + meta: { type: 'number', params: { id: 'number', params: { pattern: '000,0' } } }, + }, + { + id: 'c', + name: 'c', + meta: { + type: 'boolean', + params: { id: 'boolean' }, + }, + }, + ], + rows: [ + { a: 5, b: 2, c: 0 }, + { a: 19, b: 5, c: 1 }, + ], + }, + }, + dateRange: { + fromDate: new Date('2019-01-02T05:00:00.000Z'), + toDate: new Date('2019-01-03T05:00:00.000Z'), + }, + }; + const timeSampleLayer: DataLayerConfigResult = { + type: 'dataLayer', + layerId: 'first', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'c', + accessors: ['a', 'b'], + xScaleType: 'ordinal', + yScaleType: 'linear', + isHistogram: false, + palette: mockPaletteOutput, + }; + const args = createArgsWithLayers([timeSampleLayer]); + + const getCustomFormatSpy = jest.fn(); + getCustomFormatSpy.mockReturnValue({ convert: jest.fn((x) => Boolean(x)) }); + + const component = shallow( + + ); + + expect(component.find(LineSeries).at(1).prop('data')).toEqual([ + { + a: 5, + b: 2, + c: false, + }, + { + a: 19, + b: 5, + c: true, + }, + ]); + }); + + describe('annotations', () => { + const sampleStyledAnnotation: EventAnnotationOutput = { + time: '2022-03-18T08:25:00.000Z', + label: 'Event 1', + icon: 'triangle', + type: 'manual_event_annotation', + color: 'red', + lineStyle: 'dashed', + lineWidth: 3, + }; + const sampleAnnotationLayers: AnnotationLayerConfigResult[] = [ + { + type: 'annotationLayer', + layerType: LayerTypes.ANNOTATIONS, + layerId: 'annotation', + annotations: [ + { + time: '2022-03-18T08:25:17.140Z', + label: 'Annotation', + type: 'manual_event_annotation', + }, + ], + }, + ]; + function sampleArgsWithAnnotation(annotationLayers = sampleAnnotationLayers) { + const { args } = sampleArgs(); + return { + data: dateHistogramData, + args: { + ...args, + layers: [dateHistogramLayer, ...annotationLayers], + } as XYArgs, + }; + } + test('should render basic annotation', () => { + const { data, args } = sampleArgsWithAnnotation(); + const component = mount(); + expect(component.find('LineAnnotation')).toMatchSnapshot(); + }); + test('should render simplified annotation when hide is true', () => { + const { data, args } = sampleArgsWithAnnotation(); + (args.layers[0] as AnnotationLayerConfigResult).hide = true; + const component = mount(); + expect(component.find('LineAnnotation')).toMatchSnapshot(); + }); + + test('should render grouped annotations preserving the shared styles', () => { + const { data, args } = sampleArgsWithAnnotation([ + { + type: 'annotationLayer', + layerType: LayerTypes.ANNOTATIONS, + layerId: 'annotation', + annotations: [ + sampleStyledAnnotation, + { ...sampleStyledAnnotation, time: '2022-03-18T08:25:00.020Z', label: 'Event 2' }, + { + ...sampleStyledAnnotation, + time: '2022-03-18T08:25:00.001Z', + label: 'Event 3', + }, + ], + }, + ]); + const component = mount(); + const groupedAnnotation = component.find(LineAnnotation); + + expect(groupedAnnotation.length).toEqual(1); + // styles are passed because they are shared, dataValues & header is rounded to the interval + expect(groupedAnnotation).toMatchSnapshot(); + // renders numeric icon for grouped annotations + const marker = mount(
{groupedAnnotation.prop('marker')}
); + const numberIcon = marker.find('NumberIcon'); + expect(numberIcon.length).toEqual(1); + expect(numberIcon.text()).toEqual('3'); + + // checking tooltip + const renderLinks = mount(
{groupedAnnotation.prop('customTooltipDetails')!()}
); + expect(renderLinks.text()).toEqual( + ' Event 1 2022-03-18T08:25:00.000Z Event 3 2022-03-18T08:25:00.001Z Event 2 2022-03-18T08:25:00.020Z' + ); + }); + test('should render grouped annotations with default styles', () => { + const { data, args } = sampleArgsWithAnnotation([ + { + type: 'annotationLayer', + layerType: LayerTypes.ANNOTATIONS, + layerId: 'annotation', + annotations: [sampleStyledAnnotation], + }, + { + type: 'annotationLayer', + layerType: LayerTypes.ANNOTATIONS, + layerId: 'annotation', + annotations: [ + { + ...sampleStyledAnnotation, + icon: 'square', + color: 'blue', + lineStyle: 'dotted', + lineWidth: 10, + time: '2022-03-18T08:25:00.001Z', + label: 'Event 2', + }, + ], + }, + ]); + const component = mount(); + const groupedAnnotation = component.find(LineAnnotation); + + expect(groupedAnnotation.length).toEqual(1); + // styles are default because they are different for both annotations + expect(groupedAnnotation).toMatchSnapshot(); + }); + test('should not render hidden annotations', () => { + const { data, args } = sampleArgsWithAnnotation([ + { + type: 'annotationLayer', + layerType: LayerTypes.ANNOTATIONS, + layerId: 'annotation', + annotations: [ + sampleStyledAnnotation, + { ...sampleStyledAnnotation, time: '2022-03-18T08:30:00.020Z', label: 'Event 2' }, + { + ...sampleStyledAnnotation, + time: '2022-03-18T08:35:00.001Z', + label: 'Event 3', + isHidden: true, + }, + ], + }, + ]); + const component = mount(); + const annotations = component.find(LineAnnotation); + + expect(annotations.length).toEqual(2); + }); + }); +}); diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.tsx b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx similarity index 81% rename from x-pack/plugins/lens/public/xy_visualization/expression.tsx rename to src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx index 105b9d24bb09b..d69e8e8b645fa 100644 --- a/x-pack/plugins/lens/public/xy_visualization/expression.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx @@ -1,14 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import './expression.scss'; - import React, { useRef } from 'react'; -import ReactDOM from 'react-dom'; import { Chart, Settings, @@ -38,57 +36,44 @@ import { LineSeriesProps, ColorVariant, } from '@elastic/charts'; -import { I18nProvider } from '@kbn/i18n-react'; -import type { - ExpressionRenderDefinition, - Datatable, - DatatableRow, - DatatableColumn, -} from 'src/plugins/expressions/public'; import { IconType } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { RenderMode } from 'src/plugins/expressions'; -import { ThemeServiceStart } from 'kibana/public'; -import { FieldFormat } from 'src/plugins/field_formats/common'; -import { EventAnnotationServiceType } from '../../../../../src/plugins/event_annotation/public'; -import { EmptyPlaceholder } from '../../../../../src/plugins/charts/public'; -import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; -import type { ILensInterpreterRenderHandlers, LensFilterEvent, LensBrushEvent } from '../types'; -import type { LensMultiTable, FormatFactory } from '../../common'; -import type { - DataLayerArgs, - SeriesType, - XYChartProps, - XYLayerArgs, -} from '../../common/expressions'; -import { visualizationTypes } from './types'; -import { VisualizationContainer } from '../visualization_container'; -import { isHorizontalChart, getSeriesColor } from './state_helpers'; -import { search } from '../../../../../src/plugins/data/public'; +import type { Datatable, DatatableRow, DatatableColumn } from '../../../../expressions/public'; +import { RenderMode } from '../../../../expressions/common'; +import { FieldFormat } from '../../../../field_formats/common'; +import { EmptyPlaceholder } from '../../../../../plugins/charts/public'; +import type { FilterEvent, BrushEvent, FormatFactory } from '../types'; +import type { SeriesType, XYChartProps } from '../../common/types'; +import { isHorizontalChart, getSeriesColor, getAnnotationsLayers, getDataLayers } from '../helpers'; +import { EventAnnotationServiceType } from '../../../../event_annotation/public'; import { ChartsPluginSetup, ChartsPluginStart, PaletteRegistry, SeriesLayer, useActiveCursor, -} from '../../../../../src/plugins/charts/public'; -import { MULTILAYER_TIME_AXIS_STYLE } from '../../../../../src/plugins/charts/common'; -import { getFitOptions } from './fitting_functions'; -import { getAxesConfiguration, GroupsConfiguration, validateExtent } from './axes_configuration'; -import { getColorAssignments } from './color_assignment'; -import { getXDomain, XyEndzones } from './x_domain'; -import { getLegendAction } from './get_legend_action'; -import { ReferenceLineAnnotations } from './expression_reference_lines'; - -import { computeChartMargins, getLinesCausedPaddings } from './annotations_helpers'; - -import { Annotations, getAnnotationsGroupedByInterval } from './annotations/expression'; -import { computeOverallDataDomain } from './reference_line_helpers'; +} from '../../../../../plugins/charts/public'; +import { MULTILAYER_TIME_AXIS_STYLE } from '../../../../../plugins/charts/common'; import { + getFilteredLayers, getReferenceLayers, - getDataLayersArgs, - getAnnotationsLayersArgs, -} from './visualization_helpers'; + isDataLayer, + getFitOptions, + getAxesConfiguration, + GroupsConfiguration, + validateExtent, + computeOverallDataDomain, + getColorAssignments, + getLinesCausedPaddings, +} from '../helpers'; +import { getXDomain, XyEndzones } from './x_domain'; +import { getLegendAction } from './legend_action'; +import { ReferenceLineAnnotations, computeChartMargins } from './reference_lines'; +import { visualizationDefinitions } from '../definitions'; +import { XYLayerConfigResult } from '../../common/types'; +import { Annotations, getAnnotationsGroupedByInterval } from './annotations'; + +import './xy_chart.scss'; declare global { interface Window { @@ -110,96 +95,15 @@ export type XYChartRenderProps = XYChartProps & { useLegacyTimeAxis: boolean; minInterval: number | undefined; interactive?: boolean; - onClickValue: (data: LensFilterEvent['data']) => void; - onSelectRange: (data: LensBrushEvent['data']) => void; + onClickValue: (data: FilterEvent['data']) => void; + onSelectRange: (data: BrushEvent['data']) => void; renderMode: RenderMode; syncColors: boolean; eventAnnotationService: EventAnnotationServiceType; }; -export function calculateMinInterval({ args: { layers }, data }: XYChartProps) { - const filteredLayers = getFilteredLayers(layers, data); - if (filteredLayers.length === 0) return; - const isTimeViz = filteredLayers.every((l) => l.xScaleType === 'time'); - const xColumn = data.tables[filteredLayers[0].layerId].columns.find( - (column) => column.id === filteredLayers[0].xAccessor - ); - - if (!xColumn) return; - if (!isTimeViz) { - const histogramInterval = search.aggs.getNumberHistogramIntervalByDatatableColumn(xColumn); - if (typeof histogramInterval === 'number') { - return histogramInterval; - } else { - return undefined; - } - } - const dateInterval = search.aggs.getDateHistogramMetaDataByDatatableColumn(xColumn)?.interval; - if (!dateInterval) return; - const intervalDuration = search.aggs.parseInterval(dateInterval); - if (!intervalDuration) return; - return intervalDuration.as('milliseconds'); -} - const isPrimitive = (value: unknown): boolean => value != null && typeof value !== 'object'; -export const getXyChartRenderer = (dependencies: { - formatFactory: FormatFactory; - chartsThemeService: ChartsPluginStart['theme']; - chartsActiveCursorService: ChartsPluginStart['activeCursor']; - paletteService: PaletteRegistry; - timeZone: string; - useLegacyTimeAxis: boolean; - kibanaTheme: ThemeServiceStart; - eventAnnotationService: EventAnnotationServiceType; -}): ExpressionRenderDefinition => ({ - name: 'lens_xy_chart_renderer', - displayName: 'XY chart', - help: i18n.translate('xpack.lens.xyChart.renderer.help', { - defaultMessage: 'X/Y chart renderer', - }), - validate: () => undefined, - reuseDomNode: true, - render: async ( - domNode: Element, - config: XYChartProps, - handlers: ILensInterpreterRenderHandlers - ) => { - handlers.onDestroy(() => ReactDOM.unmountComponentAtNode(domNode)); - const onClickValue = (data: LensFilterEvent['data']) => { - handlers.event({ name: 'filter', data }); - }; - const onSelectRange = (data: LensBrushEvent['data']) => { - handlers.event({ name: 'brush', data }); - }; - - ReactDOM.render( - - - - - , - domNode, - () => handlers.done() - ); - }, -}); - function getValueLabelsStyling(isHorizontal: boolean): { displayValue: RecursivePartial; } { @@ -222,18 +126,10 @@ function getValueLabelsStyling(isHorizontal: boolean): { } function getIconForSeriesType(seriesType: SeriesType): IconType { - return visualizationTypes.find((c) => c.id === seriesType)!.icon || 'empty'; + return visualizationDefinitions.find((c) => c.id === seriesType)!.icon || 'empty'; } -const MemoizedChart = React.memo(XYChart); - -export function XYChartReportable(props: XYChartRenderProps) { - return ( - - - - ); -} +export const XYChartReportable = React.memo(XYChart); export function XYChart({ data, @@ -268,26 +164,28 @@ export function XYChart({ const chartBaseTheme = chartsThemeService.useChartsBaseTheme(); const darkMode = chartsThemeService.useDarkMode(); const filteredLayers = getFilteredLayers(layers, data); - const layersById = filteredLayers.reduce((memo, layer) => { - memo[layer.layerId] = layer; - return memo; - }, {} as Record); + const layersById = filteredLayers.reduce>( + (hashMap, layer) => { + hashMap[layer.layerId] = layer; + return hashMap; + }, + {} + ); const handleCursorUpdate = useActiveCursor(chartsActiveCursorService, chartRef, { datatables: Object.values(data.tables), }); if (filteredLayers.length === 0) { - const icon: IconType = getIconForSeriesType( - getDataLayersArgs(layers)?.[0]?.seriesType || 'bar' - ); - return ; + const icon: IconType = getIconForSeriesType(getDataLayers(layers)?.[0]?.seriesType || 'bar'); + return ; } // use formatting hint of first x axis column to format ticks const xAxisColumn = data.tables[filteredLayers[0].layerId].columns.find( ({ id }) => id === filteredLayers[0].xAccessor ); + const xAxisFormatter = formatFactory(xAxisColumn && xAxisColumn.meta?.params); const layersAlreadyFormatted: Record = {}; @@ -368,7 +266,7 @@ export function XYChart({ }; const referenceLineLayers = getReferenceLayers(layers); - const annotationsLayers = getAnnotationsLayersArgs(layers); + const annotationsLayers = getAnnotationsLayers(layers); const firstTable = data.tables[filteredLayers[0].layerId]; const xColumnId = firstTable.columns.find((col) => col.id === filteredLayers[0].xAccessor)?.id; @@ -427,8 +325,12 @@ export function XYChart({ const extent = axis.groupId === 'left' ? yLeftExtent : yRightExtent; const hasBarOrArea = Boolean( axis.series.some((series) => { - const seriesType = layersById[series.layer]?.seriesType; - return seriesType?.includes('bar') || seriesType?.includes('area'); + const layer = layersById[series.layer]; + if (!(layer && isDataLayer(layer))) { + return false; + } + + return layer.seriesType.includes('bar') || layer.seriesType.includes('area'); }) ); const fit = !hasBarOrArea && extent.mode === 'dataBounds'; @@ -489,7 +391,7 @@ export function XYChart({ const valueLabelsStyling = shouldShowValueLabels && valueLabels !== 'hide' && getValueLabelsStyling(shouldRotate); - const colorAssignments = getColorAssignments(getDataLayersArgs(args.layers), data, formatFactory); + const colorAssignments = getColorAssignments(getDataLayers(args.layers), data, formatFactory); const clickHandler: ElementClickListener = ([[geometry, series]]) => { // for xyChart series is always XYChartSeriesIdentifier and geometry is always type of GeometryValue @@ -548,7 +450,7 @@ export function XYChart({ value: pointValue, }); } - const context: LensFilterEvent['data'] = { + const context: FilterEvent['data'] = { data: points.map((point) => ({ row: point.row, column: point.column, @@ -572,7 +474,7 @@ export function XYChart({ const xAxisColumnIndex = table.columns.findIndex((el) => el.id === filteredLayers[0].xAccessor); - const context: LensBrushEvent['data'] = { + const context: BrushEvent['data'] = { range: [min, max], table, column: xAxisColumnIndex, @@ -827,7 +729,7 @@ export function XYChart({ if (!xAccessor) { rows.forEach((row) => { - row.unifiedX = i18n.translate('xpack.lens.xyChart.emptyXLabel', { + row.unifiedX = i18n.translate('expressionXY.xyChart.emptyXLabel', { defaultMessage: '(empty)', }); }); @@ -1021,8 +923,6 @@ export function XYChart({ { - const { layerId, xAccessor, accessors, splitAccessor } = layer; - return !( - !accessors.length || - !data.tables[layerId] || - data.tables[layerId].rows.length === 0 || - (xAccessor && - data.tables[layerId].rows.every((row) => typeof row[xAccessor] === 'undefined')) || - // stacked percentage bars have no xAccessors but splitAccessor with undefined values in them when empty - (!xAccessor && - splitAccessor && - data.tables[layerId].rows.every((row) => typeof row[splitAccessor] === 'undefined')) - ); - }); -} - function assertNever(x: never): never { throw new Error('Unexpected series type: ' + x); } diff --git a/src/plugins/chart_expressions/expression_xy/public/definitions/index.ts b/src/plugins/chart_expressions/expression_xy/public/definitions/index.ts new file mode 100644 index 0000000000000..53af8ec397dcb --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/definitions/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { visualizationDefinitions } from './visualizations'; diff --git a/src/plugins/chart_expressions/expression_xy/public/definitions/visualizations.ts b/src/plugins/chart_expressions/expression_xy/public/definitions/visualizations.ts new file mode 100644 index 0000000000000..9cd1540c7bbeb --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/definitions/visualizations.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { SeriesTypes } from '../../common/constants'; +import { + BarIcon, + LineIcon, + AreaIcon, + BarStackedIcon, + AreaStackedIcon, + BarHorizontalIcon, + BarPercentageIcon, + AreaPercentageIcon, + BarHorizontalStackedIcon, + BarHorizontalPercentageIcon, +} from '../icons'; + +export const visualizationDefinitions = [ + { id: SeriesTypes.BAR, icon: BarIcon }, + { id: SeriesTypes.BAR_STACKED, icon: BarStackedIcon }, + { id: SeriesTypes.BAR_HORIZONTAL, icon: BarHorizontalIcon }, + { id: SeriesTypes.BAR_PERCENTAGE_STACKED, icon: BarPercentageIcon }, + { id: SeriesTypes.BAR_HORIZONTAL_STACKED, icon: BarHorizontalStackedIcon }, + { id: SeriesTypes.BAR_HORIZONTAL_PERCENTAGE_STACKED, icon: BarHorizontalPercentageIcon }, + { id: SeriesTypes.LINE, icon: LineIcon }, + { id: SeriesTypes.AREA, icon: AreaIcon }, + { id: SeriesTypes.AREA_STACKED, icon: AreaStackedIcon }, + { id: SeriesTypes.AREA_PERCENTAGE_STACKED, icon: AreaPercentageIcon }, +]; diff --git a/src/plugins/chart_expressions/expression_xy/public/expression_renderers/index.ts b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/index.ts new file mode 100644 index 0000000000000..863dbb960512d --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { getXyChartRenderer } from './xy_chart_renderer'; +export type { GetStartDepsFn } from './xy_chart_renderer'; diff --git a/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx new file mode 100644 index 0000000000000..70acc25330b87 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx @@ -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 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 { I18nProvider } from '@kbn/i18n-react'; +import { ThemeServiceStart } from 'kibana/public'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import { ChartsPluginStart, PaletteRegistry } from '../../../../charts/public'; +import { EventAnnotationServiceType } from '../../../../event_annotation/public'; +import { ExpressionRenderDefinition } from '../../../../expressions'; +import { FormatFactory } from '../../../../field_formats/common'; +import { KibanaThemeProvider } from '../../../../kibana_react/public'; +import { XYChartProps } from '../../common'; +import { calculateMinInterval } from '../helpers'; +import { BrushEvent, FilterEvent } from '../types'; + +export type GetStartDepsFn = () => Promise<{ + formatFactory: FormatFactory; + theme: ChartsPluginStart['theme']; + activeCursor: ChartsPluginStart['activeCursor']; + paletteService: PaletteRegistry; + timeZone: string; + useLegacyTimeAxis: boolean; + kibanaTheme: ThemeServiceStart; + eventAnnotationService: EventAnnotationServiceType; +}>; + +interface XyChartRendererDeps { + getStartDeps: GetStartDepsFn; +} + +export const getXyChartRenderer = ({ + getStartDeps, +}: XyChartRendererDeps): ExpressionRenderDefinition => ({ + name: 'xyVis', + displayName: 'XY chart', + help: i18n.translate('expressionXY.xyVis.renderer.help', { + defaultMessage: 'X/Y chart renderer', + }), + validate: () => undefined, + reuseDomNode: true, + render: async (domNode: Element, config: XYChartProps, handlers) => { + handlers.onDestroy(() => ReactDOM.unmountComponentAtNode(domNode)); + const onClickValue = (data: FilterEvent['data']) => { + handlers.event({ name: 'filter', data }); + }; + const onSelectRange = (data: BrushEvent['data']) => { + handlers.event({ name: 'brush', data }); + }; + const deps = await getStartDeps(); + + const { XYChartReportable } = await import('../components/xy_chart'); + + ReactDOM.render( + + +
+ +
{' '} +
+
, + domNode, + () => handlers.done() + ); + }, +}); diff --git a/x-pack/plugins/lens/public/xy_visualization/annotations_helpers.tsx b/src/plugins/chart_expressions/expression_xy/public/helpers/annotations.tsx similarity index 57% rename from x-pack/plugins/lens/public/xy_visualization/annotations_helpers.tsx rename to src/plugins/chart_expressions/expression_xy/public/helpers/annotations.tsx index ddbdfc91f4a3e..8da38af10f5d9 100644 --- a/x-pack/plugins/lens/public/xy_visualization/annotations_helpers.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/annotations.tsx @@ -1,18 +1,13 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ - -import './expression_reference_lines.scss'; -import React from 'react'; -import { EuiFlexGroup, EuiIcon, EuiIconProps, EuiText } from '@elastic/eui'; import { Position } from '@elastic/charts'; -import classnames from 'classnames'; -import type { IconPosition, YAxisMode, YConfig } from '../../common/expressions'; -import { hasIcon } from './xy_config_panel/shared/icon_select'; -import { annotationsIconSet } from './annotations/config_panel/icon_set'; +import type { IconPosition, YAxisMode, YConfig } from '../../common/types'; +import { hasIcon } from './icon'; export const LINES_MARKER_SIZE = 20; @@ -130,124 +125,4 @@ export function getBaseIconPlacement( return Position.Top; } -export function MarkerBody({ - label, - isHorizontal, -}: { - label: string | undefined; - isHorizontal: boolean; -}) { - if (!label) { - return null; - } - if (isHorizontal) { - return ( -
- {label} -
- ); - } - return ( -
-
- {label} -
-
- ); -} - -const isNumericalString = (value: string) => !isNaN(Number(value)); - -function NumberIcon({ number }: { number: number }) { - return ( - - - {number < 10 ? number : `9+`} - - - ); -} - -interface MarkerConfig { - axisMode?: YAxisMode; - icon?: string; - textVisibility?: boolean; - iconPosition?: IconPosition; -} - -export const AnnotationIcon = ({ - type, - rotateClassName = '', - isHorizontal, - renderedInChart, - ...rest -}: { - type: string; - rotateClassName?: string; - isHorizontal?: boolean; - renderedInChart?: boolean; -} & EuiIconProps) => { - if (isNumericalString(type)) { - return ; - } - const iconConfig = annotationsIconSet.find((i) => i.value === type); - if (!iconConfig) { - return null; - } - return ( - - ); -}; - -export function Marker({ - config, - isHorizontal, - hasReducedPadding, - label, - rotateClassName, -}: { - config: MarkerConfig; - isHorizontal: boolean; - hasReducedPadding: boolean; - label?: string; - rotateClassName?: string; -}) { - if (hasIcon(config.icon)) { - return ( - - ); - } - - // if there's some text, check whether to show it as marker, or just show some padding for the icon - if (config.textVisibility) { - if (hasReducedPadding) { - return ; - } - return ; - } - return null; -} +export const isNumericalString = (value: string) => !isNaN(Number(value)); diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/annotations_icon_set.tsx b/src/plugins/chart_expressions/expression_xy/public/helpers/annotations_icon_set.tsx new file mode 100644 index 0000000000000..99b4648e4d556 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/annotations_icon_set.tsx @@ -0,0 +1,101 @@ +/* + * 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 { TriangleIcon, CircleIcon } from '../icons'; + +export const annotationsIconSet = [ + { + value: 'asterisk', + label: i18n.translate('expressionXY.xyChart.iconSelect.asteriskIconLabel', { + defaultMessage: 'Asterisk', + }), + }, + { + value: 'alert', + label: i18n.translate('expressionXY.xyChart.iconSelect.alertIconLabel', { + defaultMessage: 'Alert', + }), + }, + { + value: 'bell', + label: i18n.translate('expressionXY.xyChart.iconSelect.bellIconLabel', { + defaultMessage: 'Bell', + }), + }, + { + value: 'bolt', + label: i18n.translate('expressionXY.xyChart.iconSelect.boltIconLabel', { + defaultMessage: 'Bolt', + }), + }, + { + value: 'bug', + label: i18n.translate('expressionXY.xyChart.iconSelect.bugIconLabel', { + defaultMessage: 'Bug', + }), + }, + { + value: 'circle', + label: i18n.translate('expressionXY.xyChart.iconSelect.circleIconLabel', { + defaultMessage: 'Circle', + }), + icon: CircleIcon, + canFill: true, + }, + + { + value: 'editorComment', + label: i18n.translate('expressionXY.xyChart.iconSelect.commentIconLabel', { + defaultMessage: 'Comment', + }), + }, + { + value: 'flag', + label: i18n.translate('expressionXY.xyChart.iconSelect.flagIconLabel', { + defaultMessage: 'Flag', + }), + }, + { + value: 'heart', + label: i18n.translate('expressionXY.xyChart.iconSelect.heartLabel', { + defaultMessage: 'Heart', + }), + }, + { + value: 'mapMarker', + label: i18n.translate('expressionXY.xyChart.iconSelect.mapMarkerLabel', { + defaultMessage: 'Map Marker', + }), + }, + { + value: 'pinFilled', + label: i18n.translate('expressionXY.xyChart.iconSelect.mapPinLabel', { + defaultMessage: 'Map Pin', + }), + }, + { + value: 'starEmpty', + label: i18n.translate('expressionXY.xyChart.iconSelect.starLabel', { defaultMessage: 'Star' }), + }, + { + value: 'tag', + label: i18n.translate('expressionXY.xyChart.iconSelect.tagIconLabel', { + defaultMessage: 'Tag', + }), + }, + { + value: 'triangle', + label: i18n.translate('expressionXY.xyChart.iconSelect.triangleIconLabel', { + defaultMessage: 'Triangle', + }), + icon: TriangleIcon, + shouldRotate: true, + canFill: true, + }, +]; diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.test.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.test.ts new file mode 100644 index 0000000000000..201b0198087da --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.test.ts @@ -0,0 +1,334 @@ +/* + * 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 { DataLayerConfigResult } from '../../common'; +import { LayerTypes } from '../../common/constants'; +import { Datatable } from '../../../../../plugins/expressions/public'; +import { getAxesConfiguration } from './axes_configuration'; + +describe('axes_configuration', () => { + const tables: Record = { + first: { + type: 'datatable', + rows: [ + { + xAccessorId: 1585758120000, + splitAccessorId: "Men's Clothing", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585758360000, + splitAccessorId: "Women's Accessories", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585758360000, + splitAccessorId: "Women's Clothing", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585759380000, + splitAccessorId: "Men's Clothing", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585759380000, + splitAccessorId: "Men's Shoes", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585759380000, + splitAccessorId: "Women's Clothing", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585760700000, + splitAccessorId: "Men's Clothing", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585760760000, + splitAccessorId: "Men's Clothing", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585760760000, + splitAccessorId: "Men's Shoes", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + { + xAccessorId: 1585761120000, + splitAccessorId: "Men's Shoes", + yAccessorId: 1, + yAccessorId2: 1, + yAccessorId3: 1, + yAccessorId4: 4, + }, + ], + columns: [ + { + id: 'xAccessorId', + name: 'order_date per minute', + meta: { + type: 'date', + field: 'order_date', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'date_histogram', + params: { + field: 'order_date', + timeRange: { from: '2020-04-01T16:14:16.246Z', to: '2020-04-01T17:15:41.263Z' }, + useNormalizedEsInterval: true, + scaleMetricValues: false, + interval: '1m', + drop_partials: false, + min_doc_count: 0, + extended_bounds: {}, + }, + }, + params: { params: { id: 'date', params: { pattern: 'HH:mm' } } }, + }, + }, + { + id: 'splitAccessorId', + name: 'Top values of category.keyword', + meta: { + type: 'string', + field: 'category.keyword', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'terms', + params: { + field: 'category.keyword', + orderBy: 'yAccessorId', + order: 'desc', + size: 3, + otherBucket: false, + otherBucketLabel: 'Other', + missingBucket: false, + missingBucketLabel: 'Missing', + }, + }, + params: { + id: 'terms', + params: { + id: 'string', + otherBucketLabel: 'Other', + missingBucketLabel: 'Missing', + parsedUrl: { + origin: 'http://localhost:5601', + pathname: '/jiy/app/kibana', + basePath: '/jiy', + }, + }, + }, + }, + }, + { + id: 'yAccessorId', + name: 'Count of records', + meta: { + type: 'number', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'count', + }, + params: { id: 'number' }, + }, + }, + { + id: 'yAccessorId2', + name: 'Other column', + meta: { + type: 'number', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'average', + }, + params: { id: 'bytes' }, + }, + }, + { + id: 'yAccessorId3', + name: 'Other column', + meta: { + type: 'number', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'average', + }, + params: { id: 'currency' }, + }, + }, + { + id: 'yAccessorId4', + name: 'Other column', + meta: { + type: 'number', + source: 'esaggs', + index: 'indexPatternId', + sourceParams: { + indexPatternId: 'indexPatternId', + type: 'average', + }, + params: { id: 'currency' }, + }, + }, + ], + }, + }; + + const sampleLayer: DataLayerConfigResult = { + type: 'dataLayer', + layerId: 'first', + layerType: LayerTypes.DATA, + seriesType: 'line', + xAccessor: 'c', + accessors: ['yAccessorId'], + splitAccessor: 'd', + columnToLabel: '{"a": "Label A", "b": "Label B", "d": "Label D"}', + xScaleType: 'ordinal', + yScaleType: 'linear', + isHistogram: false, + palette: { type: 'palette', name: 'default' }, + }; + + it('should map auto series to left axis', () => { + const formatFactory = jest.fn(); + const groups = getAxesConfiguration([sampleLayer], false, tables, formatFactory); + expect(groups.length).toEqual(1); + expect(groups[0].position).toEqual('left'); + expect(groups[0].series[0].accessor).toEqual('yAccessorId'); + expect(groups[0].series[0].layer).toEqual('first'); + }); + + it('should map auto series to right axis if formatters do not match', () => { + const formatFactory = jest.fn(); + const twoSeriesLayer = { ...sampleLayer, accessors: ['yAccessorId', 'yAccessorId2'] }; + const groups = getAxesConfiguration([twoSeriesLayer], false, tables, formatFactory); + expect(groups.length).toEqual(2); + expect(groups[0].position).toEqual('left'); + expect(groups[1].position).toEqual('right'); + expect(groups[0].series[0].accessor).toEqual('yAccessorId'); + expect(groups[1].series[0].accessor).toEqual('yAccessorId2'); + }); + + it('should map auto series to left if left and right are already filled with non-matching series', () => { + const formatFactory = jest.fn(); + const threeSeriesLayer = { + ...sampleLayer, + accessors: ['yAccessorId', 'yAccessorId2', 'yAccessorId3'], + }; + const groups = getAxesConfiguration([threeSeriesLayer], false, tables, formatFactory); + expect(groups.length).toEqual(2); + expect(groups[0].position).toEqual('left'); + expect(groups[1].position).toEqual('right'); + expect(groups[0].series[0].accessor).toEqual('yAccessorId'); + expect(groups[0].series[1].accessor).toEqual('yAccessorId3'); + expect(groups[1].series[0].accessor).toEqual('yAccessorId2'); + }); + + it('should map right series to right axis', () => { + const formatFactory = jest.fn(); + const groups = getAxesConfiguration( + [ + { + ...sampleLayer, + yConfig: [{ type: 'yConfig', forAccessor: 'yAccessorId', axisMode: 'right' }], + }, + ], + false, + tables, + formatFactory + ); + expect(groups.length).toEqual(1); + expect(groups[0].position).toEqual('right'); + expect(groups[0].series[0].accessor).toEqual('yAccessorId'); + expect(groups[0].series[0].layer).toEqual('first'); + }); + + it('should map series with matching formatters to same axis', () => { + const formatFactory = jest.fn(); + const groups = getAxesConfiguration( + [ + { + ...sampleLayer, + accessors: ['yAccessorId', 'yAccessorId3', 'yAccessorId4'], + yConfig: [{ type: 'yConfig', forAccessor: 'yAccessorId', axisMode: 'right' }], + }, + ], + false, + tables, + formatFactory + ); + expect(groups.length).toEqual(2); + expect(groups[0].position).toEqual('left'); + expect(groups[0].series[0].accessor).toEqual('yAccessorId3'); + expect(groups[0].series[1].accessor).toEqual('yAccessorId4'); + expect(groups[1].position).toEqual('right'); + expect(groups[1].series[0].accessor).toEqual('yAccessorId'); + expect(formatFactory).toHaveBeenCalledWith({ id: 'number' }); + expect(formatFactory).toHaveBeenCalledWith({ id: 'currency' }); + }); + + it('should create one formatter per series group', () => { + const formatFactory = jest.fn(); + getAxesConfiguration( + [ + { + ...sampleLayer, + accessors: ['yAccessorId', 'yAccessorId3', 'yAccessorId4'], + yConfig: [{ type: 'yConfig', forAccessor: 'yAccessorId', axisMode: 'right' }], + }, + ], + false, + tables, + formatFactory + ); + expect(formatFactory).toHaveBeenCalledTimes(2); + expect(formatFactory).toHaveBeenCalledWith({ id: 'number' }); + expect(formatFactory).toHaveBeenCalledWith({ id: 'currency' }); + }); +}); diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.ts new file mode 100644 index 0000000000000..16529ecd40e90 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/axes_configuration.ts @@ -0,0 +1,146 @@ +/* + * 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 { FormatFactory } from '../types'; +import { AxisExtentConfig, DataLayerConfigResult } from '../../common'; +import { Datatable } from '../../../../../plugins/expressions/public'; +import type { + IFieldFormat, + SerializedFieldFormat, +} from '../../../../../plugins/field_formats/common'; + +interface FormattedMetric { + layer: string; + accessor: string; + fieldFormat: SerializedFieldFormat; +} + +export type GroupsConfiguration = Array<{ + groupId: string; + position: 'left' | 'right' | 'bottom' | 'top'; + formatter?: IFieldFormat; + series: Array<{ layer: string; accessor: string }>; +}>; + +export function isFormatterCompatible( + formatter1: SerializedFieldFormat, + formatter2: SerializedFieldFormat +) { + return formatter1.id === formatter2.id; +} + +export function groupAxesByType( + layers: DataLayerConfigResult[], + tables?: Record +) { + const series: { + auto: FormattedMetric[]; + left: FormattedMetric[]; + right: FormattedMetric[]; + bottom: FormattedMetric[]; + } = { + auto: [], + left: [], + right: [], + bottom: [], + }; + + layers?.forEach((layer) => { + const table = tables?.[layer.layerId]; + layer.accessors.forEach((accessor) => { + const mode = + layer.yConfig?.find((yAxisConfig) => yAxisConfig.forAccessor === accessor)?.axisMode || + 'auto'; + let formatter: SerializedFieldFormat = table?.columns.find((column) => column.id === accessor) + ?.meta?.params || { id: 'number' }; + if (layer.seriesType.includes('percentage') && formatter.id !== 'percent') { + formatter = { + id: 'percent', + params: { + pattern: '0.[00]%', + }, + }; + } + series[mode].push({ + layer: layer.layerId, + accessor, + fieldFormat: formatter, + }); + }); + }); + + series.auto.forEach((currentSeries) => { + if ( + series.left.length === 0 || + (tables && + series.left.every((leftSeries) => + isFormatterCompatible(leftSeries.fieldFormat, currentSeries.fieldFormat) + )) + ) { + series.left.push(currentSeries); + } else if ( + series.right.length === 0 || + (tables && + series.left.every((leftSeries) => + isFormatterCompatible(leftSeries.fieldFormat, currentSeries.fieldFormat) + )) + ) { + series.right.push(currentSeries); + } else if (series.right.length >= series.left.length) { + series.left.push(currentSeries); + } else { + series.right.push(currentSeries); + } + }); + return series; +} + +export function getAxesConfiguration( + layers: DataLayerConfigResult[], + shouldRotate: boolean, + tables?: Record, + formatFactory?: FormatFactory +): GroupsConfiguration { + const series = groupAxesByType(layers, tables); + + const axisGroups: GroupsConfiguration = []; + + if (series.left.length > 0) { + axisGroups.push({ + groupId: 'left', + position: shouldRotate ? 'bottom' : 'left', + formatter: formatFactory?.(series.left[0].fieldFormat), + series: series.left.map(({ fieldFormat, ...currentSeries }) => currentSeries), + }); + } + + if (series.right.length > 0) { + axisGroups.push({ + groupId: 'right', + position: shouldRotate ? 'top' : 'right', + formatter: formatFactory?.(series.right[0].fieldFormat), + series: series.right.map(({ fieldFormat, ...currentSeries }) => currentSeries), + }); + } + + return axisGroups; +} + +export function validateExtent(hasBarOrArea: boolean, extent?: AxisExtentConfig) { + const inclusiveZeroError = + extent && + hasBarOrArea && + ((extent.lowerBound !== undefined && extent.lowerBound > 0) || + (extent.upperBound !== undefined && extent.upperBound) < 0); + const boundaryError = + extent && + extent.lowerBound !== undefined && + extent.upperBound !== undefined && + extent.upperBound <= extent.lowerBound; + return { inclusiveZeroError, boundaryError }; +} diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.test.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.test.ts new file mode 100644 index 0000000000000..bd13e3217c2af --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.test.ts @@ -0,0 +1,239 @@ +/* + * 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 { getColorAssignments } from './color_assignment'; +import type { DataLayerConfigResult, LensMultiTable } from '../../common'; +import type { FormatFactory } from '../types'; +import { LayerTypes } from '../../common/constants'; + +describe('color_assignment', () => { + const layers: DataLayerConfigResult[] = [ + { + type: 'dataLayer', + yScaleType: 'linear', + xScaleType: 'linear', + isHistogram: true, + seriesType: 'bar', + palette: { type: 'palette', name: 'palette1' }, + layerId: '1', + layerType: LayerTypes.DATA, + splitAccessor: 'split1', + accessors: ['y1', 'y2'], + }, + { + type: 'dataLayer', + yScaleType: 'linear', + xScaleType: 'linear', + isHistogram: true, + seriesType: 'bar', + palette: { type: 'palette', name: 'palette2' }, + layerId: '2', + layerType: LayerTypes.DATA, + splitAccessor: 'split2', + accessors: ['y3', 'y4'], + }, + ]; + + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + '1': { + type: 'datatable', + columns: [ + { id: 'split1', name: '', meta: { type: 'number' } }, + { id: 'y1', name: '', meta: { type: 'number' } }, + { id: 'y2', name: '', meta: { type: 'number' } }, + ], + rows: [ + { split1: 1 }, + { split1: 2 }, + { split1: 3 }, + { split1: 1 }, + { split1: 2 }, + { split1: 3 }, + ], + }, + '2': { + type: 'datatable', + columns: [ + { id: 'split2', name: '', meta: { type: 'number' } }, + { id: 'y1', name: '', meta: { type: 'number' } }, + { id: 'y2', name: '', meta: { type: 'number' } }, + ], + rows: [ + { split2: 1 }, + { split2: 2 }, + { split2: 3 }, + { split2: 1 }, + { split2: 2 }, + { split2: 3 }, + ], + }, + }, + }; + + const formatFactory = (() => + ({ + convert(x: unknown) { + return x; + }, + } as unknown)) as FormatFactory; + + describe('totalSeriesCount', () => { + it('should calculate total number of series per palette', () => { + const assignments = getColorAssignments(layers, data, formatFactory); + // two y accessors, with 3 splitted series + expect(assignments.palette1.totalSeriesCount).toEqual(2 * 3); + expect(assignments.palette2.totalSeriesCount).toEqual(2 * 3); + }); + + it('should calculate total number of series spanning multible layers', () => { + const assignments = getColorAssignments( + [layers[0], { ...layers[1], palette: layers[0].palette }], + data, + formatFactory + ); + // two y accessors, with 3 splitted series, two times + expect(assignments.palette1.totalSeriesCount).toEqual(2 * 3 + 2 * 3); + expect(assignments.palette2).toBeUndefined(); + }); + + it('should calculate total number of series for non split series', () => { + const assignments = getColorAssignments( + [layers[0], { ...layers[1], palette: layers[0].palette, splitAccessor: undefined }], + data, + formatFactory + ); + // two y accessors, with 3 splitted series for the first layer, 2 non splitted y accessors for the second layer + expect(assignments.palette1.totalSeriesCount).toEqual(2 * 3 + 2); + expect(assignments.palette2).toBeUndefined(); + }); + + it('should format non-primitive values and count them correctly', () => { + const complexObject = { aProp: 123 }; + const formatMock = jest.fn((x) => 'formatted'); + const assignments = getColorAssignments( + layers, + { + ...data, + tables: { + ...data.tables, + '1': { ...data.tables['1'], rows: [{ split1: complexObject }, { split1: 'abc' }] }, + }, + }, + (() => + ({ + convert: formatMock, + } as unknown)) as FormatFactory + ); + expect(assignments.palette1.totalSeriesCount).toEqual(2 * 2); + expect(assignments.palette2.totalSeriesCount).toEqual(2 * 3); + expect(formatMock).toHaveBeenCalledWith(complexObject); + }); + + it('should handle missing tables', () => { + const assignments = getColorAssignments(layers, { ...data, tables: {} }, formatFactory); + // if there is no data, just assume a single split + expect(assignments.palette1.totalSeriesCount).toEqual(2); + }); + + it('should handle missing columns', () => { + const assignments = getColorAssignments( + layers, + { + ...data, + tables: { + ...data.tables, + '1': { + ...data.tables['1'], + columns: [], + }, + }, + }, + formatFactory + ); + // if the split column is missing, just assume a single split + expect(assignments.palette1.totalSeriesCount).toEqual(2); + }); + }); + + describe('getRank', () => { + it('should return the correct rank for a series key', () => { + const assignments = getColorAssignments(layers, data, formatFactory); + // 3 series in front of 2/y2 - 1/y1, 1/y2 and 2/y1 + expect(assignments.palette1.getRank(layers[0], '2', 'y2')).toEqual(3); + // 1 series in front of 1/y4 - 1/y3 + expect(assignments.palette2.getRank(layers[1], '1', 'y4')).toEqual(1); + }); + + it('should return the correct rank for a series key spanning multiple layers', () => { + const newLayers = [layers[0], { ...layers[1], palette: layers[0].palette }]; + const assignments = getColorAssignments(newLayers, data, formatFactory); + // 3 series in front of 2/y2 - 1/y1, 1/y2 and 2/y1 + expect(assignments.palette1.getRank(newLayers[0], '2', 'y2')).toEqual(3); + // 2 series in front for the current layer (1/y3, 1/y4), plus all 6 series from the first layer + expect(assignments.palette1.getRank(newLayers[1], '2', 'y3')).toEqual(8); + }); + + it('should return the correct rank for a series without a split', () => { + const newLayers = [ + layers[0], + { ...layers[1], palette: layers[0].palette, splitAccessor: undefined }, + ]; + const assignments = getColorAssignments(newLayers, data, formatFactory); + // 3 series in front of 2/y2 - 1/y1, 1/y2 and 2/y1 + expect(assignments.palette1.getRank(newLayers[0], '2', 'y2')).toEqual(3); + // 1 series in front for the current layer (y3), plus all 6 series from the first layer + expect(assignments.palette1.getRank(newLayers[1], 'Metric y4', 'y4')).toEqual(7); + }); + + it('should return the correct rank for a series with a non-primitive value', () => { + const assignments = getColorAssignments( + layers, + { + ...data, + tables: { + ...data.tables, + '1': { ...data.tables['1'], rows: [{ split1: 'abc' }, { split1: { aProp: 123 } }] }, + }, + }, + (() => + ({ + convert: () => 'formatted', + } as unknown)) as FormatFactory + ); + // 3 series in front of (complex object)/y1 - abc/y1, abc/y2 + expect(assignments.palette1.getRank(layers[0], 'formatted', 'y1')).toEqual(2); + }); + + it('should handle missing tables', () => { + const assignments = getColorAssignments(layers, { ...data, tables: {} }, formatFactory); + // if there is no data, assume it is the first splitted series. One series in front - 0/y1 + expect(assignments.palette1.getRank(layers[0], '2', 'y2')).toEqual(1); + }); + + it('should handle missing columns', () => { + const assignments = getColorAssignments( + layers, + { + ...data, + tables: { + ...data.tables, + '1': { + ...data.tables['1'], + columns: [], + }, + }, + }, + formatFactory + ); + // if the split column is missing, assume it is the first splitted series. One series in front - 0/y1 + expect(assignments.palette1.getRank(layers[0], '2', 'y2')).toEqual(1); + }); + }); +}); diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts new file mode 100644 index 0000000000000..ef0cd36e3598e --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/color_assignment.ts @@ -0,0 +1,93 @@ +/* + * 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 { uniq, mapValues } from 'lodash'; +import { euiLightVars } from '@kbn/ui-theme'; +import type { Datatable } from '../../../../expressions'; +import { FormatFactory } from '../types'; +import { isDataLayer } from './visualization'; +import { DataLayerConfigResult, XYLayerConfigResult } from '../../common'; + +const isPrimitive = (value: unknown): boolean => value != null && typeof value !== 'object'; + +export const defaultReferenceLineColor = euiLightVars.euiColorDarkShade; + +export type ColorAssignments = Record< + string, + { + totalSeriesCount: number; + getRank(sortedLayer: DataLayerConfigResult, seriesKey: string, yAccessor: string): number; + } +>; + +export function getColorAssignments( + layers: XYLayerConfigResult[], + data: { tables: Record }, + formatFactory: FormatFactory +): ColorAssignments { + const layersPerPalette: Record = {}; + + layers + .filter((layer): layer is DataLayerConfigResult => isDataLayer(layer)) + .forEach((layer) => { + const palette = layer.palette?.name || 'default'; + if (!layersPerPalette[palette]) { + layersPerPalette[palette] = []; + } + layersPerPalette[palette].push(layer); + }); + + return mapValues(layersPerPalette, (paletteLayers) => { + const seriesPerLayer = paletteLayers.map((layer, layerIndex) => { + if (!layer.splitAccessor) { + return { numberOfSeries: layer.accessors.length, splits: [] }; + } + const splitAccessor = layer.splitAccessor; + const column = data.tables[layer.layerId]?.columns.find(({ id }) => id === splitAccessor); + const columnFormatter = column && formatFactory(column.meta.params); + const splits = + !column || !data.tables[layer.layerId] + ? [] + : uniq( + data.tables[layer.layerId].rows.map((row) => { + let value = row[splitAccessor]; + if (value && !isPrimitive(value)) { + value = columnFormatter?.convert(value) ?? value; + } else { + value = String(value); + } + return value; + }) + ); + return { numberOfSeries: (splits.length || 1) * layer.accessors.length, splits }; + }); + const totalSeriesCount = seriesPerLayer.reduce( + (sum, perLayer) => sum + perLayer.numberOfSeries, + 0 + ); + return { + totalSeriesCount, + getRank(sortedLayer: DataLayerConfigResult, seriesKey: string, yAccessor: string) { + const layerIndex = paletteLayers.findIndex((l) => sortedLayer.layerId === l.layerId); + const currentSeriesPerLayer = seriesPerLayer[layerIndex]; + const splitRank = currentSeriesPerLayer.splits.indexOf(seriesKey); + return ( + (layerIndex === 0 + ? 0 + : seriesPerLayer + .slice(0, layerIndex) + .reduce((sum, perLayer) => sum + perLayer.numberOfSeries, 0)) + + (sortedLayer.splitAccessor && splitRank !== -1 + ? splitRank * sortedLayer.accessors.length + : 0) + + sortedLayer.accessors.indexOf(yAccessor) + ); + }, + }; + }); +} diff --git a/x-pack/plugins/lens/public/xy_visualization/fitting_functions.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/fitting_functions.ts similarity index 74% rename from x-pack/plugins/lens/public/xy_visualization/fitting_functions.ts rename to src/plugins/chart_expressions/expression_xy/public/helpers/fitting_functions.ts index 63a3b308d8ae8..43d5ad9b4c19f 100644 --- a/x-pack/plugins/lens/public/xy_visualization/fitting_functions.ts +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/fitting_functions.ts @@ -1,12 +1,13 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Fit } from '@elastic/charts'; -import { EndValue, FittingFunction } from '../../common/expressions'; +import { EndValue, FittingFunction } from '../../common'; export function getFitEnum(fittingFunction?: FittingFunction | EndValue) { if (fittingFunction) { diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/icon.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/icon.ts new file mode 100644 index 0000000000000..57e285a07232f --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/icon.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export function hasIcon(icon: string | undefined): icon is string { + return icon != null && icon !== 'empty'; +} diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/index.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/index.ts new file mode 100644 index 0000000000000..cb0300e47ae70 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './interval'; +export * from './layers'; +export * from './state'; +export * from './visualization'; +export * from './fitting_functions'; +export * from './axes_configuration'; +export * from './reference_lines'; +export * from './icon'; +export * from './color_assignment'; +export * from './annotations_icon_set'; +export * from './annotations'; diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/interval.test.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/interval.test.ts new file mode 100644 index 0000000000000..0fe979b8c3fc1 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/interval.test.ts @@ -0,0 +1,80 @@ +/* + * 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 { DataLayerConfigResult, XYChartProps } from '../../common'; +import { sampleArgs } from '../../common/__mocks__'; +import { calculateMinInterval } from './interval'; + +describe('calculateMinInterval', () => { + let xyProps: XYChartProps; + + beforeEach(() => { + xyProps = sampleArgs(); + (xyProps.args.layers[0] as DataLayerConfigResult).xScaleType = 'time'; + }); + it('should use first valid layer and determine interval', async () => { + xyProps.data.tables.first.columns[2].meta.source = 'esaggs'; + xyProps.data.tables.first.columns[2].meta.sourceParams = { + type: 'date_histogram', + params: { + used_interval: '5m', + }, + }; + const result = await calculateMinInterval(xyProps); + expect(result).toEqual(5 * 60 * 1000); + }); + + it('should return interval of number histogram if available on first x axis columns', async () => { + (xyProps.args.layers[0] as DataLayerConfigResult).xScaleType = 'linear'; + xyProps.data.tables.first.columns[2].meta = { + source: 'esaggs', + type: 'number', + field: 'someField', + sourceParams: { + type: 'histogram', + params: { + interval: 'auto', + used_interval: 5, + }, + }, + }; + const result = await calculateMinInterval(xyProps); + expect(result).toEqual(5); + }); + + it('should return undefined if data table is empty', async () => { + xyProps.data.tables.first.rows = []; + xyProps.data.tables.first.columns[2].meta.source = 'esaggs'; + xyProps.data.tables.first.columns[2].meta.sourceParams = { + type: 'date_histogram', + params: { + used_interval: '5m', + }, + }; + const result = await calculateMinInterval(xyProps); + expect(result).toEqual(undefined); + }); + + it('should return undefined if interval can not be checked', async () => { + const result = await calculateMinInterval(xyProps); + expect(result).toEqual(undefined); + }); + + it('should return undefined if date column is not found', async () => { + xyProps.data.tables.first.columns.splice(2, 1); + const result = await calculateMinInterval(xyProps); + expect(result).toEqual(undefined); + }); + + it('should return undefined if x axis is not a date', async () => { + (xyProps.args.layers[0] as DataLayerConfigResult).xScaleType = 'ordinal'; + xyProps.data.tables.first.columns.splice(2, 1); + const result = await calculateMinInterval(xyProps); + expect(result).toEqual(undefined); + }); +}); diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/interval.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/interval.ts new file mode 100644 index 0000000000000..7e15b49c311d4 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/interval.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { search } from '../../../../data/public'; +import { XYChartProps } from '../../common'; +import { getFilteredLayers } from './layers'; +import { isDataLayer } from './visualization'; + +export function calculateMinInterval({ args: { layers }, data }: XYChartProps) { + const filteredLayers = getFilteredLayers(layers, data); + if (filteredLayers.length === 0) return; + const isTimeViz = filteredLayers.every((l) => isDataLayer(l) && l.xScaleType === 'time'); + const xColumn = data.tables[filteredLayers[0].layerId].columns.find( + (column) => isDataLayer(filteredLayers[0]) && column.id === filteredLayers[0].xAccessor + ); + + if (!xColumn) return; + if (!isTimeViz) { + const histogramInterval = search.aggs.getNumberHistogramIntervalByDatatableColumn(xColumn); + if (typeof histogramInterval === 'number') { + return histogramInterval; + } else { + return undefined; + } + } + const dateInterval = search.aggs.getDateHistogramMetaDataByDatatableColumn(xColumn)?.interval; + if (!dateInterval) return; + const intervalDuration = search.aggs.parseInterval(dateInterval); + if (!intervalDuration) return; + return intervalDuration.as('milliseconds'); +} diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/layers.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/layers.ts new file mode 100644 index 0000000000000..be1701e6b6e4b --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/layers.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 { LensMultiTable } from '../../common'; +import { DataLayerConfigResult, XYLayerConfigResult } from '../../common/types'; +import { getDataLayers } from './visualization'; + +export function getFilteredLayers(layers: XYLayerConfigResult[], data: LensMultiTable) { + return getDataLayers(layers).filter( + (layer): layer is DataLayerConfigResult => { + const { layerId, xAccessor, accessors, splitAccessor } = layer; + return !( + !accessors.length || + !data.tables[layerId] || + data.tables[layerId].rows.length === 0 || + (xAccessor && + data.tables[layerId].rows.every((row) => typeof row[xAccessor] === 'undefined')) || + // stacked percentage bars have no xAccessors but splitAccessor with undefined values in them when empty + (!xAccessor && + splitAccessor && + data.tables[layerId].rows.every((row) => typeof row[splitAccessor] === 'undefined')) + ); + } + ); +} diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/reference_lines.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/reference_lines.ts new file mode 100644 index 0000000000000..35419c3a40558 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/reference_lines.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 { partition } from 'lodash'; +import { Datatable } from '../../../../expressions'; +import type { DataLayerConfigResult } from '../../common'; +import { isStackedChart } from './state'; + +export function computeOverallDataDomain( + dataLayers: DataLayerConfigResult[], + accessorIds: string[], + activeData: Record, + allowStacking: boolean = true +) { + const accessorMap = new Set(accessorIds); + let min: number | undefined; + let max: number | undefined; + const [stacked, unstacked] = partition( + dataLayers, + ({ seriesType }) => isStackedChart(seriesType) && allowStacking + ); + for (const { layerId, accessors } of unstacked) { + const table = activeData[layerId]; + if (table) { + for (const accessor of accessors) { + if (accessorMap.has(accessor)) { + for (const row of table.rows) { + const value = row[accessor]; + if (typeof value === 'number') { + // when not stacked, do not keep the 0 + max = max != null ? Math.max(value, max) : value; + min = min != null ? Math.min(value, min) : value; + } + } + } + } + } + } + // stacked can span multiple layers, so compute an overall max/min by bucket + const stackedResults: Record = {}; + for (const { layerId, accessors, xAccessor } of stacked) { + const table = activeData[layerId]; + if (table) { + for (const accessor of accessors) { + if (accessorMap.has(accessor)) { + for (const row of table.rows) { + const value = row[accessor]; + // start with a shared bucket + let bucket = 'shared'; + // but if there's an xAccessor use it as new bucket system + if (xAccessor) { + bucket = row[xAccessor]; + } + if (typeof value === 'number') { + stackedResults[bucket] = stackedResults[bucket] ?? 0; + stackedResults[bucket] += value; + } + } + } + } + } + } + + for (const value of Object.values(stackedResults)) { + // for stacked extents keep 0 in view + max = Math.max(value, max || 0, 0); + min = Math.min(value, min || 0, 0); + } + + return { min, max }; +} diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/state.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/state.ts new file mode 100644 index 0000000000000..a5cd66f178b63 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/state.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { SeriesType, XYLayerConfigResult, YConfig } from '../../common'; +import { getDataLayers, isAnnotationsLayer, isDataLayer } from './visualization'; + +export function isHorizontalSeries(seriesType: SeriesType) { + return ( + seriesType === 'bar_horizontal' || + seriesType === 'bar_horizontal_stacked' || + seriesType === 'bar_horizontal_percentage_stacked' + ); +} + +export function isStackedChart(seriesType: SeriesType) { + return seriesType.includes('stacked'); +} + +export function isHorizontalChart(layers: XYLayerConfigResult[]) { + return getDataLayers(layers).every((l) => isHorizontalSeries(l.seriesType)); +} + +export const getSeriesColor = (layer: XYLayerConfigResult, accessor: string) => { + if ((isDataLayer(layer) && layer.splitAccessor) || isAnnotationsLayer(layer)) { + return null; + } + + return ( + layer?.yConfig?.find((yConfig: YConfig) => yConfig.forAccessor === accessor)?.color || null + ); +}; diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/visualization.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/visualization.ts new file mode 100644 index 0000000000000..af2e80948ffdf --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/visualization.ts @@ -0,0 +1,43 @@ +/* + * 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 { + DataLayerConfigResult, + ReferenceLineLayerConfigResult, + XYLayerConfigResult, + AnnotationLayerConfigResult, +} from '../../common/types'; +import { LayerTypes } from '../../common/constants'; + +export const isDataLayer = (layer: XYLayerConfigResult): layer is DataLayerConfigResult => + layer.layerType === LayerTypes.DATA || !layer.layerType; + +export const getDataLayers = (layers: XYLayerConfigResult[]) => + (layers || []).filter((layer): layer is DataLayerConfigResult => isDataLayer(layer)); + +export const isReferenceLayer = ( + layer: XYLayerConfigResult +): layer is ReferenceLineLayerConfigResult => layer.layerType === LayerTypes.REFERENCELINE; + +export const getReferenceLayers = (layers: XYLayerConfigResult[]) => + (layers || []).filter((layer): layer is ReferenceLineLayerConfigResult => + isReferenceLayer(layer) + ); + +const isAnnotationLayerCommon = ( + layer: XYLayerConfigResult +): layer is AnnotationLayerConfigResult => layer.layerType === LayerTypes.ANNOTATIONS; + +export const isAnnotationsLayer = ( + layer: XYLayerConfigResult +): layer is AnnotationLayerConfigResult => isAnnotationLayerCommon(layer); + +export const getAnnotationsLayers = ( + layers: XYLayerConfigResult[] +): AnnotationLayerConfigResult[] => + (layers || []).filter((layer): layer is AnnotationLayerConfigResult => isAnnotationsLayer(layer)); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/area.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/area.tsx new file mode 100644 index 0000000000000..010ffaf1fb7ec --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/area.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const AreaIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/area_percentage.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/area_percentage.tsx new file mode 100644 index 0000000000000..a51e66b68ba93 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/area_percentage.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const AreaPercentageIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/area_stacked.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/area_stacked.tsx new file mode 100644 index 0000000000000..c2b9fbe926328 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/area_stacked.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const AreaStackedIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/bar.tsx new file mode 100644 index 0000000000000..f134d7871bfde --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/bar.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const BarIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal.tsx new file mode 100644 index 0000000000000..a2fb843cb095d --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const BarHorizontalIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_percentage.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_percentage.tsx new file mode 100644 index 0000000000000..6b2bb61a246e1 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_percentage.tsx @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const BarHorizontalPercentageIcon = ({ + title, + titleId, + ...props +}: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_stacked.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_stacked.tsx new file mode 100644 index 0000000000000..b399c47d3fc7d --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/bar_horizontal_stacked.tsx @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const BarHorizontalStackedIcon = ({ + title, + titleId, + ...props +}: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_percentage.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/bar_percentage.tsx new file mode 100644 index 0000000000000..64514cea6c012 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/bar_percentage.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const BarPercentageIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_reference_line.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/bar_reference_line.tsx new file mode 100644 index 0000000000000..95bd8e2a8d0a2 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/bar_reference_line.tsx @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const BarReferenceLineIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/bar_stacked.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/bar_stacked.tsx new file mode 100644 index 0000000000000..833f3d0e816e6 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/bar_stacked.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const BarStackedIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/circle.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/circle.tsx new file mode 100644 index 0000000000000..39bbe5cde74de --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/circle.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; +import classnames from 'classnames'; + +export const CircleIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/index.ts b/src/plugins/chart_expressions/expression_xy/public/icons/index.ts new file mode 100644 index 0000000000000..4ca0b640a3d89 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/index.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { BarHorizontalPercentageIcon } from './bar_horizontal_percentage'; +export { BarHorizontalStackedIcon } from './bar_horizontal_stacked'; +export { BarReferenceLineIcon } from './bar_reference_line'; +export { AreaPercentageIcon } from './area_percentage'; +export { BarHorizontalIcon } from './bar_horizontal'; +export { BarPercentageIcon } from './bar_percentage'; +export { AreaStackedIcon } from './area_stacked'; +export { BarStackedIcon } from './bar_stacked'; +export { TriangleIcon } from './triangle'; +export { MixedXyIcon } from './mixed_xy'; +export { CircleIcon } from './circle'; +export { AreaIcon } from './area'; +export { LineIcon } from './line'; +export { BarIcon } from './bar'; diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/line.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/line.tsx new file mode 100644 index 0000000000000..6735f58b734ec --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/line.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const LineIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/mixed_xy.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/mixed_xy.tsx new file mode 100644 index 0000000000000..e16b7f6bed76f --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/mixed_xy.tsx @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; + +export const MixedXyIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/icons/triangle.tsx b/src/plugins/chart_expressions/expression_xy/public/icons/triangle.tsx new file mode 100644 index 0000000000000..8ffb8c490d9a4 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/icons/triangle.tsx @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiIconProps } from '@elastic/eui'; +import classnames from 'classnames'; + +export const TriangleIcon = ({ title, titleId, ...props }: Omit) => ( + + {title ? {title} : null} + + +); diff --git a/src/plugins/chart_expressions/expression_xy/public/index.ts b/src/plugins/chart_expressions/expression_xy/public/index.ts new file mode 100755 index 0000000000000..d9447400aa266 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ExpressionXyPlugin } from './plugin'; + +// This exports static code and TypeScript types, +// as well as, Kibana Platform `plugin()` initializer. +export function plugin() { + return new ExpressionXyPlugin(); +} + +export type { ExpressionXyPluginSetup, ExpressionXyPluginStart } from './types'; diff --git a/src/plugins/chart_expressions/expression_xy/public/plugin.ts b/src/plugins/chart_expressions/expression_xy/public/plugin.ts new file mode 100755 index 0000000000000..c43e3aae11de7 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/plugin.ts @@ -0,0 +1,99 @@ +/* + * 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 moment from 'moment'; +import { LEGACY_TIME_AXIS } from '../../../charts/common'; +import { DataPublicPluginStart } from '../../../data/public'; +import { FieldFormatsStart } from '../../../field_formats/public'; +import { ChartsPluginStart } from '../../../charts/public'; +import { CoreSetup, CoreStart, IUiSettingsClient } from '../../../../core/public'; +import { ExpressionXyPluginSetup, ExpressionXyPluginStart, SetupDeps } from './types'; +import { + xyVisFunction, + yAxisConfigFunction, + legendConfigFunction, + gridlinesConfigFunction, + dataLayerConfigFunction, + axisExtentConfigFunction, + tickLabelsConfigFunction, + annotationLayerConfigFunction, + labelsOrientationConfigFunction, + referenceLineLayerConfigFunction, + axisTitlesVisibilityConfigFunction, +} from '../common'; +import { GetStartDepsFn, getXyChartRenderer } from './expression_renderers'; +import { EventAnnotationPluginSetup } from '../../../event_annotation/public'; + +export interface XYPluginStartDependencies { + data: DataPublicPluginStart; + fieldFormats: FieldFormatsStart; + charts: ChartsPluginStart; + eventAnnotation: EventAnnotationPluginSetup; +} + +export function getTimeZone(uiSettings: IUiSettingsClient) { + const configuredTimeZone = uiSettings.get('dateFormat:tz'); + if (configuredTimeZone === 'Browser') { + return moment.tz.guess(); + } + + return configuredTimeZone; +} + +export class ExpressionXyPlugin { + public setup( + core: CoreSetup, + { expressions, charts }: SetupDeps + ): ExpressionXyPluginSetup { + expressions.registerFunction(yAxisConfigFunction); + expressions.registerFunction(legendConfigFunction); + expressions.registerFunction(gridlinesConfigFunction); + expressions.registerFunction(dataLayerConfigFunction); + expressions.registerFunction(axisExtentConfigFunction); + expressions.registerFunction(tickLabelsConfigFunction); + expressions.registerFunction(annotationLayerConfigFunction); + expressions.registerFunction(labelsOrientationConfigFunction); + expressions.registerFunction(referenceLineLayerConfigFunction); + expressions.registerFunction(axisTitlesVisibilityConfigFunction); + expressions.registerFunction(xyVisFunction); + + const getStartDeps: GetStartDepsFn = async () => { + const [coreStart, deps] = await core.getStartServices(); + const { + data, + fieldFormats, + eventAnnotation, + charts: { activeCursor, theme, palettes }, + } = deps; + + const paletteService = await palettes.getPalettes(); + + const { theme: kibanaTheme } = coreStart; + const eventAnnotationService = await eventAnnotation.getService(); + const useLegacyTimeAxis = core.uiSettings.get(LEGACY_TIME_AXIS); + + return { + data, + formatFactory: fieldFormats.deserialize, + kibanaTheme, + theme, + activeCursor, + paletteService, + useLegacyTimeAxis, + eventAnnotationService, + timeZone: getTimeZone(core.uiSettings), + }; + }; + + expressions.registerRenderer(getXyChartRenderer({ getStartDeps })); + } + + public start(core: CoreStart): ExpressionXyPluginStart {} + + public stop() {} +} diff --git a/src/plugins/chart_expressions/expression_xy/public/types.ts b/src/plugins/chart_expressions/expression_xy/public/types.ts new file mode 100755 index 0000000000000..36b8f4c13a776 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/public/types.ts @@ -0,0 +1,116 @@ +/* + * 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 { IconType } from '@elastic/eui'; +import { DataPublicPluginSetup } from '../../../data/public'; +import { FieldFormatsSetup } from '../../../field_formats/public'; +import { ChartsPluginSetup } from '../../../charts/public'; +import { IFieldFormat, SerializedFieldFormat } from '../../../../plugins/field_formats/common'; +import type { RangeSelectContext, ValueClickContext } from '../../../../plugins/embeddable/public'; +import { ExpressionsServiceStart, ExpressionsSetup } from '../../../expressions/public'; + +export interface SetupDeps { + expressions: ExpressionsSetup; + data: DataPublicPluginSetup; + fieldFormats: FieldFormatsSetup; + charts: ChartsPluginSetup; +} + +export interface StartDeps { + expression: ExpressionsServiceStart; +} + +export type ExpressionXyPluginSetup = void; +export type ExpressionXyPluginStart = void; + +export interface FilterEvent { + name: 'filter'; + data: ValueClickContext['data']; +} + +export interface BrushEvent { + name: 'brush'; + data: RangeSelectContext['data']; +} + +export type FormatFactory = (mapping?: SerializedFieldFormat) => IFieldFormat; + +export interface OperationDescriptor extends Operation { + hasTimeShift: boolean; +} + +export type SortingHint = 'version'; +export type FieldOnlyDataType = 'document' | 'ip' | 'histogram' | 'geo_point' | 'geo_shape'; +export type DataType = 'string' | 'number' | 'date' | 'boolean' | FieldOnlyDataType; + +export interface OperationMetadata { + // The output of this operation will have this data type + dataType: DataType; + // A bucketed operation is grouped by duplicate values, otherwise each row is + // treated as unique + isBucketed: boolean; + /** + * ordinal: Each name is a unique value, but the names are in sorted order, like "Top values" + * interval: Histogram data, like date or number histograms + * ratio: Most number data is rendered as a ratio that includes 0 + */ + scale?: 'ordinal' | 'interval' | 'ratio'; + // Extra meta-information like cardinality, color + // TODO currently it's not possible to differentiate between a field from a raw + // document and an aggregated metric which might be handy in some cases. Once we + // introduce a raw document datasource, this should be considered here. + isStaticValue?: boolean; +} + +export interface Operation extends OperationMetadata { + // User-facing label for the operation + label: string; + sortingHint?: SortingHint; +} + +/** + * A visualization type advertised to the user in the chart switcher + */ +export interface VisualizationType { + /** + * Unique id of the visualization type within the visualization defining it + */ + id: string; + /** + * Icon used in the chart switcher + */ + icon: IconType; + /** + * Visible label used in the chart switcher and above the workspace panel in collapsed state + */ + label: string; + /** + * Optional label used in visualization type search if chart switcher is expanded and for tooltips + */ + fullLabel?: string; + /** + * The group the visualization belongs to + */ + groupLabel: string; + /** + * The priority of the visualization in the list (global priority) + * Higher number means higher priority. When omitted defaults to 0 + */ + sortPriority?: number; + /** + * Indicates if visualization is in the experimental stage. + */ + showExperimentalBadge?: boolean; +} + +export interface AccessorConfig { + columnId: string; + triggerIcon?: 'color' | 'disabled' | 'colorBy' | 'none' | 'invisible'; + color?: string; + palette?: string[] | Array<{ color: string; stop: number }>; +} diff --git a/src/plugins/chart_expressions/expression_xy/server/index.ts b/src/plugins/chart_expressions/expression_xy/server/index.ts new file mode 100755 index 0000000000000..e529b2a15fe34 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/server/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { ExpressionXyPlugin } from './plugin'; + +export function plugin() { + return new ExpressionXyPlugin(); +} + +export type { ExpressionXyPluginSetup, ExpressionXyPluginStart } from './types'; diff --git a/src/plugins/chart_expressions/expression_xy/server/plugin.ts b/src/plugins/chart_expressions/expression_xy/server/plugin.ts new file mode 100755 index 0000000000000..ff979fd38e1c6 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/server/plugin.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 { CoreSetup, CoreStart, Plugin } from '../../../../core/server'; + +import { ExpressionXyPluginSetup, ExpressionXyPluginStart } from './types'; +import { + xyVisFunction, + yAxisConfigFunction, + legendConfigFunction, + gridlinesConfigFunction, + dataLayerConfigFunction, + axisExtentConfigFunction, + tickLabelsConfigFunction, + annotationLayerConfigFunction, + labelsOrientationConfigFunction, + referenceLineLayerConfigFunction, + axisTitlesVisibilityConfigFunction, +} from '../common'; +import { SetupDeps } from './types'; + +export class ExpressionXyPlugin + implements Plugin +{ + public setup(core: CoreSetup, { expressions }: SetupDeps) { + expressions.registerFunction(yAxisConfigFunction); + expressions.registerFunction(legendConfigFunction); + expressions.registerFunction(gridlinesConfigFunction); + expressions.registerFunction(dataLayerConfigFunction); + expressions.registerFunction(axisExtentConfigFunction); + expressions.registerFunction(tickLabelsConfigFunction); + expressions.registerFunction(annotationLayerConfigFunction); + expressions.registerFunction(labelsOrientationConfigFunction); + expressions.registerFunction(referenceLineLayerConfigFunction); + expressions.registerFunction(axisTitlesVisibilityConfigFunction); + expressions.registerFunction(xyVisFunction); + } + + public start(core: CoreStart) {} + + public stop() {} +} diff --git a/src/plugins/chart_expressions/expression_xy/server/types.ts b/src/plugins/chart_expressions/expression_xy/server/types.ts new file mode 100755 index 0000000000000..738f52b739229 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/server/types.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 { ExpressionsServerStart, ExpressionsServerSetup } from '../../../expressions/server'; + +export type ExpressionXyPluginSetup = void; +export type ExpressionXyPluginStart = void; + +export interface SetupDeps { + expressions: ExpressionsServerSetup; +} + +export interface StartDeps { + expression: ExpressionsServerStart; +} diff --git a/src/plugins/chart_expressions/expression_xy/tsconfig.json b/src/plugins/chart_expressions/expression_xy/tsconfig.json new file mode 100644 index 0000000000000..5733914869317 --- /dev/null +++ b/src/plugins/chart_expressions/expression_xy/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true, + "isolatedModules": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + ], + "references": [ + { "path": "../../charts/tsconfig.json" }, + { "path": "../../../core/tsconfig.json" }, + { "path": "../../expressions/tsconfig.json" }, + { "path": "../../data/tsconfig.json"}, + { "path": "../../ui_actions/tsconfig.json" }, + { "path": "../../field_formats/tsconfig.json"}, + { "path": "../../kibana_utils/tsconfig.json" }, + { "path": "../../event_annotation/tsconfig.json" }, + { "path": "../../visualizations/tsconfig.json" }, + ] +} diff --git a/src/plugins/charts/public/static/components/empty_placeholder.tsx b/src/plugins/charts/public/static/components/empty_placeholder.tsx index 6989ea7a7a63b..e4559a0890ff2 100644 --- a/src/plugins/charts/public/static/components/empty_placeholder.tsx +++ b/src/plugins/charts/public/static/components/empty_placeholder.tsx @@ -10,22 +10,25 @@ import React from 'react'; import { EuiIcon, EuiText, IconType, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import './empty_placeholder.scss'; +import classnames from 'classnames'; export const EmptyPlaceholder = ({ icon, iconColor = 'subdued', message = , dataTestSubj = 'emptyPlaceholder', + className, }: { icon: IconType; iconColor?: string; message?: JSX.Element; dataTestSubj?: string; + className?: string; }) => ( <> void; updateTitle: (title?: string) => void; updateWidth: (newWidth: ControlWidth) => void; + getRelevantDataViewId?: () => string | undefined; + setLastUsedDataViewId?: (newDataViewId: string) => void; onTypeEditorChange: (partial: Partial) => void; } @@ -70,6 +72,8 @@ export const ControlEditor = ({ updateTitle, updateWidth, onTypeEditorChange, + getRelevantDataViewId, + setLastUsedDataViewId, }: EditControlProps) => { const { controls } = pluginServices.getServices(); const { getControlTypes, getControlFactory } = controls; @@ -87,6 +91,8 @@ export const ControlEditor = ({ const ControlTypeEditor = (factory as IEditableControlFactory).controlEditorComponent; return ControlTypeEditor ? ( void; addNewEmbeddable: (type: string, input: Omit) => void; + setLastUsedDataViewId?: (newDataViewId: string) => void; + getRelevantDataViewId?: () => string | undefined; buttonType: CreateControlButtonTypes; closePopover?: () => void; } @@ -37,6 +39,8 @@ export const CreateControlButton = ({ addNewEmbeddable, buttonType, closePopover, + setLastUsedDataViewId, + getRelevantDataViewId, }: CreateControlButtonProps) => { // Controls Services Context const { overlays, controls } = pluginServices.getServices(); @@ -72,6 +76,8 @@ export const CreateControlButton = ({ toMountPoint( (inputToReturn.title = newTitle)} @@ -92,6 +98,7 @@ export const CreateControlButton = ({ ), { + outsideClickCloses: false, onClose: (flyout) => onCancel(flyout), } ); diff --git a/src/plugins/controls/public/control_group/editor/edit_control.tsx b/src/plugins/controls/public/control_group/editor/edit_control.tsx index b70b7ef5f7e40..5b7177a64c633 100644 --- a/src/plugins/controls/public/control_group/editor/edit_control.tsx +++ b/src/plugins/controls/public/control_group/editor/edit_control.tsx @@ -20,6 +20,7 @@ import { IEditableControlFactory, ControlInput } from '../../types'; import { controlGroupReducers } from '../state/control_group_reducers'; import { EmbeddableFactoryNotFoundError } from '../../../../embeddable/public'; import { useReduxContainerContext } from '../../../../presentation_util/public'; +import { ControlGroupContainer } from '../embeddable/control_group_container'; export const EditControlButton = ({ embeddableId }: { embeddableId: string }) => { // Controls Services Context @@ -53,6 +54,7 @@ export const EditControlButton = ({ embeddableId }: { embeddableId: string }) => const panel = panels[embeddableId]; const factory = getControlFactory(panel.type); const embeddable = await untilEmbeddableLoaded(embeddableId); + const controlGroup = embeddable.getRoot() as ControlGroupContainer; let inputToReturn: Partial = {}; @@ -93,6 +95,7 @@ export const EditControlButton = ({ embeddableId }: { embeddableId: string }) => title={embeddable.getTitle()} onCancel={() => onCancel(flyoutInstance)} updateTitle={(newTitle) => (inputToReturn.title = newTitle)} + setLastUsedDataViewId={(lastUsed) => controlGroup.setLastUsedDataViewId(lastUsed)} updateWidth={(newWidth) => dispatch(setControlWidth({ width: newWidth, embeddableId }))} onTypeEditorChange={(partialInput) => (inputToReturn = { ...inputToReturn, ...partialInput }) @@ -123,6 +126,7 @@ export const EditControlButton = ({ embeddableId }: { embeddableId: string }) => reduxContainerContext ), { + outsideClickCloses: false, onClose: (flyout) => onCancel(flyout), } ); diff --git a/src/plugins/controls/public/control_group/editor/edit_control_group.tsx b/src/plugins/controls/public/control_group/editor/edit_control_group.tsx index f21d5d550f1a3..dcf955666657f 100644 --- a/src/plugins/controls/public/control_group/editor/edit_control_group.tsx +++ b/src/plugins/controls/public/control_group/editor/edit_control_group.tsx @@ -59,6 +59,7 @@ export const EditControlGroup = ({ ), { + outsideClickCloses: false, onClose: () => flyoutInstance.close(), } ); diff --git a/src/plugins/controls/public/control_group/embeddable/control_group_container.tsx b/src/plugins/controls/public/control_group/embeddable/control_group_container.tsx index e73aff832ab1e..064dfb8a0d7a1 100644 --- a/src/plugins/controls/public/control_group/embeddable/control_group_container.tsx +++ b/src/plugins/controls/public/control_group/embeddable/control_group_container.tsx @@ -81,6 +81,21 @@ export class ControlGroupContainer extends Container< private childOrderCache: ChildEmbeddableOrderCache; private recalculateFilters$: Subject; + private relevantDataViewId?: string; + private lastUsedDataViewId?: string; + + public setLastUsedDataViewId = (lastUsedDataViewId: string) => { + this.lastUsedDataViewId = lastUsedDataViewId; + }; + + public setRelevantDataViewId = (newRelevantDataViewId: string) => { + this.relevantDataViewId = newRelevantDataViewId; + }; + + public getMostRelevantDataViewId = () => { + return this.lastUsedDataViewId ?? this.relevantDataViewId; + }; + /** * Returns a button that allows controls to be created externally using the embeddable * @param buttonType Controls the button styling @@ -99,6 +114,8 @@ export class ControlGroupContainer extends Container< updateDefaultWidth={(defaultControlWidth) => this.updateInput({ defaultControlWidth })} addNewEmbeddable={(type, input) => this.addNewEmbeddable(type, input)} closePopover={closePopover} + getRelevantDataViewId={() => this.getMostRelevantDataViewId()} + setLastUsedDataViewId={(newId) => this.setLastUsedDataViewId(newId)} /> ); }; diff --git a/src/plugins/controls/public/control_types/options_list/options_list_editor.tsx b/src/plugins/controls/public/control_types/options_list/options_list_editor.tsx index fec580f7243be..141641f2a9030 100644 --- a/src/plugins/controls/public/control_types/options_list/options_list_editor.tsx +++ b/src/plugins/controls/public/control_types/options_list/options_list_editor.tsx @@ -38,6 +38,8 @@ export const OptionsListEditor = ({ initialInput, setValidState, setDefaultTitle, + getRelevantDataViewId, + setLastUsedDataViewId, }: ControlEditorProps) => { // Controls Services Context const { dataViews } = pluginServices.getHooks(); @@ -54,7 +56,8 @@ export const OptionsListEditor = ({ if (state.fieldName) setDefaultTitle(state.fieldName); (async () => { const dataViewListItems = await getIdsWithTitle(); - const initialId = initialInput?.dataViewId ?? (await getDefaultId()); + const initialId = + initialInput?.dataViewId ?? getRelevantDataViewId?.() ?? (await getDefaultId()); let dataView: DataView | undefined; if (initialId) { onChange({ dataViewId: initialId }); @@ -81,6 +84,7 @@ export const OptionsListEditor = ({ dataViews={state.dataViewListItems} selectedDataViewId={dataView?.id} onChangeDataViewId={(dataViewId) => { + setLastUsedDataViewId?.(dataViewId); onChange({ dataViewId }); get(dataViewId).then((newDataView) => setState((s) => ({ ...s, dataView: newDataView })) diff --git a/src/plugins/controls/public/types.ts b/src/plugins/controls/public/types.ts index 92d03c8dd42c0..745aa1bc32465 100644 --- a/src/plugins/controls/public/types.ts +++ b/src/plugins/controls/public/types.ts @@ -46,6 +46,8 @@ export interface IEditableControlFactory } export interface ControlEditorProps { initialInput?: Partial; + getRelevantDataViewId?: () => string | undefined; + setLastUsedDataViewId?: (newId: string) => void; onChange: (partial: Partial) => void; setValidState: (valid: boolean) => void; setDefaultTitle: (defaultTitle: string) => void; diff --git a/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts index eb5beeb858226..a8daffcf61440 100644 --- a/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts +++ b/src/plugins/dashboard/public/application/hooks/use_dashboard_app_state.ts @@ -235,8 +235,12 @@ export const useDashboardAppState = ({ const dataViewsSubscription = syncDashboardDataViews({ dashboardContainer, dataViews: dashboardBuildContext.dataViews, - onUpdateDataViews: (newDataViews: DataView[]) => - setDashboardAppState((s) => ({ ...s, dataViews: newDataViews })), + onUpdateDataViews: (newDataViews: DataView[]) => { + if (newDataViews.length > 0 && newDataViews[0].id) { + dashboardContainer.controlGroup?.setRelevantDataViewId(newDataViews[0].id); + } + setDashboardAppState((s) => ({ ...s, dataViews: newDataViews })); + }, }); /** diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx index de8abf8c01134..e804dcb8eca7a 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx @@ -149,6 +149,11 @@ export function DiscoverGridDocumentToolbarBtn({ setSelectedDocs, ]); + const toggleSelectionToolbar = useCallback( + () => setIsSelectionPopoverOpen((prevIsOpen) => !prevIsOpen), + [] + ); + return ( setIsSelectionPopoverOpen(false)} @@ -159,7 +164,7 @@ export function DiscoverGridDocumentToolbarBtn({ size="xs" color="text" iconType="documents" - onClick={() => setIsSelectionPopoverOpen(true)} + onClick={toggleSelectionToolbar} data-selected-documents={selectedDocs.length} data-test-subj="dscGridSelectionBtn" isSelected={isFilterActive} diff --git a/src/plugins/vis_types/gauge/public/__snapshots__/to_ast.test.ts.snap b/src/plugins/vis_types/gauge/public/__snapshots__/to_ast.test.ts.snap index dbc909f9ede22..cd9ce5427fd6f 100644 --- a/src/plugins/vis_types/gauge/public/__snapshots__/to_ast.test.ts.snap +++ b/src/plugins/vis_types/gauge/public/__snapshots__/to_ast.test.ts.snap @@ -41,7 +41,7 @@ Object { "palette", ], "labelMajorMode": Array [ - "auto", + "none", ], "labelMinor": Array [ "some custom sublabel", diff --git a/src/plugins/vis_types/gauge/public/to_ast.ts b/src/plugins/vis_types/gauge/public/to_ast.ts index dfb483d47fd21..1e9226aa10094 100644 --- a/src/plugins/vis_types/gauge/public/to_ast.ts +++ b/src/plugins/vis_types/gauge/public/to_ast.ts @@ -67,11 +67,12 @@ export const toExpressionAst: VisToExpressionAst = (vis, params) shape: gaugeTypeToShape(gaugeType), metric: schemas.metric.map(prepareDimension), ticksPosition: scale.show ? 'auto' : 'hidden', - labelMajorMode: 'auto', + labelMajorMode: 'none', colorMode: 'palette', centralMajorMode, ...(centralMajorMode === 'custom' ? { labelMinor: style.subText } : {}), percentageMode, + commonLabel: schemas.metric?.[0]?.label, }); if (colorsRange && colorsRange.length) { diff --git a/src/plugins/vis_types/vega/public/components/vega_vis.scss b/src/plugins/vis_types/vega/public/components/vega_vis.scss index f0062869e0046..ce66dc1d7f928 100644 --- a/src/plugins/vis_types/vega/public/components/vega_vis.scss +++ b/src/plugins/vis_types/vega/public/components/vega_vis.scss @@ -24,6 +24,10 @@ width: 100%; height: 100%; + canvas { + display: block; + } + // BUG #23514: Make sure Vega doesn't display the controls in two places .vega-bindings { // sass-lint:disable no-important diff --git a/test/accessibility/apps/dashboard_panel.ts b/test/accessibility/apps/dashboard_panel.ts index 83c7776049d16..b7975738104ce 100644 --- a/test/accessibility/apps/dashboard_panel.ts +++ b/test/accessibility/apps/dashboard_panel.ts @@ -57,7 +57,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('dashboard panel full screen', async () => { const header = await dashboardPanelActions.getPanelHeading('[Flights] Flight count'); - await dashboardPanelActions.toggleContextMenu(header); + await dashboardPanelActions.openContextMenuMorePanel(header); await testSubjects.click('embeddablePanelAction-togglePanel'); await a11y.testAppSnapshot(); diff --git a/test/functional/apps/dashboard_elements/controls/options_list.ts b/test/functional/apps/dashboard_elements/controls/options_list.ts index 6272448a68f93..6c52581d2878f 100644 --- a/test/functional/apps/dashboard_elements/controls/options_list.ts +++ b/test/functional/apps/dashboard_elements/controls/options_list.ts @@ -17,6 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const filterBar = getService('filterBar'); const testSubjects = getService('testSubjects'); const dashboardAddPanel = getService('dashboardAddPanel'); + const dashboardPanelActions = getService('dashboardPanelActions'); const { dashboardControls, timePicker, common, dashboard, header } = getPageObjects([ 'dashboardControls', 'timePicker', @@ -33,9 +34,44 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await timePicker.setDefaultDataRange(); }); + describe('Options List Control Editor selects relevant data views', async () => { + it('selects the default data view when the dashboard is blank', async () => { + expect(await dashboardControls.optionsListEditorGetCurrentDataView(true)).to.eql( + 'logstash-*' + ); + }); + + it('selects a relevant data view based on the panels on the dashboard', async () => { + await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie'); + await dashboard.waitForRenderComplete(); + expect(await dashboardControls.optionsListEditorGetCurrentDataView(true)).to.eql( + 'animals-*' + ); + await dashboardPanelActions.removePanelByTitle('Rendering Test: animal sounds pie'); + await dashboard.waitForRenderComplete(); + expect(await dashboardControls.optionsListEditorGetCurrentDataView(true)).to.eql( + 'logstash-*' + ); + }); + + it('selects the last used data view by default', async () => { + await dashboardControls.createOptionsListControl({ + dataViewTitle: 'animals-*', + fieldName: 'sound.keyword', + }); + expect(await dashboardControls.optionsListEditorGetCurrentDataView(true)).to.eql( + 'animals-*' + ); + await dashboardControls.deleteAllControls(); + }); + }); + describe('Options List Control creation and editing experience', async () => { it('can add a new options list control from a blank state', async () => { - await dashboardControls.createOptionsListControl({ fieldName: 'machine.os.raw' }); + await dashboardControls.createOptionsListControl({ + dataViewTitle: 'logstash-*', + fieldName: 'machine.os.raw', + }); expect(await dashboardControls.getControlsCount()).to.be(1); }); diff --git a/test/functional/apps/home/_sample_data.ts b/test/functional/apps/home/_sample_data.ts index e0a96940337e2..9557021d76d31 100644 --- a/test/functional/apps/home/_sample_data.ts +++ b/test/functional/apps/home/_sample_data.ts @@ -95,7 +95,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); log.debug('Checking charts rendered'); - await elasticChart.waitForRenderComplete('lnsVisualizationContainer'); + await elasticChart.waitForRenderComplete('xyVisChart'); log.debug('Checking saved searches rendered'); await dashboardExpect.savedSearchRowCount(10); log.debug('Checking input controls rendered'); diff --git a/test/functional/apps/management/_index_pattern_filter.ts b/test/functional/apps/management/_index_pattern_filter.ts index afa64c474d39d..732065282d546 100644 --- a/test/functional/apps/management/_index_pattern_filter.ts +++ b/test/functional/apps/management/_index_pattern_filter.ts @@ -15,7 +15,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['settings']); const esArchiver = getService('esArchiver'); - describe('index pattern filter', function describeIndexTests() { + // FLAKY: https://github.com/elastic/kibana/issues/128558 + describe.skip('index pattern filter', function describeIndexTests() { before(async function () { await esArchiver.emptyKibanaIndex(); await kibanaServer.uiSettings.replace({}); diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index 0150daec3afb5..28ac88674b4a6 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -517,7 +517,7 @@ export class CommonPageObject extends FtrService { */ formatTime(time: TimeStrings, fmt: string = 'MMM D, YYYY @ HH:mm:ss.SSS') { return Object.keys(time) - .map((x) => moment(time[x], [fmt]).format()) + .map((x) => moment.utc(time[x], [fmt]).format()) .reduce( (acc, curr, idx) => { if (idx === 0) acc.from = curr; diff --git a/test/functional/page_objects/dashboard_page_controls.ts b/test/functional/page_objects/dashboard_page_controls.ts index c57c6d304e1e5..f0dd7ed9ddd3d 100644 --- a/test/functional/page_objects/dashboard_page_controls.ts +++ b/test/functional/page_objects/dashboard_page_controls.ts @@ -336,9 +336,12 @@ export class DashboardPageControls extends FtrService { await this.testSubjects.click(`control-editor-save`); } - public async controlEditorCancel() { + public async controlEditorCancel(confirm?: boolean) { this.log.debug(`Canceling changes in control editor`); await this.testSubjects.click(`control-editor-cancel`); + if (confirm) { + await this.common.clickConfirmOnModal(); + } } // Options List editor functions @@ -364,6 +367,17 @@ export class DashboardPageControls extends FtrService { await this.controlEditorSave(); } + public async optionsListEditorGetCurrentDataView(openAndCloseFlyout?: boolean) { + if (openAndCloseFlyout) { + await this.openCreateControlFlyout(OPTIONS_LIST_CONTROL); + } + const dataViewName = (await this.testSubjects.find('open-data-view-picker')).getVisibleText(); + if (openAndCloseFlyout) { + await this.controlEditorCancel(true); + } + return dataViewName; + } + public async optionsListEditorSetDataView(dataViewTitle: string) { this.log.debug(`Setting options list data view to ${dataViewTitle}`); await this.testSubjects.click('open-data-view-picker'); diff --git a/x-pack/plugins/alerting/common/alert.ts b/x-pack/plugins/alerting/common/alert.ts index 1628abff7efc1..9e48acd523d22 100644 --- a/x-pack/plugins/alerting/common/alert.ts +++ b/x-pack/plugins/alerting/common/alert.ts @@ -49,6 +49,7 @@ export enum AlertExecutionStatusWarningReasons { export interface AlertExecutionStatus { status: AlertExecutionStatuses; numberOfTriggeredActions?: number; + numberOfScheduledActions?: number; metrics?: RuleExecutionMetrics; lastExecutionDate: Date; lastDuration?: number; diff --git a/x-pack/plugins/alerting/common/rule_task_instance.ts b/x-pack/plugins/alerting/common/rule_task_instance.ts index aa45618b33f24..54483babdfdd3 100644 --- a/x-pack/plugins/alerting/common/rule_task_instance.ts +++ b/x-pack/plugins/alerting/common/rule_task_instance.ts @@ -24,6 +24,7 @@ const ruleExecutionMetricsSchema = t.partial({ const alertExecutionStore = t.partial({ numberOfTriggeredActions: t.number, + numberOfScheduledActions: t.number, triggeredActionsStatus: t.string, }); diff --git a/x-pack/plugins/alerting/server/config.test.ts b/x-pack/plugins/alerting/server/config.test.ts index cdb12b6755ada..b08145219c24b 100644 --- a/x-pack/plugins/alerting/server/config.test.ts +++ b/x-pack/plugins/alerting/server/config.test.ts @@ -13,7 +13,6 @@ describe('config validation', () => { expect(configSchema.validate(config)).toMatchInlineSnapshot(` Object { "cancelAlertsOnRuleTimeout": true, - "defaultRuleTaskTimeout": "5m", "healthCheck": Object { "interval": "60m", }, diff --git a/x-pack/plugins/alerting/server/config.ts b/x-pack/plugins/alerting/server/config.ts index d126fc4295050..c727c137aa9a2 100644 --- a/x-pack/plugins/alerting/server/config.ts +++ b/x-pack/plugins/alerting/server/config.ts @@ -42,7 +42,6 @@ export const configSchema = schema.object({ maxEphemeralActionsPerAlert: schema.number({ defaultValue: DEFAULT_MAX_EPHEMERAL_ACTIONS_PER_ALERT, }), - defaultRuleTaskTimeout: schema.string({ validate: validateDurationSchema, defaultValue: '5m' }), cancelAlertsOnRuleTimeout: schema.boolean({ defaultValue: true }), rules: rulesSchema, }); diff --git a/x-pack/plugins/alerting/server/index.ts b/x-pack/plugins/alerting/server/index.ts index 49b65c678aa1f..b44df6c3d1c86 100644 --- a/x-pack/plugins/alerting/server/index.ts +++ b/x-pack/plugins/alerting/server/index.ts @@ -60,5 +60,12 @@ export const config: PluginConfigDescriptor = { 'xpack.alerting.invalidateApiKeysTask.removalDelay', { level: 'warning' } ), + renameFromRoot( + 'xpack.alerting.defaultRuleTaskTimeout', + 'xpack.alerting.rules.execution.timeout', + { + level: 'warning', + } + ), ], }; diff --git a/x-pack/plugins/alerting/server/lib/format_execution_log_errors.test.ts b/x-pack/plugins/alerting/server/lib/format_execution_log_errors.test.ts new file mode 100644 index 0000000000000..70cfe4294020f --- /dev/null +++ b/x-pack/plugins/alerting/server/lib/format_execution_log_errors.test.ts @@ -0,0 +1,230 @@ +/* + * 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 { formatExecutionErrorsResult } from './format_execution_log_errors'; +import { QueryEventsBySavedObjectResult } from '../../../event_log/server'; + +describe('formatExecutionErrorsResult', () => { + test('should return empty results if data is undefined', () => { + expect(formatExecutionErrorsResult({} as QueryEventsBySavedObjectResult)).toEqual({ + totalErrors: 0, + errors: [], + }); + }); + test('should format results correctly', () => { + const results = getEsResults({ + data: [ + { + timestamp: '2022-03-23T17:37:07.106Z', + provider: 'actions', + action: 'execute', + outcome: 'failure', + kind: 'action', + executionUuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: test-connector', + errorMessage: + 'an error occurred while running the action executor: something funky with the server log', + }, + { + timestamp: '2022-03-23T17:37:07.102Z', + provider: 'actions', + action: 'execute', + outcome: 'failure', + kind: 'action', + executionUuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: test-connector', + errorMessage: + 'an error occurred while running the action executor: something funky with the server log', + }, + { + timestamp: '2022-03-23T17:23:05.249Z', + provider: 'alerting', + action: 'execute', + outcome: 'failure', + kind: 'alert', + executionUuid: 'c1c04f04-312e-4e23-8e36-e01eb4332ed6', + message: `rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule'`, + errorMessage: 'I am erroring in rule execution!!', + }, + ], + }); + expect(formatExecutionErrorsResult(results)).toEqual({ + totalErrors: 6, + errors: [ + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.106Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: test-connector - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.102Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: test-connector - an error occurred while running the action executor: something funky with the server log', + }, + { + id: 'c1c04f04-312e-4e23-8e36-e01eb4332ed6', + timestamp: '2022-03-23T17:23:05.249Z', + type: 'alerting', + message: `rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule' - I am erroring in rule execution!!`, + }, + ], + }); + }); + test('should format results correctly with timeout', () => { + const results = getEsResults({ + data: [ + { + timestamp: '2022-03-24T15:34:13.199Z', + provider: 'alerting', + action: 'execute-timeout', + kind: 'alert', + executionUuid: 'a427f8cb-0e03-4270-90b2-ec325f4f082c', + message: `rule: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule' execution cancelled due to timeout - exceeded rule type timeout of 3s`, + }, + { + timestamp: '2022-03-23T17:37:07.106Z', + provider: 'actions', + action: 'execute', + outcome: 'failure', + kind: 'action', + executionUuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: test-connector', + errorMessage: + 'an error occurred while running the action executor: something funky with the server log', + }, + { + timestamp: '2022-03-23T17:37:07.102Z', + provider: 'actions', + action: 'execute', + outcome: 'failure', + kind: 'action', + executionUuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: test-connector', + errorMessage: + 'an error occurred while running the action executor: something funky with the server log', + }, + { + timestamp: '2022-03-23T17:23:05.249Z', + provider: 'alerting', + action: 'execute', + outcome: 'failure', + kind: 'alert', + executionUuid: 'c1c04f04-312e-4e23-8e36-e01eb4332ed6', + message: `rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule'`, + errorMessage: 'I am erroring in rule execution!!', + }, + ], + }); + expect(formatExecutionErrorsResult(results)).toEqual({ + totalErrors: 6, + errors: [ + { + id: 'a427f8cb-0e03-4270-90b2-ec325f4f082c', + timestamp: '2022-03-24T15:34:13.199Z', + type: 'alerting', + message: + "rule: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule' execution cancelled due to timeout - exceeded rule type timeout of 3s", + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.106Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: test-connector - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.102Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: test-connector - an error occurred while running the action executor: something funky with the server log', + }, + { + id: 'c1c04f04-312e-4e23-8e36-e01eb4332ed6', + timestamp: '2022-03-23T17:23:05.249Z', + type: 'alerting', + message: `rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule' - I am erroring in rule execution!!`, + }, + ], + }); + }); +}); + +interface GetEsResult { + timestamp: string; + provider: string; + action: string; + outcome?: string; + kind: string; + executionUuid: string; + message: string; + errorMessage?: string; +} +interface GetEsResultsOpts { + page?: number; + perPage?: number; + total?: number; + data: GetEsResult[]; +} + +function getEsResults({ + page = 1, + perPage = 500, + total = 6, + data, +}: GetEsResultsOpts): QueryEventsBySavedObjectResult { + return { + page, + per_page: perPage, + total, + data: data.map((d: GetEsResult) => ({ + '@timestamp': d.timestamp, + event: { + provider: d.provider, + action: d.action, + kind: d.kind, + ...(d.outcome ? { outcome: d.outcome } : {}), + }, + kibana: { + alert: { + rule: { + execution: { + uuid: d.executionUuid, + }, + }, + }, + saved_objects: [ + { + rel: 'primary', + type: 'alert', + id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', + type_id: 'example.always-firing', + }, + ], + task: { + scheduled: '2022-03-23T17:37:04.674Z', + schedule_delay: 2431000000, + }, + server_uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', + version: '8.2.0', + }, + message: d.message, + ...(d.errorMessage ? { error: { message: d.errorMessage } } : {}), + ecs: { + version: '1.8.0', + }, + })), + }; +} diff --git a/x-pack/plugins/alerting/server/lib/format_execution_log_errors.ts b/x-pack/plugins/alerting/server/lib/format_execution_log_errors.ts new file mode 100644 index 0000000000000..a169640c4fc83 --- /dev/null +++ b/x-pack/plugins/alerting/server/lib/format_execution_log_errors.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { get } from 'lodash'; +import { QueryEventsBySavedObjectResult, IValidatedEvent } from '../../../event_log/server'; + +const EXECUTION_UUID_FIELD = 'kibana.alert.rule.execution.uuid'; +const TIMESTAMP_FIELD = '@timestamp'; +const PROVIDER_FIELD = 'event.provider'; +const MESSAGE_FIELD = 'message'; +const ERROR_MESSAGE_FIELD = 'error.message'; + +export interface IExecutionErrors { + id: string; + timestamp: string; + type: string; + message: string; +} + +export interface IExecutionErrorsResult { + totalErrors: number; + errors: IExecutionErrors[]; +} + +export const EMPTY_EXECUTION_ERRORS_RESULT = { + totalErrors: 0, + errors: [], +}; + +function formatEvent(event: IValidatedEvent): IExecutionErrors { + const message = get(event, MESSAGE_FIELD, ''); + const errorMessage = get(event, ERROR_MESSAGE_FIELD, null); + return { + id: get(event, EXECUTION_UUID_FIELD, ''), + timestamp: get(event, TIMESTAMP_FIELD, ''), + type: get(event, PROVIDER_FIELD, ''), + message: errorMessage ? `${message} - ${errorMessage}` : message, + }; +} + +export function formatExecutionErrorsResult( + results: QueryEventsBySavedObjectResult +): IExecutionErrorsResult { + const { total, data } = results; + + if (!data) { + return EMPTY_EXECUTION_ERRORS_RESULT; + } + + return { + totalErrors: total, + errors: data.map((event: IValidatedEvent) => formatEvent(event)), + }; +} diff --git a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts index 92999a80f6b99..6d6871b7ac111 100644 --- a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts +++ b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.test.ts @@ -197,7 +197,10 @@ describe('getExecutionLogAggregation', () => { }, executionDuration: { max: { field: 'event.duration' } }, outcomeAndMessage: { - top_hits: { size: 1, _source: { includes: ['event.outcome', 'message'] } }, + top_hits: { + size: 1, + _source: { includes: ['event.outcome', 'message', 'error.message'] }, + }, }, }, }, @@ -446,6 +449,231 @@ describe('formatExecutionLogResult', () => { }); }); + test('should format results correctly with rule execution errors', () => { + const results = { + aggregations: { + executionUuid: { + meta: {}, + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: '6705da7d-2635-499d-a6a8-1aee1ae1eac9', + doc_count: 27, + timeoutMessage: { + meta: {}, + doc_count: 0, + }, + alertCounts: { + meta: {}, + buckets: { + activeAlerts: { + doc_count: 5, + }, + newAlerts: { + doc_count: 5, + }, + recoveredAlerts: { + doc_count: 0, + }, + }, + }, + ruleExecution: { + meta: {}, + doc_count: 1, + numTriggeredActions: { + value: 5.0, + }, + outcomeAndMessage: { + hits: { + total: { + value: 1, + relation: 'eq', + }, + max_score: 1.0, + hits: [ + { + _index: '.kibana-event-log-8.2.0-000001', + _id: 'S4wIZX8B8TGQpG7XQZns', + _score: 1.0, + _source: { + event: { + outcome: 'failure', + }, + message: + "rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule'", + error: { + message: 'I am erroring in rule execution!!', + }, + }, + }, + ], + }, + }, + scheduleDelay: { + value: 3.074e9, + }, + totalSearchDuration: { + value: 0.0, + }, + esSearchDuration: { + value: 0.0, + }, + executionDuration: { + value: 1.056e9, + }, + executeStartTime: { + value: 1.646667512617e12, + value_as_string: '2022-03-07T15:38:32.617Z', + }, + }, + actionExecution: { + meta: {}, + doc_count: 5, + actionOutcomes: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'success', + doc_count: 5, + }, + ], + }, + }, + }, + { + key: '41b2755e-765a-4044-9745-b03875d5e79a', + doc_count: 32, + timeoutMessage: { + meta: {}, + doc_count: 0, + }, + alertCounts: { + meta: {}, + buckets: { + activeAlerts: { + doc_count: 5, + }, + newAlerts: { + doc_count: 5, + }, + recoveredAlerts: { + doc_count: 5, + }, + }, + }, + ruleExecution: { + meta: {}, + doc_count: 1, + numTriggeredActions: { + value: 5.0, + }, + outcomeAndMessage: { + hits: { + total: { + value: 1, + relation: 'eq', + }, + max_score: 1.0, + hits: [ + { + _index: '.kibana-event-log-8.2.0-000001', + _id: 'a4wIZX8B8TGQpG7Xwpnz', + _score: 1.0, + _source: { + event: { + outcome: 'success', + }, + message: + "rule executed: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule'", + }, + }, + ], + }, + }, + scheduleDelay: { + value: 3.126e9, + }, + totalSearchDuration: { + value: 0.0, + }, + esSearchDuration: { + value: 0.0, + }, + executionDuration: { + value: 1.165e9, + }, + executeStartTime: { + value: 1.646667545604e12, + value_as_string: '2022-03-07T15:39:05.604Z', + }, + }, + actionExecution: { + meta: {}, + doc_count: 5, + actionOutcomes: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'success', + doc_count: 5, + }, + ], + }, + }, + }, + ], + }, + executionUuidCardinality: { + value: 374, + }, + }, + }; + expect(formatExecutionLogResult(results)).toEqual({ + total: 374, + data: [ + { + id: '6705da7d-2635-499d-a6a8-1aee1ae1eac9', + timestamp: '2022-03-07T15:38:32.617Z', + duration_ms: 1056, + status: 'failure', + message: + "rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule' - I am erroring in rule execution!!", + num_active_alerts: 5, + num_new_alerts: 5, + num_recovered_alerts: 0, + num_triggered_actions: 5, + num_succeeded_actions: 5, + num_errored_actions: 0, + total_search_duration_ms: 0, + es_search_duration_ms: 0, + timed_out: false, + schedule_delay_ms: 3074, + }, + { + id: '41b2755e-765a-4044-9745-b03875d5e79a', + timestamp: '2022-03-07T15:39:05.604Z', + duration_ms: 1165, + status: 'success', + message: + "rule executed: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule'", + num_active_alerts: 5, + num_new_alerts: 5, + num_recovered_alerts: 5, + num_triggered_actions: 5, + num_succeeded_actions: 5, + num_errored_actions: 0, + total_search_duration_ms: 0, + es_search_duration_ms: 0, + timed_out: false, + schedule_delay_ms: 3126, + }, + ], + }); + }); + test('should format results correctly when execution timeouts occur', () => { const results = { aggregations: { diff --git a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts index 445cec6ad8412..22b7d15f72c11 100644 --- a/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts +++ b/x-pack/plugins/alerting/server/lib/get_execution_log_aggregation.ts @@ -19,6 +19,7 @@ const ACTION_FIELD = 'event.action'; const OUTCOME_FIELD = 'event.outcome'; const DURATION_FIELD = 'event.duration'; const MESSAGE_FIELD = 'message'; +const ERROR_MESSAGE_FIELD = 'error.message'; const SCHEDULE_DELAY_FIELD = 'kibana.task.schedule_delay'; const ES_SEARCH_DURATION_FIELD = 'kibana.alert.rule.execution.metrics.es_search_duration_ms'; const TOTAL_SEARCH_DURATION_FIELD = 'kibana.alert.rule.execution.metrics.total_search_duration_ms'; @@ -51,6 +52,11 @@ export interface IExecutionLogResult { data: IExecutionLog[]; } +export const EMPTY_EXECUTION_LOG_RESULT = { + total: 0, + data: [], +}; + interface IAlertCounts extends estypes.AggregationsMultiBucketAggregateBase { buckets: { activeAlerts: estypes.AggregationsSingleBucketAggregateBase; @@ -207,7 +213,7 @@ export function getExecutionLogAggregation({ page, perPage, sort }: IExecutionLo top_hits: { size: 1, _source: { - includes: [OUTCOME_FIELD, MESSAGE_FIELD], + includes: [OUTCOME_FIELD, MESSAGE_FIELD, ERROR_MESSAGE_FIELD], }, }, }, @@ -256,12 +262,18 @@ function formatExecutionLogAggBucket(bucket: IExecutionUuidAggBucket): IExecutio const actionExecutionError = actionExecutionOutcomes.find((subBucket) => subBucket?.key === 'failure')?.doc_count ?? 0; + const outcomeAndMessage = bucket?.ruleExecution?.outcomeAndMessage?.hits?.hits[0]?._source; + const status = outcomeAndMessage ? outcomeAndMessage?.event?.outcome ?? '' : ''; + const message = + status === 'failure' + ? `${outcomeAndMessage?.message ?? ''} - ${outcomeAndMessage?.error?.message ?? ''}` + : outcomeAndMessage?.message ?? ''; return { id: bucket?.key ?? '', timestamp: bucket?.ruleExecution?.executeStartTime.value_as_string ?? '', duration_ms: durationUs / Millis2Nanos, - status: bucket?.ruleExecution?.outcomeAndMessage?.hits?.hits[0]?._source?.event?.outcome, - message: bucket?.ruleExecution?.outcomeAndMessage?.hits?.hits[0]?._source?.message, + status, + message, num_active_alerts: bucket?.alertCounts?.buckets?.activeAlerts?.doc_count ?? 0, num_new_alerts: bucket?.alertCounts?.buckets?.newAlerts?.doc_count ?? 0, num_recovered_alerts: bucket?.alertCounts?.buckets?.recoveredAlerts?.doc_count ?? 0, @@ -281,10 +293,7 @@ export function formatExecutionLogResult( const { aggregations } = results; if (!aggregations) { - return { - total: 0, - data: [], - }; + return EMPTY_EXECUTION_LOG_RESULT; } const total = (aggregations.executionUuidCardinality as estypes.AggregationsCardinalityAggregate) diff --git a/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.test.ts b/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.test.ts new file mode 100644 index 0000000000000..6a41d5068682d --- /dev/null +++ b/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getRuleTaskTimeout } from './get_rule_task_timeout'; +import { RulesConfig } from '../config'; + +const ruleTypeId = 'test-rule-type-id'; +const config = { + minimumScheduleInterval: { + value: '2m', + enforce: false, + }, + execution: { + timeout: '1m', + actions: { max: 1000 }, + }, +} as RulesConfig; + +const configWithRuleType = { + ...config, + execution: { + ...config.execution, + ruleTypeOverrides: [ + { + id: ruleTypeId, + timeout: '10m', + }, + ], + }, +}; + +const configWithoutTimeout = { + ...config, + execution: { + actions: { max: 1000 }, + }, +}; + +describe('get rule task timeout', () => { + test('returns the rule type specific timeout', () => { + expect(getRuleTaskTimeout({ config: configWithRuleType, ruleTypeId })).toBe('10m'); + }); + + test('returns the timeout that applies all the rule types', () => { + expect(getRuleTaskTimeout({ config, ruleTypeId })).toBe('1m'); + }); + + test('returns the timeout passed by the plugin', () => { + expect( + getRuleTaskTimeout({ config: configWithoutTimeout, ruleTaskTimeout: '20m', ruleTypeId }) + ).toBe('20m'); + }); + + test('returns the default timeout', () => { + expect(getRuleTaskTimeout({ config: configWithoutTimeout, ruleTypeId })).toBe('5m'); + }); +}); diff --git a/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.ts b/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.ts new file mode 100644 index 0000000000000..abb6c6e971711 --- /dev/null +++ b/x-pack/plugins/alerting/server/lib/get_rule_task_timeout.ts @@ -0,0 +1,35 @@ +/* + * 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 { RulesConfig } from '../config'; + +const DEFAULT_EXECUTION_TIMEOUT = '5m'; + +export const getRuleTaskTimeout = ({ + config, + ruleTaskTimeout, + ruleTypeId, +}: { + config: RulesConfig; + ruleTaskTimeout?: string; + ruleTypeId: string; +}): string => { + const ruleTypeConfig = config.execution.ruleTypeOverrides?.find( + (ruleType) => ruleTypeId === ruleType.id + ); + + // First, rule type specific timeout config (ruleTypeOverrides) is applied if it's set in kibana.yml + // if not, then timeout for all the rule types is applied if it's set in kibana.yml + // if not, ruleTaskTimeout is applied that is passed from the rule type registering plugin + // if none of above is set, DEFAULT_EXECUTION_TIMEOUT is applied + return ( + ruleTypeConfig?.timeout || + config.execution.timeout || + ruleTaskTimeout || + DEFAULT_EXECUTION_TIMEOUT + ); +}; diff --git a/x-pack/plugins/alerting/server/lib/rule_execution_status.test.ts b/x-pack/plugins/alerting/server/lib/rule_execution_status.test.ts index c6746ed0eac93..44a9e41c89052 100644 --- a/x-pack/plugins/alerting/server/lib/rule_execution_status.test.ts +++ b/x-pack/plugins/alerting/server/lib/rule_execution_status.test.ts @@ -34,11 +34,13 @@ describe('RuleExecutionStatus', () => { const status = executionStatusFromState({ alertExecutionStore: { numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, triggeredActionsStatus: ActionsCompletion.COMPLETE, }, } as RuleExecutionState); checkDateIsNearNow(status.lastExecutionDate); expect(status.numberOfTriggeredActions).toBe(0); + expect(status.numberOfScheduledActions).toBe(0); expect(status.status).toBe('ok'); expect(status.error).toBe(undefined); expect(status.warning).toBe(undefined); @@ -49,12 +51,14 @@ describe('RuleExecutionStatus', () => { alertInstances: {}, alertExecutionStore: { numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, triggeredActionsStatus: ActionsCompletion.COMPLETE, }, metrics, }); checkDateIsNearNow(status.lastExecutionDate); expect(status.numberOfTriggeredActions).toBe(0); + expect(status.numberOfScheduledActions).toBe(0); expect(status.status).toBe('ok'); expect(status.error).toBe(undefined); expect(status.warning).toBe(undefined); @@ -66,12 +70,14 @@ describe('RuleExecutionStatus', () => { alertInstances: { a: {} }, alertExecutionStore: { numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, triggeredActionsStatus: ActionsCompletion.COMPLETE, }, metrics, }); checkDateIsNearNow(status.lastExecutionDate); expect(status.numberOfTriggeredActions).toBe(0); + expect(status.numberOfScheduledActions).toBe(0); expect(status.status).toBe('active'); expect(status.error).toBe(undefined); expect(status.warning).toBe(undefined); @@ -82,6 +88,7 @@ describe('RuleExecutionStatus', () => { const status = executionStatusFromState({ alertExecutionStore: { numberOfTriggeredActions: 1, + numberOfScheduledActions: 2, triggeredActionsStatus: ActionsCompletion.COMPLETE, }, alertInstances: { a: {} }, @@ -89,6 +96,7 @@ describe('RuleExecutionStatus', () => { }); checkDateIsNearNow(status.lastExecutionDate); expect(status.numberOfTriggeredActions).toBe(1); + expect(status.numberOfScheduledActions).toBe(2); expect(status.status).toBe('active'); expect(status.error).toBe(undefined); expect(status.warning).toBe(undefined); @@ -313,28 +321,6 @@ describe('RuleExecutionStatus', () => { } `); }); - - test('valid status, date, error, duration and triggeredActions', () => { - const result = ruleExecutionStatusFromRaw(MockLogger, 'rule-id', { - status, - lastExecutionDate: date, - numberOfTriggeredActions: 5, - error, - lastDuration: 1234, - }); - expect(result).toMatchInlineSnapshot(` - Object { - "error": Object { - "message": "wops", - "reason": "execute", - }, - "lastDuration": 1234, - "lastExecutionDate": 2020-09-03T16:26:58.000Z, - "numberOfTriggeredActions": 5, - "status": "active", - } - `); - }); }); }); diff --git a/x-pack/plugins/alerting/server/lib/rule_execution_status.ts b/x-pack/plugins/alerting/server/lib/rule_execution_status.ts index 364975f37614d..9a446d2383c66 100644 --- a/x-pack/plugins/alerting/server/lib/rule_execution_status.ts +++ b/x-pack/plugins/alerting/server/lib/rule_execution_status.ts @@ -35,6 +35,7 @@ export function executionStatusFromState(state: RuleExecutionState): AlertExecut return { metrics: state.metrics, numberOfTriggeredActions: state.alertExecutionStore.numberOfTriggeredActions, + numberOfScheduledActions: state.alertExecutionStore.numberOfScheduledActions, lastExecutionDate: new Date(), status, ...(hasIncompleteAlertExecution && { @@ -84,7 +85,6 @@ export function ruleExecutionStatusFromRaw( const { lastExecutionDate, lastDuration, - numberOfTriggeredActions, status = 'unknown', error, warning, @@ -107,10 +107,6 @@ export function ruleExecutionStatusFromRaw( executionStatus.lastDuration = lastDuration; } - if (null != numberOfTriggeredActions) { - executionStatus.numberOfTriggeredActions = numberOfTriggeredActions; - } - if (error) { executionStatus.error = error; } diff --git a/x-pack/plugins/alerting/server/plugin.test.ts b/x-pack/plugins/alerting/server/plugin.test.ts index 5a93d389cb73d..450c177d72473 100644 --- a/x-pack/plugins/alerting/server/plugin.test.ts +++ b/x-pack/plugins/alerting/server/plugin.test.ts @@ -30,7 +30,6 @@ const generateAlertingConfig = (): AlertingConfig => ({ removalDelay: '1h', }, maxEphemeralActionsPerAlert: 10, - defaultRuleTaskTimeout: '5m', cancelAlertsOnRuleTimeout: true, rules: { minimumScheduleInterval: { value: '1m', enforce: false }, @@ -180,6 +179,10 @@ describe('Alerting Plugin', () => { describe('registerType()', () => { let setup: PluginSetupContract; beforeEach(async () => { + const context = coreMock.createPluginInitializerContext( + generateAlertingConfig() + ); + plugin = new AlertingPlugin(context); setup = await plugin.setup(setupMocks, mockPlugins); }); diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts index de9524d69a84e..8fa394445fe50 100644 --- a/x-pack/plugins/alerting/server/plugin.ts +++ b/x-pack/plugins/alerting/server/plugin.ts @@ -66,6 +66,7 @@ import { getSecurityHealth, SecurityHealth } from './lib/get_security_health'; import { MonitoringCollectionSetup } from '../../monitoring_collection/server'; import { registerNodeCollector, registerClusterCollector, InMemoryMetrics } from './monitoring'; import { getExecutionConfigForRuleType } from './lib/get_rules_config'; +import { getRuleTaskTimeout } from './lib/get_rule_task_timeout'; export const EVENT_LOG_PROVIDER = 'alerting'; export const EVENT_LOG_ACTIONS = { @@ -282,15 +283,13 @@ export class AlertingPlugin { encryptedSavedObjects: plugins.encryptedSavedObjects, }); - const alertingConfig: AlertingConfig = this.config; - return { - registerType< - Params extends AlertTypeParams = AlertTypeParams, - ExtractedParams extends AlertTypeParams = AlertTypeParams, - State extends AlertTypeState = AlertTypeState, - InstanceState extends AlertInstanceState = AlertInstanceState, - InstanceContext extends AlertInstanceContext = AlertInstanceContext, + registerType: < + Params extends AlertTypeParams = never, + ExtractedParams extends AlertTypeParams = never, + State extends AlertTypeState = never, + InstanceState extends AlertInstanceState = never, + InstanceContext extends AlertInstanceContext = never, ActionGroupIds extends string = never, RecoveryActionGroupId extends string = never >( @@ -303,18 +302,21 @@ export class AlertingPlugin { ActionGroupIds, RecoveryActionGroupId > - ) { + ) => { if (!(ruleType.minimumLicenseRequired in LICENSE_TYPE)) { throw new Error(`"${ruleType.minimumLicenseRequired}" is not a valid license type`); } ruleType.config = getExecutionConfigForRuleType({ - config: alertingConfig.rules, + config: this.config.rules, + ruleTypeId: ruleType.id, + }); + ruleType.ruleTaskTimeout = getRuleTaskTimeout({ + config: this.config.rules, + ruleTaskTimeout: ruleType.ruleTaskTimeout, ruleTypeId: ruleType.id, }); - ruleType.ruleTaskTimeout = - ruleType.ruleTaskTimeout ?? alertingConfig.defaultRuleTaskTimeout; ruleType.cancelAlertsOnRuleTimeout = - ruleType.cancelAlertsOnRuleTimeout ?? alertingConfig.cancelAlertsOnRuleTimeout; + ruleType.cancelAlertsOnRuleTimeout ?? this.config.cancelAlertsOnRuleTimeout; ruleType.doesSetRecoveryContext = ruleType.doesSetRecoveryContext ?? false; ruleTypeRegistry.register(ruleType); }, @@ -329,7 +331,7 @@ export class AlertingPlugin { ); }, getConfig: () => { - return pick(alertingConfig.rules, 'minimumScheduleInterval'); + return pick(this.config.rules, 'minimumScheduleInterval'); }, }; } diff --git a/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts b/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts index e359e9c52dda0..19a2885dadaf7 100644 --- a/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts +++ b/x-pack/plugins/alerting/server/routes/get_rule_execution_log.test.ts @@ -11,7 +11,7 @@ import { licenseStateMock } from '../lib/license_state.mock'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { SavedObjectsErrorHelpers } from 'src/core/server'; import { rulesClientMock } from '../rules_client.mock'; -import { IExecutionLogResult } from '../lib/get_execution_log_aggregation'; +import { IExecutionLogWithErrorsResult } from '../rules_client'; const rulesClient = rulesClientMock.create(); jest.mock('../lib/license_api_access.ts', () => ({ @@ -24,7 +24,7 @@ beforeEach(() => { describe('getRuleExecutionLogRoute', () => { const dateString = new Date().toISOString(); - const mockedExecutionLog: IExecutionLogResult = { + const mockedExecutionLogWithErrors: IExecutionLogWithErrorsResult = { total: 374, data: [ { @@ -64,6 +64,22 @@ describe('getRuleExecutionLogRoute', () => { schedule_delay_ms: 3008, }, ], + totalErrors: 2, + errors: [ + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.086Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: 'c1c04f04-312e-4e23-8e36-e01eb4332ed6', + timestamp: '2022-03-23T17:23:05.249Z', + type: 'alerting', + message: `rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule' - I am erroring in rule execution!!`, + }, + ], }; it('gets rule execution log', async () => { @@ -76,7 +92,7 @@ describe('getRuleExecutionLogRoute', () => { expect(config.path).toMatchInlineSnapshot(`"/internal/alerting/rule/{id}/_execution_log"`); - rulesClient.getExecutionLogForRule.mockResolvedValue(mockedExecutionLog); + rulesClient.getExecutionLogForRule.mockResolvedValue(mockedExecutionLogWithErrors); const [context, req, res] = mockHandlerArguments( { rulesClient }, diff --git a/x-pack/plugins/alerting/server/rules_client/rules_client.ts b/x-pack/plugins/alerting/server/rules_client/rules_client.ts index 4dc1ab6ce1122..c60fce223bea7 100644 --- a/x-pack/plugins/alerting/server/rules_client/rules_client.ts +++ b/x-pack/plugins/alerting/server/rules_client/rules_client.ts @@ -92,6 +92,10 @@ import { } from '../lib/get_execution_log_aggregation'; import { validateSnoozeDate } from '../lib/validate_snooze_date'; import { RuleMutedError } from '../lib/errors/rule_muted'; +import { + formatExecutionErrorsResult, + IExecutionErrorsResult, +} from '../lib/format_execution_log_errors'; export interface RegistryAlertTypeWithAuth extends RegistryRuleType { authorizedConsumers: string[]; @@ -259,6 +263,7 @@ export interface GetExecutionLogByIdParams { sort: estypes.Sort; } +export type IExecutionLogWithErrorsResult = IExecutionLogResult & IExecutionErrorsResult; interface ScheduleRuleOptions { id: string; consumer: string; @@ -622,7 +627,6 @@ export class RulesClient { entity: AlertingAuthorizationEntity.Rule, }); - // default duration of instance summary is 60 * rule interval const dateNow = new Date(); const durationMillis = parseDuration(rule.schedule.interval) * (numberOfExecutions ?? 60); const defaultDateStart = new Date(dateNow.valueOf() - durationMillis); @@ -688,7 +692,7 @@ export class RulesClient { page, perPage, sort, - }: GetExecutionLogByIdParams): Promise { + }: GetExecutionLogByIdParams): Promise { this.logger.debug(`getExecutionLogForRule(): getting execution log for rule ${id}`); const rule = (await this.get({ id, includeLegacyId: true })) as SanitizedRuleWithLegacyId; @@ -725,23 +729,47 @@ export class RulesClient { const eventLogClient = await this.getEventLogClient(); - const results = await eventLogClient.aggregateEventsBySavedObjectIds( - 'alert', - [id], - { - start: parsedDateStart.toISOString(), - end: parsedDateEnd.toISOString(), - filter, - aggs: getExecutionLogAggregation({ - page, - perPage, - sort, - }), - }, - rule.legacyId !== null ? [rule.legacyId] : undefined - ); + try { + const [aggResult, errorResult] = await Promise.all([ + eventLogClient.aggregateEventsBySavedObjectIds( + 'alert', + [id], + { + start: parsedDateStart.toISOString(), + end: parsedDateEnd.toISOString(), + filter, + aggs: getExecutionLogAggregation({ + page, + perPage, + sort, + }), + }, + rule.legacyId !== null ? [rule.legacyId] : undefined + ), + eventLogClient.findEventsBySavedObjectIds( + 'alert', + [id], + { + start: parsedDateStart.toISOString(), + end: parsedDateEnd.toISOString(), + per_page: 500, + filter: `(event.action:execute AND event.outcome:failure) OR (event.action:execute-timeout)`, + sort: [{ sort_field: '@timestamp', sort_order: 'desc' }], + }, + rule.legacyId !== null ? [rule.legacyId] : undefined + ), + ]); - return formatExecutionLogResult(results); + return { + ...formatExecutionLogResult(aggResult), + ...formatExecutionErrorsResult(errorResult), + }; + } catch (err) { + this.logger.debug( + `rulesClient.getExecutionLogForRule(): error searching event log for rule ${id}: ${err.message}` + ); + throw err; + } } public async find({ diff --git a/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts index 8ad904bacd5d3..53c8884798325 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/get_execution_log.test.ts @@ -273,6 +273,313 @@ const aggregateResults = { }, }; +const findResults = { + page: 1, + per_page: 500, + total: 6, + data: [ + { + '@timestamp': '2022-03-23T17:37:07.106Z', + event: { + provider: 'actions', + action: 'execute', + kind: 'action', + start: '2022-03-23T17:37:07.105Z', + end: '2022-03-23T17:37:07.105Z', + duration: 0, + outcome: 'failure', + }, + kibana: { + alert: { + rule: { + execution: { + uuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + }, + }, + }, + saved_objects: [ + { + rel: 'primary', + type: 'action', + id: '9e67b8b0-9e2c-11ec-bd64-774ed95c43ef', + type_id: '.server-log', + }, + { + rel: 'primary', + type: 'alert', + id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', + type_id: 'example.always-firing', + }, + ], + task: { + scheduled: '2022-03-23T17:37:04.674Z', + schedule_delay: 2431000000, + }, + server_uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', + version: '8.2.0', + }, + message: 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s', + error: { + message: + 'an error occurred while running the action executor: something funky with the server log', + }, + ecs: { + version: '1.8.0', + }, + }, + { + '@timestamp': '2022-03-23T17:37:07.102Z', + event: { + provider: 'actions', + action: 'execute', + kind: 'action', + start: '2022-03-23T17:37:07.101Z', + end: '2022-03-23T17:37:07.102Z', + duration: 1000000, + outcome: 'failure', + }, + kibana: { + alert: { + rule: { + execution: { + uuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + }, + }, + }, + saved_objects: [ + { + rel: 'primary', + type: 'action', + id: '9e67b8b0-9e2c-11ec-bd64-774ed95c43ef', + type_id: '.server-log', + }, + { + rel: 'primary', + type: 'alert', + id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', + type_id: 'example.always-firing', + }, + ], + task: { + scheduled: '2022-03-23T17:37:04.676Z', + schedule_delay: 2425000000, + }, + server_uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', + version: '8.2.0', + }, + message: 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s', + error: { + message: + 'an error occurred while running the action executor: something funky with the server log', + }, + ecs: { + version: '1.8.0', + }, + }, + { + '@timestamp': '2022-03-23T17:37:07.098Z', + event: { + provider: 'actions', + action: 'execute', + kind: 'action', + start: '2022-03-23T17:37:07.098Z', + end: '2022-03-23T17:37:07.098Z', + duration: 0, + outcome: 'failure', + }, + kibana: { + alert: { + rule: { + execution: { + uuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + }, + }, + }, + saved_objects: [ + { + rel: 'primary', + type: 'action', + id: '9e67b8b0-9e2c-11ec-bd64-774ed95c43ef', + type_id: '.server-log', + }, + { + rel: 'primary', + type: 'alert', + id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', + type_id: 'example.always-firing', + }, + ], + task: { + scheduled: '2022-03-23T17:37:04.673Z', + schedule_delay: 2425000000, + }, + server_uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', + version: '8.2.0', + }, + message: 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s', + error: { + message: + 'an error occurred while running the action executor: something funky with the server log', + }, + ecs: { + version: '1.8.0', + }, + }, + { + '@timestamp': '2022-03-23T17:37:07.096Z', + event: { + provider: 'actions', + action: 'execute', + kind: 'action', + start: '2022-03-23T17:37:07.095Z', + end: '2022-03-23T17:37:07.096Z', + duration: 1000000, + outcome: 'failure', + }, + kibana: { + alert: { + rule: { + execution: { + uuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + }, + }, + }, + saved_objects: [ + { + rel: 'primary', + type: 'action', + id: '9e67b8b0-9e2c-11ec-bd64-774ed95c43ef', + type_id: '.server-log', + }, + { + rel: 'primary', + type: 'alert', + id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', + type_id: 'example.always-firing', + }, + ], + task: { + scheduled: '2022-03-23T17:37:04.677Z', + schedule_delay: 2418000000, + }, + server_uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', + version: '8.2.0', + }, + message: 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s', + error: { + message: + 'an error occurred while running the action executor: something funky with the server log', + }, + ecs: { + version: '1.8.0', + }, + }, + { + '@timestamp': '2022-03-23T17:37:07.086Z', + event: { + provider: 'actions', + action: 'execute', + kind: 'action', + start: '2022-03-23T17:37:07.084Z', + end: '2022-03-23T17:37:07.086Z', + duration: 2000000, + outcome: 'failure', + }, + kibana: { + alert: { + rule: { + execution: { + uuid: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + }, + }, + }, + saved_objects: [ + { + rel: 'primary', + type: 'action', + id: '9e67b8b0-9e2c-11ec-bd64-774ed95c43ef', + type_id: '.server-log', + }, + { + rel: 'primary', + type: 'alert', + id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', + type_id: 'example.always-firing', + }, + ], + task: { + scheduled: '2022-03-23T17:37:04.678Z', + schedule_delay: 2406000000, + }, + server_uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', + version: '8.2.0', + }, + message: 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s', + error: { + message: + 'an error occurred while running the action executor: something funky with the server log', + }, + ecs: { + version: '1.8.0', + }, + }, + { + '@timestamp': '2022-03-23T17:23:05.249Z', + event: { + provider: 'alerting', + action: 'execute', + kind: 'alert', + category: ['AlertingExample'], + start: '2022-03-23T17:23:05.131Z', + outcome: 'failure', + end: '2022-03-23T17:23:05.248Z', + duration: 117000000, + reason: 'execute', + }, + kibana: { + alert: { + rule: { + execution: { + uuid: 'c1c04f04-312e-4e23-8e36-e01eb4332ed6', + }, + }, + }, + saved_objects: [ + { + rel: 'primary', + type: 'alert', + id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', + type_id: 'example.always-firing', + }, + ], + task: { + scheduled: '2022-03-23T17:22:23.618Z', + schedule_delay: 41512000000, + }, + alerting: { + status: 'error', + }, + server_uuid: '5b2de169-2785-441b-ae8c-186a1936b17d', + version: '8.2.0', + }, + rule: { + id: 'a348a740-9e2c-11ec-bd64-774ed95c43ef', + license: 'basic', + category: 'example.always-firing', + ruleset: 'AlertingExample', + }, + message: + "rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule'", + error: { + message: 'I am erroring in rule execution!!', + }, + ecs: { + version: '1.8.0', + }, + }, + ], +}; + function getRuleSavedObject(attributes: Partial = {}): SavedObject { return { ...BaseRuleSavedObject, @@ -301,6 +608,7 @@ describe('getExecutionLogForRule()', () => { const ruleSO = getRuleSavedObject({}); unsecuredSavedObjectsClient.get.mockResolvedValueOnce(ruleSO); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); const result = await rulesClient.getExecutionLogForRule(getExecutionLogByIdParams()); expect(result).toEqual({ @@ -343,6 +651,50 @@ describe('getExecutionLogForRule()', () => { schedule_delay_ms: 3345, }, ], + totalErrors: 6, + errors: [ + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.106Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.102Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.098Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.096Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: '08d9b0f5-0b41-47c9-951f-a666b5788ddc', + timestamp: '2022-03-23T17:37:07.086Z', + type: 'actions', + message: + 'action execution failure: .server-log:9e67b8b0-9e2c-11ec-bd64-774ed95c43ef: s - an error occurred while running the action executor: something funky with the server log', + }, + { + id: 'c1c04f04-312e-4e23-8e36-e01eb4332ed6', + timestamp: '2022-03-23T17:23:05.249Z', + type: 'alerting', + message: `rule execution failure: example.always-firing:a348a740-9e2c-11ec-bd64-774ed95c43ef: 'test rule' - I am erroring in rule execution!!`, + }, + ], }); }); @@ -353,6 +705,7 @@ describe('getExecutionLogForRule()', () => { test('calls saved objects and event log client with default params', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); await rulesClient.getExecutionLogForRule(getExecutionLogByIdParams()); @@ -372,6 +725,19 @@ describe('getExecutionLogForRule()', () => { }, undefined, ]); + expect(eventLogClient.findEventsBySavedObjectIds).toHaveBeenCalledTimes(1); + expect(eventLogClient.findEventsBySavedObjectIds.mock.calls[0]).toEqual([ + 'alert', + ['1'], + { + per_page: 500, + filter: `(event.action:execute AND event.outcome:failure) OR (event.action:execute-timeout)`, + sort: [{ sort_field: '@timestamp', sort_order: 'desc' }], + end: mockedDateString, + start: '2019-02-12T20:01:22.479Z', + }, + undefined, + ]); }); test('calls event log client with legacy ids param', async () => { @@ -379,6 +745,7 @@ describe('getExecutionLogForRule()', () => { getRuleSavedObject({ legacyId: '99999' }) ); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); await rulesClient.getExecutionLogForRule(getExecutionLogByIdParams()); @@ -398,11 +765,25 @@ describe('getExecutionLogForRule()', () => { }, ['99999'], ]); + expect(eventLogClient.findEventsBySavedObjectIds).toHaveBeenCalledTimes(1); + expect(eventLogClient.findEventsBySavedObjectIds.mock.calls[0]).toEqual([ + 'alert', + ['1'], + { + per_page: 500, + filter: `(event.action:execute AND event.outcome:failure) OR (event.action:execute-timeout)`, + sort: [{ sort_field: '@timestamp', sort_order: 'desc' }], + end: mockedDateString, + start: '2019-02-12T20:01:22.479Z', + }, + ['99999'], + ]); }); test('calls event log client with end date if specified', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); await rulesClient.getExecutionLogForRule( getExecutionLogByIdParams({ dateEnd: new Date(Date.now() - 2700000).toISOString() }) @@ -424,11 +805,25 @@ describe('getExecutionLogForRule()', () => { }, undefined, ]); + expect(eventLogClient.findEventsBySavedObjectIds).toHaveBeenCalledTimes(1); + expect(eventLogClient.findEventsBySavedObjectIds.mock.calls[0]).toEqual([ + 'alert', + ['1'], + { + per_page: 500, + filter: `(event.action:execute AND event.outcome:failure) OR (event.action:execute-timeout)`, + sort: [{ sort_field: '@timestamp', sort_order: 'desc' }], + end: '2019-02-12T20:16:22.479Z', + start: '2019-02-12T20:01:22.479Z', + }, + undefined, + ]); }); test('calls event log client with filter if specified', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); await rulesClient.getExecutionLogForRule( getExecutionLogByIdParams({ filter: 'event.outcome: success' }) @@ -451,11 +846,25 @@ describe('getExecutionLogForRule()', () => { }, undefined, ]); + expect(eventLogClient.findEventsBySavedObjectIds).toHaveBeenCalledTimes(1); + expect(eventLogClient.findEventsBySavedObjectIds.mock.calls[0]).toEqual([ + 'alert', + ['1'], + { + per_page: 500, + filter: `(event.action:execute AND event.outcome:failure) OR (event.action:execute-timeout)`, + sort: [{ sort_field: '@timestamp', sort_order: 'desc' }], + end: mockedDateString, + start: '2019-02-12T20:01:22.479Z', + }, + undefined, + ]); }); test('invalid start date throws an error', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); const dateStart = 'ain"t no way this will get parsed as a date'; expect( @@ -468,6 +877,7 @@ describe('getExecutionLogForRule()', () => { test('invalid end date throws an error', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); const dateEnd = 'ain"t no way this will get parsed as a date'; expect( @@ -480,6 +890,7 @@ describe('getExecutionLogForRule()', () => { test('invalid page value throws an error', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); expect( rulesClient.getExecutionLogForRule(getExecutionLogByIdParams({ page: -3 })) @@ -489,6 +900,7 @@ describe('getExecutionLogForRule()', () => { test('invalid perPage value throws an error', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); expect( rulesClient.getExecutionLogForRule(getExecutionLogByIdParams({ perPage: -3 })) @@ -498,6 +910,7 @@ describe('getExecutionLogForRule()', () => { test('invalid sort value throws an error', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); expect( rulesClient.getExecutionLogForRule( @@ -511,6 +924,7 @@ describe('getExecutionLogForRule()', () => { test('throws error when saved object get throws an error', async () => { unsecuredSavedObjectsClient.get.mockRejectedValueOnce(new Error('OMG!')); eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); expect( rulesClient.getExecutionLogForRule(getExecutionLogByIdParams()) @@ -520,12 +934,23 @@ describe('getExecutionLogForRule()', () => { test('throws error when eventLog.aggregateEventsBySavedObjectIds throws an error', async () => { unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); eventLogClient.aggregateEventsBySavedObjectIds.mockRejectedValueOnce(new Error('OMG 2!')); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); expect( rulesClient.getExecutionLogForRule(getExecutionLogByIdParams()) ).rejects.toMatchInlineSnapshot(`[Error: OMG 2!]`); }); + test('throws error when eventLog.findEventsBySavedObjectIds throws an error', async () => { + unsecuredSavedObjectsClient.get.mockResolvedValueOnce(getRuleSavedObject()); + eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockRejectedValueOnce(new Error('OMG 3!')); + + expect( + rulesClient.getExecutionLogForRule(getExecutionLogByIdParams()) + ).rejects.toMatchInlineSnapshot(`[Error: OMG 3!]`); + }); + describe('authorization', () => { beforeEach(() => { const ruleSO = getRuleSavedObject({}); @@ -534,6 +959,7 @@ describe('getExecutionLogForRule()', () => { test('ensures user is authorised to get this type of alert under the consumer', async () => { eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); await rulesClient.getExecutionLogForRule(getExecutionLogByIdParams()); expect(authorization.ensureAuthorized).toHaveBeenCalledWith({ @@ -570,6 +996,7 @@ describe('getExecutionLogForRule()', () => { test('logs audit event when getting a rule execution log', async () => { eventLogClient.aggregateEventsBySavedObjectIds.mockResolvedValueOnce(aggregateResults); + eventLogClient.findEventsBySavedObjectIds.mockResolvedValueOnce(findResults); await rulesClient.getExecutionLogForRule(getExecutionLogByIdParams()); expect(auditLogger.log).toHaveBeenCalledWith( expect.objectContaining({ diff --git a/x-pack/plugins/alerting/server/task_runner/create_execution_handler.test.ts b/x-pack/plugins/alerting/server/task_runner/create_execution_handler.test.ts index 7d02535566cac..8b97bf9266e9a 100644 --- a/x-pack/plugins/alerting/server/task_runner/create_execution_handler.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/create_execution_handler.test.ts @@ -127,6 +127,7 @@ describe('Create Execution Handler', () => { ); alertExecutionStore = { numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, triggeredActionsStatus: ActionsCompletion.COMPLETE, }; }); @@ -512,6 +513,7 @@ describe('Create Execution Handler', () => { alertExecutionStore = { numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, triggeredActionsStatus: ActionsCompletion.COMPLETE, }; @@ -524,6 +526,7 @@ describe('Create Execution Handler', () => { }); expect(alertExecutionStore.numberOfTriggeredActions).toBe(2); + expect(alertExecutionStore.numberOfScheduledActions).toBe(3); expect(alertExecutionStore.triggeredActionsStatus).toBe(ActionsCompletion.PARTIAL); expect(actionsClient.enqueueExecution).toHaveBeenCalledTimes(2); }); diff --git a/x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts b/x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts index 279afee0e42c6..56e1a25cb0655 100644 --- a/x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts +++ b/x-pack/plugins/alerting/server/task_runner/create_execution_handler.ts @@ -112,6 +112,8 @@ export function createExecutionHandler< }), })); + alertExecutionStore.numberOfScheduledActions += actions.length; + const ruleLabel = `${ruleType.id}:${ruleId}: '${ruleName}'`; const actionsClient = await actionsPlugin.getActionsClientWithRequest(request); @@ -132,6 +134,8 @@ export function createExecutionHandler< continue; } + alertExecutionStore.numberOfTriggeredActions++; + const namespace = spaceId === 'default' ? {} : { namespace: spaceId }; const enqueueOptions = { @@ -165,12 +169,9 @@ export function createExecutionHandler< if (isEphemeralTaskRejectedDueToCapacityError(err)) { await actionsClient.enqueueExecution(enqueueOptions); } - } finally { - alertExecutionStore.numberOfTriggeredActions++; } } else { await actionsClient.enqueueExecution(enqueueOptions); - alertExecutionStore.numberOfTriggeredActions++; } const event = createAlertEventLogRecordObject({ diff --git a/x-pack/plugins/alerting/server/task_runner/fixtures.ts b/x-pack/plugins/alerting/server/task_runner/fixtures.ts index 4e38be4834c86..d8db61cdddc0d 100644 --- a/x-pack/plugins/alerting/server/task_runner/fixtures.ts +++ b/x-pack/plugins/alerting/server/task_runner/fixtures.ts @@ -211,6 +211,7 @@ export const generateEventLog = ({ actionId, status, numberOfTriggeredActions, + numberOfScheduledActions, savedObjects = [generateAlertSO('1')], }: GeneratorParams = {}) => ({ ...(status === 'error' && { @@ -234,9 +235,10 @@ export const generateEventLog = ({ ...(consumer && { consumer }), execution: { uuid: '5f6aa57d-3e22-484e-bae8-cbed868f4d28', - ...(!isNil(numberOfTriggeredActions) && { + ...((!isNil(numberOfTriggeredActions) || !isNil(numberOfScheduledActions)) && { metrics: { number_of_triggered_actions: numberOfTriggeredActions, + number_of_scheduled_actions: numberOfScheduledActions, number_of_searches: 3, es_search_duration_ms: 33, total_search_duration_ms: 23423, diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts index 2227a34dfa111..3eed02bb10e31 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.test.ts @@ -232,7 +232,7 @@ describe('Task Runner', () => { expect(logger.debug).nthCalledWith(1, 'executing rule test:1 at 1970-01-01T00:00:00.000Z'); expect(logger.debug).nthCalledWith( 2, - 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":0,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"ok"}' + 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":0,"numberOfScheduledActions":0,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"ok"}' ); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; @@ -312,7 +312,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 3, - 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":1,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' + 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":1,"numberOfScheduledActions":1,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' ); const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; @@ -368,6 +368,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 1, + numberOfScheduledActions: 1, task: true, consumer: 'bar', }) @@ -419,7 +420,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 4, - 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":0,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' + 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":0,"numberOfScheduledActions":0,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' ); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; @@ -462,6 +463,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, task: true, consumer: 'bar', }) @@ -583,7 +585,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 4, - 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":1,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' + 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":1,"numberOfScheduledActions":1,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' ); expect(mockUsageCounter.incrementCounter).not.toHaveBeenCalled(); } @@ -772,6 +774,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, task: true, consumer: 'bar', }) @@ -836,6 +839,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 1, + numberOfScheduledActions: 1, task: true, consumer: 'bar', }) @@ -909,6 +913,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 1, + numberOfScheduledActions: 1, task: true, consumer: 'bar', }) @@ -1026,6 +1031,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 1, + numberOfScheduledActions: 1, task: true, consumer: 'bar', }) @@ -1107,7 +1113,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 4, - 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":2,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' + 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":2,"numberOfScheduledActions":2,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' ); const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; @@ -1174,6 +1180,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 2, + numberOfScheduledActions: 2, task: true, consumer: 'bar', }) @@ -1247,7 +1254,7 @@ describe('Task Runner', () => { ); expect(logger.debug).nthCalledWith( 4, - `ruleExecutionStatus for test:${alertId}: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":2,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}` + `ruleExecutionStatus for test:${alertId}: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":2,"numberOfScheduledActions":2,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}` ); const eventLogger = customTaskRunnerFactoryInitializerParams.eventLogger; @@ -1435,6 +1442,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 0, + numberOfScheduledActions: 2, task: true, consumer: 'bar', }) @@ -2040,6 +2048,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, task: true, consumer: 'bar', }) @@ -2142,6 +2151,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'active', numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, task: true, consumer: 'bar', }) @@ -2233,6 +2243,7 @@ describe('Task Runner', () => { status: 'active', consumer: 'bar', numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, task: true, }) ); @@ -2322,6 +2333,7 @@ describe('Task Runner', () => { status: 'ok', consumer: 'bar', numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, task: true, }) ); @@ -2407,6 +2419,7 @@ describe('Task Runner', () => { status: 'ok', consumer: 'bar', numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, task: true, }) ); @@ -2468,7 +2481,7 @@ describe('Task Runner', () => { expect(logger.debug).nthCalledWith(1, 'executing rule test:1 at 1970-01-01T00:00:00.000Z'); expect(logger.debug).nthCalledWith( 2, - 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":0,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"ok"}' + 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":0,"numberOfScheduledActions":0,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"ok"}' ); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; @@ -2657,35 +2670,37 @@ describe('Task Runner', () => { } ); + const mockActions = [ + { + group: 'default', + id: '1', + actionTypeId: 'action', + }, + { + group: 'default', + id: '2', + actionTypeId: 'action', + }, + { + group: 'default', + id: '3', + actionTypeId: 'action', + }, + { + group: 'default', + id: '4', + actionTypeId: 'action', + }, + { + group: 'default', + id: '5', + actionTypeId: 'action', + }, + ]; + rulesClient.get.mockResolvedValue({ ...mockedRuleTypeSavedObject, - actions: [ - { - group: 'default', - id: '1', - actionTypeId: 'action', - }, - { - group: 'default', - id: '2', - actionTypeId: 'action', - }, - { - group: 'default', - id: '3', - actionTypeId: 'action', - }, - { - group: 'default', - id: '4', - actionTypeId: 'action', - }, - { - group: 'default', - id: '5', - actionTypeId: 'action', - }, - ], + actions: mockActions, } as jest.ResolvedValue); ruleTypeRegistry.get.mockReturnValue(ruleTypeWithConfig); encryptedSavedObjectsClient.getDecryptedAsInternalUser.mockResolvedValueOnce(SAVED_OBJECT); @@ -2801,6 +2816,7 @@ describe('Task Runner', () => { outcome: 'success', status: 'warning', numberOfTriggeredActions: ruleTypeWithConfig.config.execution.actions.max, + numberOfScheduledActions: mockActions.length, reason: AlertExecutionStatusWarningReasons.MAX_EXECUTABLE_ACTIONS, task: true, consumer: 'bar', diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner.ts b/x-pack/plugins/alerting/server/task_runner/task_runner.ts index b7980f612e7b9..1ddca46d17418 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner.ts @@ -492,6 +492,7 @@ export class TaskRunner< const alertExecutionStore: AlertExecutionStore = { numberOfTriggeredActions: 0, + numberOfScheduledActions: 0, triggeredActionsStatus: ActionsCompletion.COMPLETE, }; @@ -816,7 +817,12 @@ export class TaskRunner< set( event, 'kibana.alert.rule.execution.metrics.number_of_triggered_actions', - executionStatus.numberOfTriggeredActions ?? 0 + executionStatus.numberOfTriggeredActions + ); + set( + event, + 'kibana.alert.rule.execution.metrics.number_of_scheduled_actions', + executionStatus.numberOfScheduledActions ); } diff --git a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts index e60e4e9295a5c..39d2aa8418394 100644 --- a/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts +++ b/x-pack/plugins/alerting/server/task_runner/task_runner_cancel.test.ts @@ -330,6 +330,7 @@ describe('Task Runner Cancel', () => { metrics: { number_of_searches: 3, number_of_triggered_actions: 0, + number_of_scheduled_actions: 0, es_search_duration_ms: 33, total_search_duration_ms: 23423, }, @@ -519,7 +520,7 @@ describe('Task Runner Cancel', () => { ); expect(logger.debug).nthCalledWith( 7, - 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":0,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' + 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":0,"numberOfScheduledActions":0,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' ); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; @@ -613,6 +614,7 @@ describe('Task Runner Cancel', () => { metrics: { number_of_searches: 3, number_of_triggered_actions: 0, + number_of_scheduled_actions: 0, es_search_duration_ms: 33, total_search_duration_ms: 23423, }, @@ -678,7 +680,7 @@ describe('Task Runner Cancel', () => { ); expect(logger.debug).nthCalledWith( 6, - 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":1,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' + 'ruleExecutionStatus for test:1: {"metrics":{"numSearches":3,"esSearchDurationMs":33,"totalSearchDurationMs":23423},"numberOfTriggeredActions":1,"numberOfScheduledActions":1,"lastExecutionDate":"1970-01-01T00:00:00.000Z","status":"active"}' ); const eventLogger = taskRunnerFactoryInitializerParams.eventLogger; @@ -891,6 +893,7 @@ describe('Task Runner Cancel', () => { metrics: { number_of_searches: 3, number_of_triggered_actions: 1, + number_of_scheduled_actions: 1, es_search_duration_ms: 33, total_search_duration_ms: 23423, }, diff --git a/x-pack/plugins/alerting/server/task_runner/types.ts b/x-pack/plugins/alerting/server/task_runner/types.ts index 00878c2980a8c..d8483139a92b9 100644 --- a/x-pack/plugins/alerting/server/task_runner/types.ts +++ b/x-pack/plugins/alerting/server/task_runner/types.ts @@ -163,5 +163,6 @@ export enum ActionsCompletion { export interface AlertExecutionStore { numberOfTriggeredActions: number; + numberOfScheduledActions: number; triggeredActionsStatus: ActionsCompletion; } diff --git a/x-pack/plugins/alerting/server/types.ts b/x-pack/plugins/alerting/server/types.ts index 8dcc403613577..37df778b6185a 100644 --- a/x-pack/plugins/alerting/server/types.ts +++ b/x-pack/plugins/alerting/server/types.ts @@ -195,7 +195,6 @@ export interface AlertMeta extends SavedObjectAttributes { // delete any previous error if the current status has no error export interface RawRuleExecutionStatus extends SavedObjectAttributes { status: AlertExecutionStatuses; - numberOfTriggeredActions?: number; lastExecutionDate: string; lastDuration?: number; error: null | { diff --git a/x-pack/plugins/apm/common/fleet.ts b/x-pack/plugins/apm/common/fleet.ts index 183192e6bd1da..ed148b2230011 100644 --- a/x-pack/plugins/apm/common/fleet.ts +++ b/x-pack/plugins/apm/common/fleet.ts @@ -4,12 +4,61 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import semverParse from 'semver/functions/parse'; - export const POLICY_ELASTIC_AGENT_ON_CLOUD = 'policy-elastic-agent-on-cloud'; -export const SUPPORTED_APM_PACKAGE_VERSION = '8.1.0'; +export const INPUT_VAR_NAME_TO_SCHEMA_PATH: Record = { + host: 'apm-server.host', + url: 'apm-server.url', + enable_rum: 'apm-server.rum.enabled', + default_service_environment: 'apm-server.default_service_environment', + rum_allow_origins: 'apm-server.rum.allow_origins', + rum_allow_headers: 'apm-server.rum.allow_headers', + rum_event_rate_limit: 'apm-server.rum.event_rate.limit', + rum_allow_service_names: 'apm-server.rum.allow_service_names', + rum_event_rate_lru_size: 'apm-server.rum.event_rate.lru_size', + rum_response_headers: 'apm-server.rum.response_headers', + rum_library_pattern: 'apm-server.rum.library_pattern', + rum_exclude_from_grouping: 'apm-server.rum.exclude_from_grouping', + max_event_bytes: 'apm-server.max_event_size', + capture_personal_data: 'apm-server.capture_personal_data', + max_header_bytes: 'apm-server.max_header_size', + idle_timeout: 'apm-server.idle_timeout', + read_timeout: 'apm-server.read_timeout', + shutdown_timeout: 'apm-server.shutdown_timeout', + write_timeout: 'apm-server.write_timeout', + max_connections: 'apm-server.max_connections', + response_headers: 'apm-server.response_headers', + expvar_enabled: 'apm-server.expvar.enabled', + tls_enabled: 'apm-server.ssl.enabled', + tls_certificate: 'apm-server.ssl.certificate', + tls_key: 'apm-server.ssl.key', + tls_supported_protocols: 'apm-server.ssl.supported_protocols', + tls_cipher_suites: 'apm-server.ssl.cipher_suites', + tls_curve_types: 'apm-server.ssl.curve_types', + secret_token: 'apm-server.auth.secret_token', + api_key_enabled: 'apm-server.auth.api_key.enabled', + api_key_limit: 'apm-server.auth.api_key.limit', + anonymous_enabled: 'apm-server.auth.anonymous.enabled', + anonymous_allow_agent: 'apm-server.auth.anonymous.allow_agent', + anonymous_allow_service: 'apm-server.auth.anonymous.allow_service', + anonymous_rate_limit_ip_limit: + 'apm-server.auth.anonymous.rate_limit.ip_limit', + anonymous_rate_limit_event_limit: + 'apm-server.auth.anonymous.rate_limit.event_limit', + tail_sampling_enabled: 'apm-server.sampling.tail.enabled', + tail_sampling_interval: 'apm-server.sampling.tail.interval', + tail_sampling_policies: 'apm-server.sampling.tail.policies', +}; + +export const LEGACY_TO_CURRENT_SCHEMA_PATHS: Record = { + 'apm-server.rum.event_rate.limit': + 'apm-server.auth.anonymous.rate_limit.event_limit', + 'apm-server.rum.event_rate.lru_size': + 'apm-server.auth.anonymous.rate_limit.ip_limit', + 'apm-server.rum.allow_service_names': + 'apm-server.auth.anonymous.allow_service', + 'apm-server.secret_token': 'apm-server.auth.secret_token', + 'apm-server.api_key.enabled': 'apm-server.auth.api_key.enabled', +}; -export function isPrereleaseVersion(version: string) { - return semverParse(version)?.prerelease?.length ?? 0 > 0; -} +export const ELASTIC_CLOUD_APM_AGENT_POLICY_ID = 'elastic-cloud-apm'; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/series_type.ts b/x-pack/plugins/apm/common/offset_rt.ts similarity index 51% rename from x-pack/plugins/lens/common/expressions/xy_chart/series_type.ts rename to x-pack/plugins/apm/common/offset_rt.ts index f9a375b8b47a1..68ac7f25f66e3 100644 --- a/x-pack/plugins/lens/common/expressions/xy_chart/series_type.ts +++ b/x-pack/plugins/apm/common/offset_rt.ts @@ -5,14 +5,6 @@ * 2.0. */ -export type SeriesType = - | 'bar' - | 'bar_horizontal' - | 'line' - | 'area' - | 'bar_stacked' - | 'bar_percentage_stacked' - | 'bar_horizontal_stacked' - | 'bar_horizontal_percentage_stacked' - | 'area_stacked' - | 'area_percentage_stacked'; +import * as t from 'io-ts'; + +export const offsetRt = t.partial({ offset: t.string }); diff --git a/x-pack/plugins/apm/common/runtime_types/comparison_type_rt.ts b/x-pack/plugins/apm/common/runtime_types/comparison_type_rt.ts deleted file mode 100644 index 93c0a31c40cde..0000000000000 --- a/x-pack/plugins/apm/common/runtime_types/comparison_type_rt.ts +++ /dev/null @@ -1,21 +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 * as t from 'io-ts'; - -export enum TimeRangeComparisonEnum { - WeekBefore = 'week', - DayBefore = 'day', - PeriodBefore = 'period', -} - -export const comparisonTypeRt = t.union([ - t.literal('day'), - t.literal('week'), - t.literal('period'), -]); - -export type TimeRangeComparisonType = t.TypeOf; diff --git a/x-pack/plugins/apm/common/service_inventory.ts b/x-pack/plugins/apm/common/service_inventory.ts index b7c8c0ea90a58..022980b6c8193 100644 --- a/x-pack/plugins/apm/common/service_inventory.ts +++ b/x-pack/plugins/apm/common/service_inventory.ts @@ -18,3 +18,13 @@ export interface ServiceListItem { transactionErrorRate?: number | null; environments?: string[]; } + +export enum ServiceInventoryFieldName { + ServiceName = 'serviceName', + HealthStatus = 'healthStatus', + Environments = 'environments', + TransactionType = 'transactionType', + Throughput = 'throughput', + Latency = 'latency', + TransactionErrorRate = 'transactionErrorRate', +} diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/service_overview.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/service_overview.spec.ts index fcd9e472cc7eb..4dd66f6dd9311 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/service_overview.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/service_overview.spec.ts @@ -265,7 +265,7 @@ describe('Service Overview', () => { ); cy.expectAPIsToHaveBeenCalledWith({ apisIntercepted: aliasNamesWithComparison, - value: 'comparisonStart', + value: 'offset', }); }); }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/time_comparison.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/time_comparison.spec.ts index d513dcaef6842..955b429a567a7 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/time_comparison.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/time_comparison.spec.ts @@ -70,7 +70,7 @@ describe('Service overview: Time Comparison', () => { it('enables by default the time comparison feature with Last 24 hours selected', () => { cy.visit(serviceOverviewPath); - cy.url().should('include', 'comparisonEnabled=true&comparisonType=day'); + cy.url().should('include', 'comparisonEnabled=true&offset=1d'); }); describe('when comparison is toggled off', () => { @@ -94,17 +94,13 @@ describe('Service overview: Time Comparison', () => { cy.contains('opbeans-java'); cy.get('[data-test-subj="comparisonSelect"]').should('be.enabled'); - const comparisonStartEnd = `comparisonStart=${encodeURIComponent( - moment(start).subtract(1, 'day').toISOString() - )}&comparisonEnd=${encodeURIComponent( - moment(end).subtract(1, 'day').toISOString() - )}`; + const offset = `offset=1d`; // When the page loads it fetches all APIs with comparison time range cy.wait(apisToIntercept.map(({ name }) => `@${name}`)).then( (interceptions) => { interceptions.map((interception) => { - expect(interception.request.url).include(comparisonStartEnd); + expect(interception.request.url).include(offset); }); } ); @@ -116,7 +112,7 @@ describe('Service overview: Time Comparison', () => { cy.wait(apisToIntercept.map(({ name }) => `@${name}`)).then( (interceptions) => { interceptions.map((interception) => { - expect(interception.request.url).not.include(comparisonStartEnd); + expect(interception.request.url).not.include(offset); }); } ); diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_detail_dependencies_table.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_detail_dependencies_table.tsx index ee71e4d8c8674..ee0353529e7b0 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_detail_dependencies_table.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_detail_dependencies_table.tsx @@ -10,7 +10,6 @@ import React from 'react'; import { getNodeName, NodeType } from '../../../../common/connections'; import { useApmParams } from '../../../hooks/use_apm_params'; import { useFetcher } from '../../../hooks/use_fetcher'; -import { getTimeRangeComparison } from '../../shared/time_comparison/get_time_range_comparison'; import { DependenciesTable } from '../../shared/dependencies_table'; import { ServiceLink } from '../../shared/service_link'; import { useTimeRange } from '../../../hooks/use_time_range'; @@ -24,19 +23,12 @@ export function BackendDetailDependenciesTable() { kuery, environment, comparisonEnabled, - comparisonType, + offset, }, } = useApmParams('/backends/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonEnabled, - comparisonType, - }); - const { data, status } = useFetcher( (callApmApi) => { if (!start || !end) { @@ -51,13 +43,13 @@ export function BackendDetailDependenciesTable() { end, environment, numBuckets: 20, - offset, + offset: comparisonEnabled ? offset : undefined, kuery, }, }, }); }, - [start, end, environment, offset, backendName, kuery] + [start, end, environment, offset, backendName, kuery, comparisonEnabled] ); const dependencies = @@ -79,7 +71,7 @@ export function BackendDetailDependenciesTable() { agentName={location.agentName} query={{ comparisonEnabled, - comparisonType, + offset, environment, kuery, rangeFrom, diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_error_rate_chart.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_error_rate_chart.tsx index 5ecb41829f06c..550d1a1792473 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_error_rate_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_error_rate_chart.tsx @@ -16,10 +16,7 @@ import { ChartType, getTimeSeriesColor, } from '../../shared/charts/helper/get_timeseries_color'; -import { - getComparisonChartTheme, - getTimeRangeComparison, -} from '../../shared/time_comparison/get_time_range_comparison'; +import { getComparisonChartTheme } from '../../shared/time_comparison/get_comparison_chart_theme'; function yLabelFormat(y?: number | null) { return asPercent(y || 0, 1); @@ -37,20 +34,14 @@ export function BackendFailedTransactionRateChart({ environment, rangeFrom, rangeTo, + offset, comparisonEnabled, - comparisonType, }, } = useApmParams('/backends/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const comparisonChartTheme = getComparisonChartTheme(); - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const { data, status } = useFetcher( (callApmApi) => { @@ -64,14 +55,14 @@ export function BackendFailedTransactionRateChart({ backendName, start, end, - offset, + offset: comparisonEnabled ? offset : undefined, kuery, environment, }, }, }); }, - [backendName, start, end, offset, kuery, environment] + [backendName, start, end, offset, kuery, environment, comparisonEnabled] ); const { currentPeriodColor, previousPeriodColor } = getTimeSeriesColor( diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_latency_chart.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_latency_chart.tsx index 8289ac01b7b27..f4ccce9f4e8ca 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_latency_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_latency_chart.tsx @@ -20,10 +20,7 @@ import { ChartType, getTimeSeriesColor, } from '../../shared/charts/helper/get_timeseries_color'; -import { - getComparisonChartTheme, - getTimeRangeComparison, -} from '../../shared/time_comparison/get_time_range_comparison'; +import { getComparisonChartTheme } from '../../shared/time_comparison/get_comparison_chart_theme'; export function BackendLatencyChart({ height }: { height: number }) { const { @@ -33,20 +30,14 @@ export function BackendLatencyChart({ height }: { height: number }) { rangeTo, kuery, environment, + offset, comparisonEnabled, - comparisonType, }, } = useApmParams('/backends/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const comparisonChartTheme = getComparisonChartTheme(); - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const { data, status } = useFetcher( (callApmApi) => { @@ -60,14 +51,14 @@ export function BackendLatencyChart({ height }: { height: number }) { backendName, start, end, - offset, + offset: comparisonEnabled ? offset : undefined, kuery, environment, }, }, }); }, - [backendName, start, end, offset, kuery, environment] + [backendName, start, end, offset, kuery, environment, comparisonEnabled] ); const { currentPeriodColor, previousPeriodColor } = getTimeSeriesColor( diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_throughput_chart.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_throughput_chart.tsx index c8a37146d60a4..8d7cb9b2903b1 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_throughput_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/backend_throughput_chart.tsx @@ -16,10 +16,7 @@ import { ChartType, getTimeSeriesColor, } from '../../shared/charts/helper/get_timeseries_color'; -import { - getComparisonChartTheme, - getTimeRangeComparison, -} from '../../shared/time_comparison/get_time_range_comparison'; +import { getComparisonChartTheme } from '../../shared/time_comparison/get_comparison_chart_theme'; export function BackendThroughputChart({ height }: { height: number }) { const { @@ -29,20 +26,14 @@ export function BackendThroughputChart({ height }: { height: number }) { rangeTo, kuery, environment, + offset, comparisonEnabled, - comparisonType, }, } = useApmParams('/backends/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const comparisonChartTheme = getComparisonChartTheme(); - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const { data, status } = useFetcher( (callApmApi) => { @@ -56,14 +47,14 @@ export function BackendThroughputChart({ height }: { height: number }) { backendName, start, end, - offset, + offset: comparisonEnabled ? offset : undefined, kuery, environment, }, }, }); }, - [backendName, start, end, offset, kuery, environment] + [backendName, start, end, offset, kuery, environment, comparisonEnabled] ); const { currentPeriodColor, previousPeriodColor } = getTimeSeriesColor( diff --git a/x-pack/plugins/apm/public/components/app/backend_detail_overview/index.tsx b/x-pack/plugins/apm/public/components/app/backend_detail_overview/index.tsx index 6823b571e9597..811f8979c8c96 100644 --- a/x-pack/plugins/apm/public/components/app/backend_detail_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_detail_overview/index.tsx @@ -38,6 +38,7 @@ export function BackendDetailOverview() { refreshPaused, environment, kuery, + comparisonEnabled, }, } = useApmParams('/backends/overview'); @@ -54,6 +55,7 @@ export function BackendDetailOverview() { refreshPaused, environment, kuery, + comparisonEnabled, }, }), }, @@ -68,6 +70,7 @@ export function BackendDetailOverview() { refreshPaused, environment, kuery, + comparisonEnabled, }, }), }, diff --git a/x-pack/plugins/apm/public/components/app/backend_inventory/backend_inventory_dependencies_table/index.tsx b/x-pack/plugins/apm/public/components/app/backend_inventory/backend_inventory_dependencies_table/index.tsx index fa7cf4a3ba242..f471777d965ef 100644 --- a/x-pack/plugins/apm/public/components/app/backend_inventory/backend_inventory_dependencies_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/backend_inventory/backend_inventory_dependencies_table/index.tsx @@ -15,7 +15,6 @@ import { useFetcher } from '../../../../hooks/use_fetcher'; import { useTimeRange } from '../../../../hooks/use_time_range'; import { BackendLink } from '../../../shared/backend_link'; import { DependenciesTable } from '../../../shared/dependencies_table'; -import { getTimeRangeComparison } from '../../../shared/time_comparison/get_time_range_comparison'; export function BackendInventoryDependenciesTable() { const { @@ -25,7 +24,7 @@ export function BackendInventoryDependenciesTable() { environment, kuery, comparisonEnabled, - comparisonType, + offset, }, } = useApmParams('/backends'); @@ -33,13 +32,6 @@ export function BackendInventoryDependenciesTable() { const trackEvent = useUiTracker(); - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonEnabled, - comparisonType, - }); - const { data, status } = useFetcher( (callApmApi) => { if (!start || !end) { @@ -48,11 +40,18 @@ export function BackendInventoryDependenciesTable() { return callApmApi('GET /internal/apm/backends/top_backends', { params: { - query: { start, end, environment, numBuckets: 20, offset, kuery }, + query: { + start, + end, + environment, + numBuckets: 20, + offset: comparisonEnabled ? offset : undefined, + kuery, + }, }, }); }, - [start, end, environment, offset, kuery] + [start, end, environment, offset, kuery, comparisonEnabled] ); const dependencies = @@ -70,7 +69,7 @@ export function BackendInventoryDependenciesTable() { query={{ backendName: location.backendName, comparisonEnabled, - comparisonType, + offset, environment, kuery, rangeFrom, diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/detail_view/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/detail_view/index.tsx index 0a6b134275121..a0dbbb552d8cd 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/detail_view/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/detail_view/index.tsx @@ -71,7 +71,7 @@ export function DetailView({ errorGroup, urlParams, kuery }: Props) { const history = useHistory(); const { transaction, error, occurrencesCount } = errorGroup; - const { detailTab, comparisonType, comparisonEnabled } = urlParams; + const { detailTab, offset, comparisonEnabled } = urlParams; if (!error) { return null; @@ -138,7 +138,7 @@ export function DetailView({ errorGroup, urlParams, kuery }: Props) { transactionName={transaction.transaction.name} transactionType={transaction.transaction.type} serviceName={transaction.service.name} - comparisonType={comparisonType} + offset={offset} comparisonEnabled={comparisonEnabled} > diff --git a/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx index e0fc999c578ae..071ef02922c4b 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_details/index.tsx @@ -112,7 +112,14 @@ export function ErrorGroupDetails() { const { path: { groupId }, - query: { rangeFrom, rangeTo, environment, kuery, serviceGroup }, + query: { + rangeFrom, + rangeTo, + environment, + kuery, + serviceGroup, + comparisonEnabled, + }, } = useApmParams('/services/{serviceName}/errors/{groupId}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -130,6 +137,7 @@ export function ErrorGroupDetails() { environment, kuery, serviceGroup, + comparisonEnabled, }, }), }); diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx index 1618d7959bd07..be36ffcc55222 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx @@ -23,7 +23,6 @@ import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; import { APIReturnType } from '../../../services/rest/create_call_apm_api'; import { FailedTransactionRateChart } from '../../shared/charts/failed_transaction_rate_chart'; -import { getTimeRangeComparison } from '../../shared/time_comparison/get_time_range_comparison'; import { ErrorDistribution } from '../error_group_details/distribution'; import { ErrorGroupList } from './error_group_list'; @@ -56,18 +55,12 @@ export function ErrorGroupOverview() { sortDirection, rangeFrom, rangeTo, - comparisonType, + offset, comparisonEnabled, }, } = useApmParams('/services/{serviceName}/errors'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const { errorDistributionData, status } = useErrorGroupDistributionFetcher({ serviceName, groupId: undefined, @@ -133,8 +126,7 @@ export function ErrorGroupOverview() { groupIds: JSON.stringify( errorGroupMainStatistics.map(({ groupId }) => groupId).sort() ), - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, }, }, } diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/index.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/index.tsx index 807a848d649ea..082ab1733547e 100644 --- a/x-pack/plugins/apm/public/components/app/service_inventory/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_inventory/index.tsx @@ -18,7 +18,10 @@ import { SearchBar } from '../../shared/search_bar'; import { ServiceList } from './service_list'; import { MLCallout, shouldDisplayMlCallout } from '../../shared/ml_callout'; import { joinByKey } from '../../../../common/utils/join_by_key'; -import { getTimeRangeComparison } from '../../shared/time_comparison/get_time_range_comparison'; +import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { apmServiceInventoryOptimizedSorting } from '../../../../../observability/common'; +import { ServiceInventoryFieldName } from '../../../../common/service_inventory'; +import { orderServiceItems } from './service_list/order_service_items'; const initialData = { requestId: '', @@ -35,20 +38,13 @@ function useServicesFetcher() { environment, kuery, serviceGroup, + offset, comparisonEnabled, - comparisonType, }, } = useApmParams('/services'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonEnabled, - comparisonType, - }); - const sortedAndFilteredServicesFetch = useFetcher( (callApmApi) => { return callApmApi('GET /internal/apm/sorted_and_filtered_services', { @@ -108,7 +104,7 @@ function useServicesFetcher() { // Service name is sorted to guarantee the same order every time this API is called so the result can be cached. .sort() ), - offset, + offset: comparisonEnabled ? offset : undefined, }, }, }); @@ -116,7 +112,7 @@ function useServicesFetcher() { }, // only fetches detailed statistics when requestId is invalidated by main statistics api call or offset is changed // eslint-disable-next-line react-hooks/exhaustive-deps - [mainStatisticsData.requestId, offset], + [mainStatisticsData.requestId, offset, comparisonEnabled], { preservePreviousData: false } ); @@ -165,10 +161,36 @@ export function ServiceInventory() { /> ); + const mainStatisticsItems = mainStatisticsFetch.data?.items ?? []; + const preloadedServices = sortedAndFilteredServicesFetch.data?.services || []; + + const displayHealthStatus = [ + ...mainStatisticsItems, + ...preloadedServices, + ].some((item) => 'healthStatus' in item); + + const tiebreakerField = useKibana().services.uiSettings?.get( + apmServiceInventoryOptimizedSorting + ) + ? ServiceInventoryFieldName.ServiceName + : ServiceInventoryFieldName.Throughput; + + const initialSortField = displayHealthStatus + ? ServiceInventoryFieldName.HealthStatus + : tiebreakerField; + + const initialSortDirection = + initialSortField === ServiceInventoryFieldName.ServiceName ? 'asc' : 'desc'; + const items = joinByKey( [ - ...(sortedAndFilteredServicesFetch.data?.services ?? []), - ...(mainStatisticsFetch.data?.items ?? []), + // only use preloaded services if tiebreaker field is service.name, + // otherwise ignore them to prevent re-sorting of the table + // once the tiebreaking metric comes in + ...(tiebreakerField === ServiceInventoryFieldName.ServiceName + ? preloadedServices + : []), + ...mainStatisticsItems, ], 'serviceName' ); @@ -195,6 +217,17 @@ export function ServiceInventory() { comparisonFetch.status === FETCH_STATUS.LOADING || comparisonFetch.status === FETCH_STATUS.NOT_INITIATED } + displayHealthStatus={displayHealthStatus} + initialSortField={initialSortField} + initialSortDirection={initialSortDirection} + sortFn={(itemsToSort, sortField, sortDirection) => { + return orderServiceItems({ + items: itemsToSort, + primarySortField: sortField, + sortDirection, + tiebreakerField, + }); + }} comparisonData={comparisonFetch?.data} noItemsMessage={noItemsMessage} /> diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.stories.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.stories.tsx index 01430c93b4b5a..61e4f2b3ae766 100644 --- a/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.stories.tsx +++ b/x-pack/plugins/apm/public/components/app/service_inventory/service_inventory.stories.tsx @@ -11,7 +11,6 @@ import { MemoryRouter } from 'react-router-dom'; import { CoreStart } from '../../../../../../../src/core/public'; import { createKibanaReactContext } from '../../../../../../../src/plugins/kibana_react/public'; import { AnomalyDetectionSetupState } from '../../../../common/anomaly_detection/get_anomaly_detection_setup_state'; -import { TimeRangeComparisonEnum } from '../../../../common/runtime_types/comparison_type_rt'; import { AnomalyDetectionJobsContext } from '../../../context/anomaly_detection_jobs/anomaly_detection_jobs_context'; import { ApmPluginContextValue } from '../../../context/apm_plugin/apm_plugin_context'; import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context'; @@ -61,7 +60,7 @@ const stories: Meta<{}> = { ; @@ -54,13 +56,6 @@ function formatString(value?: string | null) { return value || NOT_AVAILABLE_LABEL; } -const SERVICE_HEALTH_STATUS_ORDER = [ - ServiceHealthStatus.unknown, - ServiceHealthStatus.healthy, - ServiceHealthStatus.warning, - ServiceHealthStatus.critical, -]; - export function getServiceColumns({ query, showTransactionTypeColumn, @@ -84,7 +79,7 @@ export function getServiceColumns({ ...(showHealthStatusColumn ? [ { - field: 'healthStatus', + field: ServiceInventoryFieldName.HealthStatus, name: i18n.translate('xpack.apm.servicesTable.healthColumnLabel', { defaultMessage: 'Health', }), @@ -101,7 +96,7 @@ export function getServiceColumns({ ] : []), { - field: 'serviceName', + field: ServiceInventoryFieldName.ServiceName, name: i18n.translate('xpack.apm.servicesTable.nameColumnLabel', { defaultMessage: 'Name', }), @@ -123,7 +118,7 @@ export function getServiceColumns({ ...(showWhenSmallOrGreaterThanLarge ? [ { - field: 'environments', + field: ServiceInventoryFieldName.Environments, name: i18n.translate( 'xpack.apm.servicesTable.environmentColumnLabel', { @@ -141,7 +136,7 @@ export function getServiceColumns({ ...(showTransactionTypeColumn && showWhenSmallOrGreaterThanXL ? [ { - field: 'transactionType', + field: ServiceInventoryFieldName.TransactionType, name: i18n.translate( 'xpack.apm.servicesTable.transactionColumnLabel', { defaultMessage: 'Transaction type' } @@ -152,7 +147,7 @@ export function getServiceColumns({ ] : []), { - field: 'latency', + field: ServiceInventoryFieldName.Latency, name: i18n.translate('xpack.apm.servicesTable.latencyAvgColumnLabel', { defaultMessage: 'Latency (avg.)', }), @@ -179,7 +174,7 @@ export function getServiceColumns({ align: RIGHT_ALIGNMENT, }, { - field: 'throughput', + field: ServiceInventoryFieldName.Throughput, name: i18n.translate('xpack.apm.servicesTable.throughputColumnLabel', { defaultMessage: 'Throughput', }), @@ -207,7 +202,7 @@ export function getServiceColumns({ align: RIGHT_ALIGNMENT, }, { - field: 'transactionErrorRate', + field: ServiceInventoryFieldName.TransactionErrorRate, name: i18n.translate('xpack.apm.servicesTable.transactionErrorRate', { defaultMessage: 'Failed transaction rate', }), @@ -246,6 +241,14 @@ interface Props { noItemsMessage?: React.ReactNode; isLoading: boolean; isFailure?: boolean; + displayHealthStatus: boolean; + initialSortField: ServiceInventoryFieldName; + initialSortDirection: 'asc' | 'desc'; + sortFn: ( + sortItems: ServiceListItem[], + sortField: ServiceInventoryFieldName, + sortDirection: 'asc' | 'desc' + ) => ServiceListItem[]; } export function ServiceList({ @@ -255,9 +258,12 @@ export function ServiceList({ comparisonData, isLoading, isFailure, + displayHealthStatus, + initialSortField, + initialSortDirection, + sortFn, }: Props) { const breakpoints = useBreakpoints(); - const displayHealthStatus = items.some((item) => 'healthStatus' in item); const showTransactionTypeColumn = items.some( ({ transactionType }) => @@ -292,9 +298,6 @@ export function ServiceList({ ] ); - const initialSortField = displayHealthStatus ? 'healthStatus' : 'serviceName'; - const initialSortDirection = displayHealthStatus ? 'desc' : 'asc'; - return ( @@ -333,7 +336,7 @@ export function ServiceList({ - isLoading={isLoading} error={isFailure} columns={serviceColumns} @@ -341,41 +344,13 @@ export function ServiceList({ noItemsMessage={noItemsMessage} initialSortField={initialSortField} initialSortDirection={initialSortDirection} - sortFn={(itemsToSort, sortField, sortDirection) => { - // For healthStatus, sort items by healthStatus first, then by name - return sortField === 'healthStatus' - ? orderBy( - itemsToSort, - [ - (item) => { - return item.healthStatus - ? SERVICE_HEALTH_STATUS_ORDER.indexOf(item.healthStatus) - : -1; - }, - (item) => item.serviceName.toLowerCase(), - ], - [sortDirection, sortDirection === 'asc' ? 'desc' : 'asc'] - ) - : orderBy( - itemsToSort, - (item) => { - switch (sortField) { - // Use `?? -1` here so `undefined` will appear after/before `0`. - // In the table this will make the "N/A" items always at the - // bottom/top. - case 'latency': - return item.latency ?? -1; - case 'throughput': - return item.throughput ?? -1; - case 'transactionErrorRate': - return item.transactionErrorRate ?? -1; - default: - return item[sortField as keyof typeof item]; - } - }, - sortDirection - ); - }} + sortFn={(itemsToSort, sortField, sortDirection) => + sortFn( + itemsToSort, + sortField as ServiceInventoryFieldName, + sortDirection + ) + } /> diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/order_service_items.test.ts b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/order_service_items.test.ts new file mode 100644 index 0000000000000..5877ee64239b6 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/order_service_items.test.ts @@ -0,0 +1,230 @@ +/* + * 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 { ServiceHealthStatus } from '../../../../../common/service_health_status'; +import { ServiceInventoryFieldName } from '../../../../../common/service_inventory'; +import { orderServiceItems } from './order_service_items'; + +describe('orderServiceItems', () => { + describe('when sorting by health status', () => { + describe('desc', () => { + it('orders from critical to unknown', () => { + const sortedItems = orderServiceItems({ + primarySortField: ServiceInventoryFieldName.HealthStatus, + sortDirection: 'desc', + tiebreakerField: ServiceInventoryFieldName.Throughput, + items: [ + { + serviceName: 'critical-service', + healthStatus: ServiceHealthStatus.critical, + }, + { + serviceName: 'healthy-service', + healthStatus: ServiceHealthStatus.healthy, + }, + { + serviceName: 'warning-service', + healthStatus: ServiceHealthStatus.warning, + }, + { + serviceName: 'unknown-service', + healthStatus: ServiceHealthStatus.unknown, + }, + ], + }); + + expect(sortedItems.map((item) => item.serviceName)).toEqual([ + 'critical-service', + 'warning-service', + 'healthy-service', + 'unknown-service', + ]); + }); + + it('sorts by service name ascending as a tie-breaker', () => { + const sortedItems = orderServiceItems({ + primarySortField: ServiceInventoryFieldName.HealthStatus, + sortDirection: 'desc', + tiebreakerField: ServiceInventoryFieldName.ServiceName, + items: [ + { + serviceName: 'b-critical-service', + healthStatus: ServiceHealthStatus.critical, + }, + { + serviceName: 'a-critical-service', + healthStatus: ServiceHealthStatus.critical, + }, + { + serviceName: 'a-unknown-service', + healthStatus: ServiceHealthStatus.unknown, + }, + { + serviceName: 'b-unknown-service', + healthStatus: ServiceHealthStatus.unknown, + }, + ], + }); + + expect(sortedItems.map((item) => item.serviceName)).toEqual([ + 'a-critical-service', + 'b-critical-service', + 'a-unknown-service', + 'b-unknown-service', + ]); + }); + + it('sorts by metric descending as a tie-breaker', () => { + const sortedItems = orderServiceItems({ + primarySortField: ServiceInventoryFieldName.HealthStatus, + sortDirection: 'desc', + tiebreakerField: ServiceInventoryFieldName.Throughput, + items: [ + { + serviceName: 'low-throughput-service', + healthStatus: ServiceHealthStatus.unknown, + throughput: 1, + }, + { + serviceName: 'high-throughput-service', + healthStatus: ServiceHealthStatus.unknown, + throughput: 100, + }, + { + serviceName: 'med-throughput-service', + healthStatus: ServiceHealthStatus.unknown, + throughput: 10, + }, + { + serviceName: 'critical-service', + healthStatus: ServiceHealthStatus.critical, + throughput: 0, + }, + ], + }); + + expect(sortedItems.map((item) => item.serviceName)).toEqual([ + 'critical-service', + 'high-throughput-service', + 'med-throughput-service', + 'low-throughput-service', + ]); + }); + }); + + describe('asc', () => { + it('orders from unknown to critical', () => { + const sortedItems = orderServiceItems({ + primarySortField: ServiceInventoryFieldName.HealthStatus, + sortDirection: 'asc', + tiebreakerField: ServiceInventoryFieldName.Throughput, + items: [ + { + serviceName: 'critical-service', + healthStatus: ServiceHealthStatus.critical, + }, + { + serviceName: 'healthy-service', + healthStatus: ServiceHealthStatus.healthy, + }, + { + serviceName: 'warning-service', + healthStatus: ServiceHealthStatus.warning, + }, + { + serviceName: 'unknown-service', + healthStatus: ServiceHealthStatus.unknown, + }, + ], + }); + + expect(sortedItems.map((item) => item.serviceName)).toEqual([ + 'unknown-service', + 'healthy-service', + 'warning-service', + 'critical-service', + ]); + }); + }); + }); + + describe('when sorting by metric fields', () => { + it('sorts correctly', () => { + const sortedItems = orderServiceItems({ + primarySortField: ServiceInventoryFieldName.Throughput, + sortDirection: 'desc', + tiebreakerField: ServiceInventoryFieldName.Throughput, + items: [ + { + serviceName: 'low-throughput-service', + healthStatus: ServiceHealthStatus.unknown, + throughput: 1, + }, + { + serviceName: 'high-throughput-service', + healthStatus: ServiceHealthStatus.unknown, + throughput: 100, + }, + { + serviceName: 'med-throughput-service', + healthStatus: ServiceHealthStatus.unknown, + throughput: 10, + }, + { + serviceName: 'critical-service', + healthStatus: ServiceHealthStatus.critical, + throughput: 0, + }, + ], + }); + + expect(sortedItems.map((item) => item.serviceName)).toEqual([ + 'high-throughput-service', + 'med-throughput-service', + 'low-throughput-service', + 'critical-service', + ]); + }); + }); + + describe('when sorting by alphabetical fields', () => { + const sortedItems = orderServiceItems({ + primarySortField: ServiceInventoryFieldName.ServiceName, + sortDirection: 'asc', + tiebreakerField: ServiceInventoryFieldName.ServiceName, + items: [ + { + serviceName: 'd-service', + healthStatus: ServiceHealthStatus.unknown, + }, + { + serviceName: 'a-service', + healthStatus: ServiceHealthStatus.unknown, + }, + { + serviceName: 'b-service', + healthStatus: ServiceHealthStatus.unknown, + }, + { + serviceName: 'c-service', + healthStatus: ServiceHealthStatus.unknown, + }, + { + serviceName: '0-service', + healthStatus: ServiceHealthStatus.unknown, + }, + ], + }); + + expect(sortedItems.map((item) => item.serviceName)).toEqual([ + '0-service', + 'a-service', + 'b-service', + 'c-service', + 'd-service', + ]); + }); +}); diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/order_service_items.ts b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/order_service_items.ts new file mode 100644 index 0000000000000..1e685d8215413 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/order_service_items.ts @@ -0,0 +1,75 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { orderBy } from 'lodash'; +import { ServiceHealthStatus } from '../../../../../common/service_health_status'; +import { + ServiceListItem, + ServiceInventoryFieldName, +} from '../../../../../common/service_inventory'; + +type SortValueGetter = (item: ServiceListItem) => string | number; + +const SERVICE_HEALTH_STATUS_ORDER = [ + ServiceHealthStatus.unknown, + ServiceHealthStatus.healthy, + ServiceHealthStatus.warning, + ServiceHealthStatus.critical, +]; + +const sorts: Record = { + [ServiceInventoryFieldName.HealthStatus]: (item) => + item.healthStatus + ? SERVICE_HEALTH_STATUS_ORDER.indexOf(item.healthStatus) + : -1, + [ServiceInventoryFieldName.ServiceName]: (item) => + item.serviceName.toLowerCase(), + [ServiceInventoryFieldName.Environments]: (item) => + item.environments?.join(', ').toLowerCase() ?? '', + [ServiceInventoryFieldName.TransactionType]: (item) => + item.transactionType ?? '', + [ServiceInventoryFieldName.Latency]: (item) => item.latency ?? -1, + [ServiceInventoryFieldName.Throughput]: (item) => item.throughput ?? -1, + [ServiceInventoryFieldName.TransactionErrorRate]: (item) => + item.transactionErrorRate ?? -1, +}; + +function reverseSortDirection(sortDirection: 'asc' | 'desc') { + return sortDirection === 'asc' ? 'desc' : 'asc'; +} + +export function orderServiceItems({ + items, + primarySortField, + tiebreakerField, + sortDirection, +}: { + items: ServiceListItem[]; + primarySortField: ServiceInventoryFieldName; + tiebreakerField: ServiceInventoryFieldName; + sortDirection: 'asc' | 'desc'; +}): ServiceListItem[] { + // For healthStatus, sort items by healthStatus first, then by tie-breaker + + const sortFn = sorts[primarySortField as ServiceInventoryFieldName]; + + if (primarySortField === ServiceInventoryFieldName.HealthStatus) { + const tiebreakerSortDirection = + tiebreakerField === ServiceInventoryFieldName.ServiceName + ? reverseSortDirection(sortDirection) + : sortDirection; + + const tiebreakerSortFn = sorts[tiebreakerField]; + + return orderBy( + items, + [sortFn, tiebreakerSortFn], + [sortDirection, tiebreakerSortDirection] + ); + } + + return orderBy(items, sortFn, sortDirection); +} diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/service_list.stories.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/service_list.stories.tsx index 628ef4617417c..290f1e6b69b77 100644 --- a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/service_list.stories.tsx +++ b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/service_list.stories.tsx @@ -11,6 +11,7 @@ import { MemoryRouter } from 'react-router-dom'; import { CoreStart } from '../../../../../../../../src/core/public'; import { createKibanaReactContext } from '../../../../../../../../src/plugins/kibana_react/public'; import { ServiceHealthStatus } from '../../../../../common/service_health_status'; +import { ServiceInventoryFieldName } from '../../../../../common/service_inventory'; import type { ApmPluginContextValue } from '../../../../context/apm_plugin/apm_plugin_context'; import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context'; import { ServiceList } from './'; @@ -59,6 +60,10 @@ export const Example: Story = (args) => { Example.args = { isLoading: false, items, + displayHealthStatus: true, + initialSortField: ServiceInventoryFieldName.HealthStatus, + initialSortDirection: 'desc', + sortFn: (sortItems) => sortItems, }; export const EmptyState: Story = (args) => { @@ -67,6 +72,10 @@ export const EmptyState: Story = (args) => { EmptyState.args = { isLoading: false, items: [], + displayHealthStatus: true, + initialSortField: ServiceInventoryFieldName.HealthStatus, + initialSortDirection: 'desc', + sortFn: (sortItems) => sortItems, }; export const WithHealthWarnings: Story = (args) => { diff --git a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/service_list.test.tsx b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/service_list.test.tsx index 25552a8937169..5a781cf00336a 100644 --- a/x-pack/plugins/apm/public/components/app/service_inventory/service_list/service_list.test.tsx +++ b/x-pack/plugins/apm/public/components/app/service_inventory/service_list/service_list.test.tsx @@ -22,6 +22,7 @@ const query = { environment: ENVIRONMENT_ALL.value, kuery: '', serviceGroup: '', + comparisonEnabled: false, }; const service: any = { diff --git a/x-pack/plugins/apm/public/components/app/service_map/popover/backend_contents.tsx b/x-pack/plugins/apm/public/components/app/service_map/popover/backend_contents.tsx index facc3a9dbc582..3b50913d49648 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/popover/backend_contents.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/popover/backend_contents.tsx @@ -17,7 +17,6 @@ import { useApmRouter } from '../../../../hooks/use_apm_router'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; import { ApmRoutes } from '../../../routing/apm_route_config'; import { StatsList } from './stats_list'; -import { getTimeRangeComparison } from '../../../shared/time_comparison/get_time_range_comparison'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; type BackendReturn = APIReturnType<'GET /internal/apm/service-map/backend'>; @@ -38,14 +37,7 @@ export function BackendContents({ '/services/{serviceName}/service-map' ); - const { comparisonEnabled, comparisonType } = query; - - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonEnabled, - comparisonType, - }); + const { offset, comparisonEnabled } = query; const apmRouter = useApmRouter(); @@ -61,13 +53,13 @@ export function BackendContents({ environment, start, end, - offset, + offset: comparisonEnabled ? offset : undefined, }, }, }); } }, - [environment, backendName, start, end, offset] + [environment, backendName, start, end, offset, comparisonEnabled] ); const isLoading = status === FETCH_STATUS.LOADING; diff --git a/x-pack/plugins/apm/public/components/app/service_map/popover/service_contents.tsx b/x-pack/plugins/apm/public/components/app/service_map/popover/service_contents.tsx index 1d2b36c840b0b..04cf514a53dba 100644 --- a/x-pack/plugins/apm/public/components/app/service_map/popover/service_contents.tsx +++ b/x-pack/plugins/apm/public/components/app/service_map/popover/service_contents.tsx @@ -22,7 +22,6 @@ import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; import { AnomalyDetection } from './anomaly_detection'; import { StatsList } from './stats_list'; import { useTimeRange } from '../../../../hooks/use_time_range'; -import { getTimeRangeComparison } from '../../../shared/time_comparison/get_time_range_comparison'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; type ServiceNodeReturn = @@ -51,17 +50,10 @@ export function ServiceContents({ throw new Error('Expected rangeFrom and rangeTo to be set'); } - const { rangeFrom, rangeTo, comparisonEnabled, comparisonType } = query; + const { rangeFrom, rangeTo, comparisonEnabled, offset } = query; const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonEnabled, - comparisonType, - }); - const serviceName = nodeData.id!; const serviceGroup = ('serviceGroup' in query && query.serviceGroup) || ''; @@ -73,13 +65,18 @@ export function ServiceContents({ { params: { path: { serviceName }, - query: { environment, start, end, offset }, + query: { + environment, + start, + end, + offset: comparisonEnabled ? offset : undefined, + }, }, } ); } }, - [environment, serviceName, start, end, offset] + [environment, serviceName, start, end, offset, comparisonEnabled] ); const isLoading = status === FETCH_STATUS.LOADING; @@ -98,7 +95,14 @@ export function ServiceContents({ const focusUrl = apmRouter.link('/services/{serviceName}/service-map', { path: { serviceName }, - query: { rangeFrom, rangeTo, environment, kuery, serviceGroup }, + query: { + rangeFrom, + rangeTo, + environment, + kuery, + serviceGroup, + comparisonEnabled, + }, }); const { serviceAnomalyStats } = nodeData; diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx index ba5674e558e44..4e912d7a0a453 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_dependencies_table/index.tsx @@ -18,7 +18,6 @@ import { useTimeRange } from '../../../../hooks/use_time_range'; import { BackendLink } from '../../../shared/backend_link'; import { DependenciesTable } from '../../../shared/dependencies_table'; import { ServiceLink } from '../../../shared/service_link'; -import { getTimeRangeComparison } from '../../../shared/time_comparison/get_time_range_comparison'; interface ServiceOverviewDependenciesTableProps { fixedHeight?: boolean; @@ -41,20 +40,13 @@ export function ServiceOverviewDependenciesTable({ rangeTo, serviceGroup, comparisonEnabled, - comparisonType, + offset, latencyAggregationType, }, } = useApmParams('/services/{serviceName}/*'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { offset } = getTimeRangeComparison({ - start, - end, - comparisonEnabled, - comparisonType, - }); - const { serviceName, transactionType } = useApmServiceContext(); const trackEvent = useUiTracker(); @@ -70,12 +62,18 @@ export function ServiceOverviewDependenciesTable({ { params: { path: { serviceName }, - query: { start, end, environment, numBuckets: 20, offset }, + query: { + start, + end, + environment, + numBuckets: 20, + offset: comparisonEnabled ? offset : undefined, + }, }, } ); }, - [start, end, serviceName, environment, offset] + [start, end, serviceName, environment, offset, comparisonEnabled] ); const dependencies = @@ -90,7 +88,7 @@ export function ServiceOverviewDependenciesTable({ query={{ backendName: location.backendName, comparisonEnabled, - comparisonType, + offset, environment, kuery, rangeFrom, @@ -110,7 +108,7 @@ export function ServiceOverviewDependenciesTable({ agentName={location.agentName} query={{ comparisonEnabled, - comparisonType, + offset, environment, kuery, rangeFrom, diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx index 127e4cdbd5866..2a891e8abf7e0 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx @@ -18,7 +18,6 @@ import uuid from 'uuid'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { ErrorOverviewLink } from '../../../shared/links/apm/error_overview_link'; -import { getTimeRangeComparison } from '../../../shared/time_comparison/get_time_range_comparison'; import { OverviewTableContainer } from '../../../shared/overview_table_container'; import { getColumns } from './get_columns'; import { useApmParams } from '../../../../hooks/use_apm_params'; @@ -70,24 +69,11 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { const { query } = useApmParams('/services/{serviceName}/overview'); - const { - environment, - kuery, - rangeFrom, - rangeTo, - comparisonType, - comparisonEnabled, - } = query; + const { environment, kuery, rangeFrom, rangeTo, offset, comparisonEnabled } = + query; const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); - const { pageIndex, sort } = tableOptions; const { direction, field } = sort; @@ -134,8 +120,8 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { pageIndex, direction, field, - // not used, but needed to trigger an update when comparisonType is changed either manually by user or when time range is changed - comparisonType, + // not used, but needed to trigger an update when offset is changed either manually by user or when time range is changed + offset, // not used, but needed to trigger an update when comparison feature is disabled/enabled by user comparisonEnabled, ] @@ -163,8 +149,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { groupIds: JSON.stringify( items.map(({ groupId: groupId }) => groupId).sort() ), - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, }, }, } diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx index bbe94f8e8aae8..6ec04173da968 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_instances_chart_and_table.tsx @@ -15,7 +15,6 @@ import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; import { APIReturnType } from '../../../services/rest/create_call_apm_api'; import { InstancesLatencyDistributionChart } from '../../shared/charts/instances_latency_distribution_chart'; -import { getTimeRangeComparison } from '../../shared/time_comparison/get_time_range_comparison'; import { ServiceOverviewInstancesTable, TableOptions, @@ -79,20 +78,13 @@ export function ServiceOverviewInstancesChartAndTable({ rangeFrom, rangeTo, comparisonEnabled, - comparisonType, + offset, latencyAggregationType, }, } = useApmParams('/services/{serviceName}/overview'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); - const { data: mainStatsData = INITIAL_STATE_MAIN_STATS, status: mainStatsStatus, @@ -117,8 +109,7 @@ export function ServiceOverviewInstancesChartAndTable({ start, end, transactionType, - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, }, }, } @@ -144,8 +135,8 @@ export function ServiceOverviewInstancesChartAndTable({ pageIndex, field, direction, - // not used, but needed to trigger an update when comparisonType is changed either manually by user or when time range is changed - comparisonType, + // not used, but needed to trigger an update when offset is changed either manually by user or when time range is changed + offset, // not used, but needed to trigger an update when comparison feature is disabled/enabled by user comparisonEnabled, ] @@ -206,8 +197,7 @@ export function ServiceOverviewInstancesChartAndTable({ serviceNodeIds: JSON.stringify( currentPeriodOrderedItems.map((item) => item.serviceNodeName) ), - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, }, }, } diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx index f7d0e618025f5..ad18f6dde3f75 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx @@ -23,10 +23,7 @@ import { useFetcher } from '../../../hooks/use_fetcher'; import { usePreferredServiceAnomalyTimeseries } from '../../../hooks/use_preferred_service_anomaly_timeseries'; import { useTimeRange } from '../../../hooks/use_time_range'; import { TimeseriesChart } from '../../shared/charts/timeseries_chart'; -import { - getComparisonChartTheme, - getTimeRangeComparison, -} from '../../shared/time_comparison/get_time_range_comparison'; +import { getComparisonChartTheme } from '../../shared/time_comparison/get_comparison_chart_theme'; import { ChartType, getTimeSeriesColor, @@ -47,7 +44,7 @@ export function ServiceOverviewThroughputChart({ transactionName?: string; }) { const { - query: { rangeFrom, rangeTo, comparisonEnabled, comparisonType }, + query: { rangeFrom, rangeTo, comparisonEnabled, offset }, } = useApmParams('/services/{serviceName}'); const { environment } = useEnvironmentsContext(); @@ -61,12 +58,6 @@ export function ServiceOverviewThroughputChart({ const { transactionType, serviceName } = useApmServiceContext(); const comparisonChartTheme = getComparisonChartTheme(); - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const { data = INITIAL_STATE, status } = useFetcher( (callApmApi) => { @@ -84,8 +75,7 @@ export function ServiceOverviewThroughputChart({ start, end, transactionType, - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, transactionName, }, }, @@ -100,9 +90,9 @@ export function ServiceOverviewThroughputChart({ start, end, transactionType, - comparisonStart, - comparisonEnd, + offset, transactionName, + comparisonEnabled, ] ); diff --git a/x-pack/plugins/apm/public/components/app/settings/schema/index.tsx b/x-pack/plugins/apm/public/components/app/settings/schema/index.tsx index 0ea03cb0614d4..41d99e4551cc0 100644 --- a/x-pack/plugins/apm/public/components/app/settings/schema/index.tsx +++ b/x-pack/plugins/apm/public/components/app/settings/schema/index.tsx @@ -56,6 +56,7 @@ export function Schema() { const cloudApmPackagePolicy = data.cloud_apm_package_policy; const hasCloudApmPackagePolicy = !!cloudApmPackagePolicy; const hasRequiredRole = !!data.has_required_role; + const latestApmPackageVersion = data.latest_apm_package_version; function updateLocalStorage(newStatus: FETCH_STATUS) { setApmDataStreamsMigrationStatus({ @@ -91,6 +92,7 @@ export function Schema() { hasCloudAgentPolicy={hasCloudAgentPolicy} hasRequiredRole={hasRequiredRole} cloudApmPackagePolicy={cloudApmPackagePolicy} + latestApmPackageVersion={latestApmPackageVersion} /> {isSwitchActive && ( diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx index 855f5c037fdd1..90fdaddc71408 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx @@ -25,7 +25,7 @@ export function MaybeViewTraceLink({ environment: Environment; }) { const { - query: { latencyAggregationType, comparisonEnabled, comparisonType }, + query: { latencyAggregationType, comparisonEnabled, offset }, } = useApmParams('/services/{serviceName}/transactions/view'); const viewFullTraceButtonLabel = i18n.translate( @@ -95,7 +95,7 @@ export function MaybeViewTraceLink({ environment={nextEnvironment} latencyAggregationType={latencyAggregationType} comparisonEnabled={comparisonEnabled} - comparisonType={comparisonType} + offset={offset} > {viewFullTraceButtonLabel} diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/flyout_top_level_properties.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/flyout_top_level_properties.tsx index ead54b3e9d6d9..2a168904d4a2f 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/flyout_top_level_properties.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/flyout_top_level_properties.tsx @@ -25,7 +25,7 @@ interface Props { export function FlyoutTopLevelProperties({ transaction }: Props) { const { query } = useApmParams('/services/{serviceName}/transactions/view'); - const { latencyAggregationType, comparisonEnabled, comparisonType } = query; + const { latencyAggregationType, comparisonEnabled, offset } = query; if (!transaction) { return null; @@ -66,7 +66,7 @@ export function FlyoutTopLevelProperties({ transaction }: Props) { environment={nextEnvironment} latencyAggregationType={latencyAggregationType} comparisonEnabled={comparisonEnabled} - comparisonType={comparisonType} + offset={offset} > {transaction.transaction.name} diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/span_db.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/span_db.tsx index 0d9af40888192..ee2c09de2a1a4 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/span_db.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/span_db.tsx @@ -42,9 +42,27 @@ export function SpanDatabase({ spanDb }: Props) { return null; } - if (spanDb.type !== 'sql') { - return {spanDb.statement}; - } + const statementItem = + spanDb.type !== 'sql' ? ( + spanDb.statement + ) : ( + + + {spanDb.statement} + + + ); return ( @@ -59,24 +77,7 @@ export function SpanDatabase({ spanDb }: Props) { - - - - {spanDb.statement} - - - + {statementItem} ); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx index 1e8cf5d19e5e0..18ec931bb7302 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx @@ -34,12 +34,8 @@ interface Props { export function StickySpanProperties({ span, transaction }: Props) { const { query } = useApmParams('/services/{serviceName}/transactions/view'); - const { - environment, - latencyAggregationType, - comparisonEnabled, - comparisonType, - } = query; + const { environment, latencyAggregationType, comparisonEnabled, offset } = + query; const trackEvent = useUiTracker(); @@ -88,7 +84,7 @@ export function StickySpanProperties({ span, transaction }: Props) { environment={nextEnvironment} latencyAggregationType={latencyAggregationType} comparisonEnabled={comparisonEnabled} - comparisonType={comparisonType} + offset={offset} > {transaction.transaction.name} diff --git a/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx index 68315fc3b2b02..adb89867d743e 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_overview/index.tsx @@ -26,7 +26,7 @@ export function TransactionOverview() { rangeTo, transactionType: transactionTypeFromUrl, comparisonEnabled, - comparisonType, + offset, }, } = useApmParams('/services/{serviceName}/transactions'); @@ -69,7 +69,7 @@ export function TransactionOverview() { end={end} isServerlessContext={isServerless} comparisonEnabled={comparisonEnabled} - comparisonType={comparisonType} + offset={offset} /> @@ -81,6 +81,7 @@ export function TransactionOverview() { kuery={kuery} start={start} end={end} + saveTableOptionsToUrl /> diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/create_apm_policy_form.tsx b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/create_apm_policy_form.tsx index 7354846aba64f..5757fdabd5d54 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/create_apm_policy_form.tsx +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/create_apm_policy_form.tsx @@ -30,11 +30,5 @@ export function CreateAPMPolicyForm({ newPolicy, onChange }: Props) { }, }); } - return ( - - ); + return ; } diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/edit_apm_policy_form.tsx b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/edit_apm_policy_form.tsx index e8d3b5d6940aa..be9c89601d4ab 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/edit_apm_policy_form.tsx +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/edit_apm_policy_form.tsx @@ -12,7 +12,6 @@ import { PackagePolicyEditExtensionComponentProps, PackagePolicyVars, } from './typings'; -import { POLICY_ELASTIC_AGENT_ON_CLOUD } from '../../../../common/fleet'; interface Props { policy: PackagePolicy; @@ -32,11 +31,5 @@ export function EditAPMPolicyForm({ newPolicy, onChange }: Props) { }, }); } - return ( - - ); + return ; } diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/index.tsx b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/index.tsx index bce1d5936a352..7f9ec6e069773 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/index.tsx +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/index.tsx @@ -30,14 +30,9 @@ import { useKibana } from '../../../../../../../src/plugins/kibana_react/public' interface Props { updateAPMPolicy: (newVars: PackagePolicyVars, isValid: boolean) => void; vars?: PackagePolicyVars; - isCloudPolicy: boolean; } -export function APMPolicyForm({ - vars = {}, - isCloudPolicy, - updateAPMPolicy, -}: Props) { +export function APMPolicyForm({ vars = {}, updateAPMPolicy }: Props) { const tailSamplingPoliciesDocsLink = useKibana().services.docLinks?.links.apm.tailSamplingPolicies; const { @@ -48,17 +43,15 @@ export function APMPolicyForm({ tailSamplingSettings, } = useMemo(() => { return { - apmSettings: getApmSettings({ isCloudPolicy }), + apmSettings: getApmSettings(), rumSettings: getRUMSettings(), tlsSettings: getTLSSettings(), - agentAuthorizationSettings: getAgentAuthorizationSettings({ - isCloudPolicy, - }), + agentAuthorizationSettings: getAgentAuthorizationSettings(), tailSamplingSettings: getTailSamplingSettings( tailSamplingPoliciesDocsLink ), }; - }, [isCloudPolicy, tailSamplingPoliciesDocsLink]); + }, [tailSamplingPoliciesDocsLink]); function handleFormChange(key: string, value: any) { // Merge new key/value with the rest of fields diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.test.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.test.ts index ed3cf83962df4..533c053ba4294 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.test.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.test.ts @@ -6,39 +6,9 @@ */ import { getAgentAuthorizationSettings } from './agent_authorization_settings'; -import { SettingsRow } from '../typings'; import { isSettingsFormValid } from '../settings_form/utils'; describe('apm-fleet-apm-integration', () => { - describe('getAgentAuthorizationSettings', () => { - function findSetting(key: string, settings: SettingsRow[]) { - return settings.find( - (setting) => setting.type !== 'advanced_setting' && setting.key === key - ); - } - it('returns read only secret token when on cloud', () => { - const settings = getAgentAuthorizationSettings({ isCloudPolicy: true }); - const secretToken = findSetting('secret_token', settings); - expect(secretToken).toEqual({ - type: 'text', - key: 'secret_token', - labelAppend: 'Optional', - label: 'Secret token', - }); - }); - it('returns secret token when NOT on cloud', () => { - const settings = getAgentAuthorizationSettings({ isCloudPolicy: false }); - const secretToken = findSetting('secret_token', settings); - - expect(secretToken).toEqual({ - type: 'text', - key: 'secret_token', - labelAppend: 'Optional', - label: 'Secret token', - }); - }); - }); - describe('isAgentAuthorizationFormValid', () => { describe('validates integer fields', () => { [ @@ -47,9 +17,7 @@ describe('apm-fleet-apm-integration', () => { 'anonymous_rate_limit_event_limit', ].map((key) => { it(`returns false when ${key} is lower than 1`, () => { - const settings = getAgentAuthorizationSettings({ - isCloudPolicy: true, - }); + const settings = getAgentAuthorizationSettings(); expect( isSettingsFormValid(settings, { [key]: { value: 0, type: 'integer' }, diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.ts index dff95bbf1702c..c2a858b41e615 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/agent_authorization_settings.ts @@ -10,11 +10,7 @@ import { getIntegerRt } from '../../../../../common/agent_configuration/runtime_ import { OPTIONAL_LABEL } from '../settings_form/utils'; import { SettingsRow } from '../typings'; -export function getAgentAuthorizationSettings({ - isCloudPolicy, -}: { - isCloudPolicy: boolean; -}): SettingsRow[] { +export function getAgentAuthorizationSettings(): SettingsRow[] { return [ { type: 'boolean', diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.test.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.test.ts index 2d2acbcd37c55..effef056d6601 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.test.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.test.ts @@ -6,35 +6,14 @@ */ import { getApmSettings } from './apm_settings'; -import { SettingsRow, BasicSettingRow } from '../typings'; import { isSettingsFormValid } from '../settings_form/utils'; describe('apm_settings', () => { - describe('getApmSettings', () => { - function findSetting(key: string, settings: SettingsRow[]) { - return settings.find( - (setting) => setting.type !== 'advanced_setting' && setting.key === key - ) as BasicSettingRow; - } - ['host', 'url'].map((key) => { - it(`returns read only ${key} when on cloud`, () => { - const settings = getApmSettings({ isCloudPolicy: true }); - const setting = findSetting(key, settings); - expect(setting.readOnly).toBeTruthy(); - }); - it(`returns ${key} when NOT on cloud`, () => { - const settings = getApmSettings({ isCloudPolicy: false }); - const setting = findSetting(key, settings); - expect(setting.readOnly).toBeFalsy(); - }); - }); - }); - describe('isAPMFormValid', () => { describe('validates integer fields', () => { ['max_header_bytes', 'max_event_bytes'].map((key) => { it(`returns false when ${key} is lower than 1`, () => { - const settings = getApmSettings({ isCloudPolicy: true }); + const settings = getApmSettings(); expect( isSettingsFormValid(settings, { [key]: { value: 0, type: 'integer' }, @@ -50,7 +29,7 @@ describe('apm_settings', () => { }); ['max_connections'].map((key) => { it(`returns false when ${key} is lower than 0`, () => { - const settings = getApmSettings({ isCloudPolicy: true }); + const settings = getApmSettings(); expect( isSettingsFormValid(settings, { [key]: { value: -1, type: 'integer' }, @@ -63,7 +42,7 @@ describe('apm_settings', () => { describe('validates required fields', () => { ['host', 'url'].map((key) => { it(`return false when ${key} is not defined`, () => { - const settings = getApmSettings({ isCloudPolicy: true }); + const settings = getApmSettings(); expect(isSettingsFormValid(settings, {})).toBeFalsy(); }); }); @@ -73,7 +52,7 @@ describe('apm_settings', () => { ['idle_timeout', 'read_timeout', 'shutdown_timeout', 'write_timeout'].map( (key) => { it(`return false when ${key} lower then 1ms`, () => { - const settings = getApmSettings({ isCloudPolicy: true }); + const settings = getApmSettings(); expect( isSettingsFormValid(settings, { [key]: { value: '0ms', type: 'text' }, diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.ts index 8adda7b5983f1..03032a6160502 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_definition/apm_settings.ts @@ -10,17 +10,12 @@ import { getIntegerRt } from '../../../../../common/agent_configuration/runtime_ import { OPTIONAL_LABEL, REQUIRED_LABEL } from '../settings_form/utils'; import { SettingsRow } from '../typings'; -export function getApmSettings({ - isCloudPolicy, -}: { - isCloudPolicy: boolean; -}): SettingsRow[] { +export function getApmSettings(): SettingsRow[] { return [ { type: 'text', key: 'host', labelAppend: REQUIRED_LABEL, - readOnly: isCloudPolicy, label: i18n.translate( 'xpack.apm.fleet_integration.settings.apm.hostLabel', { defaultMessage: 'Host' } @@ -43,7 +38,6 @@ export function getApmSettings({ type: 'text', key: 'url', labelAppend: REQUIRED_LABEL, - readOnly: isCloudPolicy, label: i18n.translate( 'xpack.apm.fleet_integration.settings.apm.urlLabel', { diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_form/form_row_setting.tsx b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_form/form_row_setting.tsx index 321440eeaeab7..56ba3c6d47eb5 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_form/form_row_setting.tsx +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_form/form_row_setting.tsx @@ -28,6 +28,7 @@ interface Props { row: SettingsRow; value?: any; onChange: FormRowOnChange; + isDisabled?: boolean; } const ENABLED_LABEL = i18n.translate( @@ -39,11 +40,12 @@ const DISABLED_LABEL = i18n.translate( { defaultMessage: 'Disabled' } ); -export function FormRowSetting({ row, value, onChange }: Props) { +export function FormRowSetting({ row, value, onChange, isDisabled }: Props) { switch (row.type) { case 'boolean': { return ( { @@ -56,9 +58,9 @@ export function FormRowSetting({ row, value, onChange }: Props) { case 'text': { return ( : undefined} + prepend={isDisabled ? : undefined} onChange={(e) => { onChange(row.key, e.target.value); }} @@ -68,6 +70,7 @@ export function FormRowSetting({ row, value, onChange }: Props) { case 'area': { return ( { onChange(row.key, e.target.value); @@ -79,6 +82,7 @@ export function FormRowSetting({ row, value, onChange }: Props) { case 'integer': { return ( { onChange(row.key, e.target.value); diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_form/index.tsx b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_form/index.tsx index 84b06e37b2ae2..a834c41098798 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_form/index.tsx +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/settings_form/index.tsx @@ -51,7 +51,7 @@ function FormRow({ if (!configEntry) { return null; } - const { value } = configEntry; + const { value, frozen } = configEntry; const { isValid, message } = validateSettingValue(row, value); return ( @@ -70,7 +70,12 @@ function FormRow({ } > - + {row.settings && diff --git a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/typings.ts b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/typings.ts index e7108e8910446..c25031efad5fd 100644 --- a/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/typings.ts +++ b/x-pack/plugins/apm/public/components/fleet_integration/apm_policy_form/typings.ts @@ -50,7 +50,6 @@ export interface BasicSettingRow { settings?: SettingsRow[]; validation?: SettingValidation; required?: boolean; - readOnly?: boolean; } export type SettingsRow = BasicSettingRow | AdvancedSettingRow; diff --git a/x-pack/plugins/apm/public/components/routing/apm_route_config.tsx b/x-pack/plugins/apm/public/components/routing/apm_route_config.tsx index ab211b6ee3912..0ff0b18818301 100644 --- a/x-pack/plugins/apm/public/components/routing/apm_route_config.tsx +++ b/x-pack/plugins/apm/public/components/routing/apm_route_config.tsx @@ -19,7 +19,7 @@ import { settings } from './settings'; import { ApmMainTemplate } from './templates/apm_main_template'; import { ServiceGroupsList } from '../app/service_groups'; import { ServiceGroupsRedirect } from './service_groups_redirect'; -import { comparisonTypeRt } from '../../../common/runtime_types/comparison_type_rt'; +import { offsetRt } from '../../../common/offset_rt'; const ServiceGroupsBreadcrumnbLabel = i18n.translate( 'xpack.apm.views.serviceGroups.breadcrumbLabel', @@ -97,6 +97,7 @@ const apmRoutes = { t.type({ rangeFrom: t.string, rangeTo: t.string, + comparisonEnabled: toBooleanRt, }), t.partial({ serviceGroup: t.string, @@ -104,9 +105,8 @@ const apmRoutes = { t.partial({ refreshPaused: t.union([t.literal('true'), t.literal('false')]), refreshInterval: t.string, - comparisonEnabled: toBooleanRt, - comparisonType: comparisonTypeRt, }), + offsetRt, ]), }), }, diff --git a/x-pack/plugins/apm/public/components/routing/app_root.tsx b/x-pack/plugins/apm/public/components/routing/app_root.tsx index 0bab92c74f1bd..3c66f39e268ec 100644 --- a/x-pack/plugins/apm/public/components/routing/app_root.tsx +++ b/x-pack/plugins/apm/public/components/routing/app_root.tsx @@ -37,6 +37,7 @@ import { RedirectWithDefaultDateRange } from '../shared/redirect_with_default_da import { apmRouter } from './apm_route_config'; import { TrackPageview } from './track_pageview'; import { RedirectWithDefaultEnvironment } from '../shared/redirect_with_default_environment'; +import { RedirectWithOffset } from '../shared/redirect_with_offset'; export function ApmAppRoot({ apmPluginContextValue, @@ -63,24 +64,28 @@ export function ApmAppRoot({ - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + + diff --git a/x-pack/plugins/apm/public/components/routing/home/index.tsx b/x-pack/plugins/apm/public/components/routing/home/index.tsx index 6e89df2aea5d2..5955b5bb5d909 100644 --- a/x-pack/plugins/apm/public/components/routing/home/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/home/index.tsx @@ -9,7 +9,6 @@ import { Outlet } from '@kbn/typed-react-router-config'; import * as t from 'io-ts'; import React, { ComponentProps } from 'react'; import { toBooleanRt } from '@kbn/io-ts-utils'; -import { comparisonTypeRt } from '../../../../common/runtime_types/comparison_type_rt'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { environmentRt } from '../../../../common/environment_rt'; import { BackendDetailOverview } from '../../app/backend_detail_overview'; @@ -23,6 +22,7 @@ import { RedirectToBackendOverviewRouteView } from './redirect_to_backend_overvi import { ServiceGroupTemplate } from '../templates/service_group_template'; import { ServiceGroupsRedirect } from '../service_groups_redirect'; import { RedirectTo } from '../redirect_to'; +import { offsetRt } from '../../../../common/offset_rt'; function page({ path, @@ -133,13 +133,13 @@ export const home = { rangeFrom: t.string, rangeTo: t.string, kuery: t.string, + comparisonEnabled: toBooleanRt, }), t.partial({ refreshPaused: t.union([t.literal('true'), t.literal('false')]), refreshInterval: t.string, - comparisonEnabled: toBooleanRt, - comparisonType: comparisonTypeRt, }), + offsetRt, ]), }), defaults: { @@ -171,10 +171,12 @@ export const home = { '/backends': { element: , params: t.partial({ - query: t.partial({ - comparisonEnabled: toBooleanRt, - comparisonType: comparisonTypeRt, - }), + query: t.intersection([ + t.type({ + comparisonEnabled: toBooleanRt, + }), + offsetRt, + ]), }), children: { '/backends/{backendName}/overview': { diff --git a/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx b/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx index a4c2b84d57b35..20fd4284a53cd 100644 --- a/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/service_detail/index.tsx @@ -8,8 +8,7 @@ import * as t from 'io-ts'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { Outlet } from '@kbn/typed-react-router-config'; -import { toBooleanRt } from '@kbn/io-ts-utils'; -import { comparisonTypeRt } from '../../../../common/runtime_types/comparison_type_rt'; +import { toBooleanRt, toNumberRt } from '@kbn/io-ts-utils'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { environmentRt } from '../../../../common/environment_rt'; import { ServiceOverview } from '../../app/service_overview'; @@ -29,6 +28,7 @@ import { ServiceDependencies } from '../../app/service_dependencies'; import { ServiceLogs } from '../../app/service_logs'; import { InfraOverview } from '../../app/infra_overview'; import { LatencyAggregationType } from '../../../../common/latency_aggregation_types'; +import { offsetRt } from '../../../../common/offset_rt'; function page({ title, @@ -78,15 +78,15 @@ export const serviceDetail = { rangeTo: t.string, kuery: t.string, serviceGroup: t.string, + comparisonEnabled: toBooleanRt, }), t.partial({ - comparisonEnabled: toBooleanRt, - comparisonType: comparisonTypeRt, latencyAggregationType: t.string, transactionType: t.string, refreshPaused: t.union([t.literal('true'), t.literal('false')]), refreshInterval: t.string, }), + offsetRt, ]), }), ]), @@ -99,17 +99,27 @@ export const serviceDetail = { }, }, children: { - '/services/{serviceName}/overview': page({ - element: , - tab: 'overview', - title: i18n.translate('xpack.apm.views.overview.title', { - defaultMessage: 'Overview', + '/services/{serviceName}/overview': { + ...page({ + element: , + tab: 'overview', + title: i18n.translate('xpack.apm.views.overview.title', { + defaultMessage: 'Overview', + }), + searchBarOptions: { + showTransactionTypeSelector: true, + showTimeComparison: true, + }, }), - searchBarOptions: { - showTransactionTypeSelector: true, - showTimeComparison: true, - }, - }), + params: t.partial({ + query: t.partial({ + page: toNumberRt, + pageSize: toNumberRt, + sortField: t.string, + sortDirection: t.union([t.literal('asc'), t.literal('desc')]), + }), + }), + }, '/services/{serviceName}/transactions': { ...page({ tab: 'transactions', @@ -122,6 +132,14 @@ export const serviceDetail = { showTimeComparison: true, }, }), + params: t.partial({ + query: t.partial({ + page: toNumberRt, + pageSize: toNumberRt, + sortField: t.string, + sortDirection: t.union([t.literal('asc'), t.literal('desc')]), + }), + }), children: { '/services/{serviceName}/transactions/view': { element: , @@ -129,13 +147,13 @@ export const serviceDetail = { query: t.intersection([ t.type({ transactionName: t.string, + comparisonEnabled: toBooleanRt, }), t.partial({ traceId: t.string, transactionId: t.string, - comparisonEnabled: toBooleanRt, - comparisonType: comparisonTypeRt, }), + offsetRt, ]), }), }, @@ -167,10 +185,10 @@ export const serviceDetail = { }), params: t.partial({ query: t.partial({ - sortDirection: t.string, + page: toNumberRt, + pageSize: toNumberRt, sortField: t.string, - pageSize: t.string, - page: t.string, + sortDirection: t.union([t.literal('asc'), t.literal('desc')]), }), }), children: { diff --git a/x-pack/plugins/apm/public/components/shared/backend_link.stories.tsx b/x-pack/plugins/apm/public/components/shared/backend_link.stories.tsx index d26269d85cc9c..1eca596a86c67 100644 --- a/x-pack/plugins/apm/public/components/shared/backend_link.stories.tsx +++ b/x-pack/plugins/apm/public/components/shared/backend_link.stories.tsx @@ -36,5 +36,6 @@ Example.args = { kuery: '', rangeFrom: 'now-15m', rangeTo: 'now', + comparisonEnabled: false, }, }; diff --git a/x-pack/plugins/apm/public/components/shared/charts/failed_transaction_rate_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/failed_transaction_rate_chart/index.tsx index 77e30c2c67731..8be0ff224ec30 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/failed_transaction_rate_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/failed_transaction_rate_chart/index.tsx @@ -15,10 +15,7 @@ import { useFetcher } from '../../../../hooks/use_fetcher'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { TimeseriesChart } from '../timeseries_chart'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; -import { - getComparisonChartTheme, - getTimeRangeComparison, -} from '../../time_comparison/get_time_range_comparison'; +import { getComparisonChartTheme } from '../../time_comparison/get_comparison_chart_theme'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useTimeRange } from '../../../../hooks/use_time_range'; import { useEnvironmentsContext } from '../../../../context/environments_context/use_environments_context'; @@ -60,7 +57,7 @@ export function FailedTransactionRateChart({ } = useLegacyUrlParams(); const { - query: { rangeFrom, rangeTo, comparisonEnabled, comparisonType }, + query: { rangeFrom, rangeTo, comparisonEnabled, offset }, } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); @@ -74,12 +71,6 @@ export function FailedTransactionRateChart({ const { serviceName, transactionType } = useApmServiceContext(); const comparisonChartTheme = getComparisonChartTheme(); - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const { data = INITIAL_STATE, status } = useFetcher( (callApmApi) => { @@ -98,8 +89,7 @@ export function FailedTransactionRateChart({ end, transactionType, transactionName, - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, }, }, } @@ -114,8 +104,8 @@ export function FailedTransactionRateChart({ end, transactionType, transactionName, - comparisonStart, - comparisonEnd, + offset, + comparisonEnabled, ] ); diff --git a/x-pack/plugins/apm/public/components/shared/charts/latency_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/latency_chart/index.tsx index f13eecaa8ef96..dd8543bc88c9f 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/latency_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/latency_chart/index.tsx @@ -20,7 +20,7 @@ import { } from '../../../shared/charts/transaction_charts/helper'; import { MLHeader } from '../../../shared/charts/transaction_charts/ml_header'; import * as urlHelpers from '../../../shared/links/url_helpers'; -import { getComparisonChartTheme } from '../../time_comparison/get_time_range_comparison'; +import { getComparisonChartTheme } from '../../time_comparison/get_comparison_chart_theme'; import { useEnvironmentsContext } from '../../../../context/environments_context/use_environments_context'; import { ApmMlDetectorType } from '../../../../../common/anomaly_detection/apm_ml_detectors'; import { usePreferredServiceAnomalyTimeseries } from '../../../../hooks/use_preferred_service_anomaly_timeseries'; diff --git a/x-pack/plugins/apm/public/components/shared/charts/latency_chart/latency_chart.stories.tsx b/x-pack/plugins/apm/public/components/shared/charts/latency_chart/latency_chart.stories.tsx index 021c681778763..34ca6a205dbc9 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/latency_chart/latency_chart.stories.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/latency_chart/latency_chart.stories.tsx @@ -69,7 +69,7 @@ const stories: Meta = { return ( diff --git a/x-pack/plugins/apm/public/components/shared/charts/spark_plot/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/spark_plot/index.tsx index c497d35ed2cf6..680cd70bb4d83 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/spark_plot/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/spark_plot/index.tsx @@ -25,7 +25,7 @@ import { useChartTheme } from '../../../../../../observability/public'; import { Coordinate } from '../../../../../typings/timeseries'; import { useTheme } from '../../../../hooks/use_theme'; import { unit } from '../../../../utils/style'; -import { getComparisonChartTheme } from '../../time_comparison/get_time_range_comparison'; +import { getComparisonChartTheme } from '../../time_comparison/get_comparison_chart_theme'; function hasValidTimeseries( series?: Coordinate[] | null diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx index a2bfad0175a5f..c126249d65131 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx @@ -14,7 +14,6 @@ import { LatencyChart } from '../latency_chart'; import { TransactionBreakdownChart } from '../transaction_breakdown_chart'; import { TransactionColdstartRateChart } from '../transaction_coldstart_rate_chart'; import { FailedTransactionRateChart } from '../failed_transaction_rate_chart'; -import { TimeRangeComparisonType } from '../../../../../common/runtime_types/comparison_type_rt'; export function TransactionCharts({ kuery, @@ -24,7 +23,7 @@ export function TransactionCharts({ transactionName, isServerlessContext, comparisonEnabled, - comparisonType, + offset, }: { kuery: string; environment: string; @@ -33,7 +32,7 @@ export function TransactionCharts({ transactionName?: string; isServerlessContext?: boolean; comparisonEnabled?: boolean; - comparisonType?: TimeRangeComparisonType; + offset?: string; }) { return ( <> @@ -71,7 +70,7 @@ export function TransactionCharts({ transactionName={transactionName} environment={environment} comparisonEnabled={comparisonEnabled} - comparisonType={comparisonType} + offset={offset} /> ) : ( diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_coldstart_rate_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_coldstart_rate_chart/index.tsx index b6558bea79d3e..f524b940e04d9 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_coldstart_rate_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_coldstart_rate_chart/index.tsx @@ -20,13 +20,9 @@ import { useFetcher } from '../../../../hooks/use_fetcher'; import { useTheme } from '../../../../hooks/use_theme'; import { TimeseriesChart } from '../timeseries_chart'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; -import { - getComparisonChartTheme, - getTimeRangeComparison, -} from '../../time_comparison/get_time_range_comparison'; +import { getComparisonChartTheme } from '../../time_comparison/get_comparison_chart_theme'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useTimeRange } from '../../../../hooks/use_time_range'; -import { TimeRangeComparisonType } from '../../../../../common/runtime_types/comparison_type_rt'; function yLabelFormat(y?: number | null) { return asPercent(y || 0, 1); @@ -39,7 +35,7 @@ interface Props { environment: string; transactionName?: string; comparisonEnabled?: boolean; - comparisonType?: TimeRangeComparisonType; + offset?: string; } type ColdstartRate = @@ -63,7 +59,7 @@ export function TransactionColdstartRateChart({ kuery, transactionName, comparisonEnabled, - comparisonType, + offset, }: Props) { const theme = useTheme(); @@ -75,12 +71,6 @@ export function TransactionColdstartRateChart({ const { serviceName, transactionType } = useApmServiceContext(); const comparisonChartTheme = getComparisonChartTheme(); - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const endpoint = transactionName ? ('GET /internal/apm/services/{serviceName}/transactions/charts/coldstart_rate_by_transaction_name' as const) @@ -100,8 +90,7 @@ export function TransactionColdstartRateChart({ start, end, transactionType, - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, ...(transactionName ? { transactionName } : {}), }, }, @@ -116,9 +105,9 @@ export function TransactionColdstartRateChart({ end, transactionType, transactionName, - comparisonStart, - comparisonEnd, + offset, endpoint, + comparisonEnabled, ] ); diff --git a/x-pack/plugins/apm/public/components/shared/is_route_with_time_range.ts b/x-pack/plugins/apm/public/components/shared/is_route_with_time_range.ts new file mode 100644 index 0000000000000..a2573c4f65837 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/is_route_with_time_range.ts @@ -0,0 +1,32 @@ +/* + * 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 { Location } from 'history'; +import type { ApmRouter } from '../routing/apm_route_config'; + +export function isRouteWithTimeRange({ + apmRouter, + location, +}: { + apmRouter: ApmRouter; + location: Location; +}) { + const matchingRoutes = apmRouter.getRoutesToMatch(location.pathname); + const matchesRoute = matchingRoutes.some((route) => { + return ( + route.path === '/services' || + route.path === '/traces' || + route.path === '/service-map' || + route.path === '/backends' || + route.path === '/services/{serviceName}' || + route.path === '/service-groups' || + location.pathname === '/' || + location.pathname === '' + ); + }); + + return matchesRoute; +} diff --git a/x-pack/plugins/apm/public/components/shared/links/apm/transaction_detail_link.tsx b/x-pack/plugins/apm/public/components/shared/links/apm/transaction_detail_link.tsx index af299c6095e59..b11ec23586caf 100644 --- a/x-pack/plugins/apm/public/components/shared/links/apm/transaction_detail_link.tsx +++ b/x-pack/plugins/apm/public/components/shared/links/apm/transaction_detail_link.tsx @@ -14,10 +14,6 @@ import { useLegacyUrlParams } from '../../../../context/url_params_context/use_u import { pickKeys } from '../../../../../common/utils/pick_keys'; import { APMQueryParams } from '../url_helpers'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; -import { - TimeRangeComparisonEnum, - TimeRangeComparisonType, -} from '../../../../../common/runtime_types/comparison_type_rt'; import { getComparisonEnabled } from '../../time_comparison/get_comparison_enabled'; interface Props extends APMLinkExtendProps { @@ -29,7 +25,7 @@ interface Props extends APMLinkExtendProps { latencyAggregationType?: string; environment?: string; comparisonEnabled?: boolean; - comparisonType?: TimeRangeComparisonType; + offset?: string; } const persistedFilters: Array = [ @@ -46,7 +42,7 @@ export function TransactionDetailLink({ latencyAggregationType, environment, comparisonEnabled, - comparisonType = TimeRangeComparisonEnum.DayBefore, + offset = '1d', ...rest }: Props) { const { urlParams } = useLegacyUrlParams(); @@ -65,7 +61,7 @@ export function TransactionDetailLink({ transactionName, transactionType, comparisonEnabled: defaultComparisonEnabled, - comparisonType, + offset, ...pickKeys(urlParams as APMQueryParams, ...persistedFilters), ...pickBy({ latencyAggregationType, environment }, identity), }, diff --git a/x-pack/plugins/apm/public/components/shared/links/url_helpers.ts b/x-pack/plugins/apm/public/components/shared/links/url_helpers.ts index ae42abaf4ac7b..093a953dffe94 100644 --- a/x-pack/plugins/apm/public/components/shared/links/url_helpers.ts +++ b/x-pack/plugins/apm/public/components/shared/links/url_helpers.ts @@ -88,7 +88,7 @@ export interface APMQueryParams { percentile?: 50 | 75 | 90 | 95 | 99; latencyAggregationType?: string; comparisonEnabled?: boolean; - comparisonType?: string; + offset?: string; transactionResult?: string; host?: string; containerId?: string; diff --git a/x-pack/plugins/apm/public/components/shared/redirect_with_default_date_range/index.tsx b/x-pack/plugins/apm/public/components/shared/redirect_with_default_date_range/index.tsx index f0056ca6e42e1..dd8393934d561 100644 --- a/x-pack/plugins/apm/public/components/shared/redirect_with_default_date_range/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/redirect_with_default_date_range/index.tsx @@ -8,6 +8,7 @@ import { ReactElement } from 'react'; import { useLocation } from 'react-router-dom'; import { useApmRouter } from '../../../hooks/use_apm_router'; import { useDateRangeRedirect } from '../../../hooks/use_date_range_redirect'; +import { isRouteWithTimeRange } from '../is_route_with_time_range'; // This is a top-level component that blocks rendering of the routes // if there is no valid date range, and redirects to one if needed. @@ -27,23 +28,9 @@ export function RedirectWithDefaultDateRange({ const apmRouter = useApmRouter(); const location = useLocation(); - const matchingRoutes = apmRouter.getRoutesToMatch(location.pathname); + const matchesRoute = isRouteWithTimeRange({ apmRouter, location }); - if ( - !isDateRangeSet && - matchingRoutes.some((route) => { - return ( - route.path === '/services' || - route.path === '/traces' || - route.path === '/service-map' || - route.path === '/backends' || - route.path === '/services/{serviceName}' || - route.path === '/service-groups' || - location.pathname === '/' || - location.pathname === '' - ); - }) - ) { + if (!isDateRangeSet && matchesRoute) { redirect(); return null; } diff --git a/x-pack/plugins/apm/public/components/shared/redirect_with_offset/index.tsx b/x-pack/plugins/apm/public/components/shared/redirect_with_offset/index.tsx new file mode 100644 index 0000000000000..b8f505bf3e3c0 --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/redirect_with_offset/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useLocation, Redirect } from 'react-router-dom'; +import qs from 'query-string'; +import React from 'react'; +import { useApmRouter } from '../../../hooks/use_apm_router'; +import { isRouteWithTimeRange } from '../is_route_with_time_range'; +import { + TimeRangeComparisonEnum, + dayAndWeekBeforeToOffset, +} from '../../../components/shared/time_comparison/get_comparison_options'; +import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; +import { getComparisonEnabled } from '../../../components/shared/time_comparison/get_comparison_enabled'; +import { toBoolean } from '../../../context/url_params_context/helpers'; + +export function RedirectWithOffset({ + children, +}: { + children: React.ReactElement; +}) { + const { core } = useApmPluginContext(); + const location = useLocation(); + const apmRouter = useApmRouter(); + const matchesRoute = isRouteWithTimeRange({ apmRouter, location }); + const query = qs.parse(location.search); + + // Redirect when 'comparisonType' is set as we now use offset instead + // or when 'comparisonEnabled' is not set as it's now required + if ( + matchesRoute && + ('comparisonType' in query || !('comparisonEnabled' in query)) + ) { + const { + comparisonType, + comparisonEnabled: urlComparisonEnabled, + ...queryRest + } = query; + + const comparisonEnabled = getComparisonEnabled({ + core, + urlComparisonEnabled: urlComparisonEnabled + ? toBoolean(urlComparisonEnabled as string) + : undefined, + }).toString(); + + const comparisonTypeEnumValue = comparisonType as + | TimeRangeComparisonEnum.DayBefore + | TimeRangeComparisonEnum.WeekBefore; + + const dayOrWeekOffset = dayAndWeekBeforeToOffset[comparisonTypeEnumValue]; + + return ( + + ); + } + + return children; +} diff --git a/x-pack/plugins/apm/public/components/shared/service_link.stories.tsx b/x-pack/plugins/apm/public/components/shared/service_link.stories.tsx index 55320bfd94bd3..ea21313b7c4cd 100644 --- a/x-pack/plugins/apm/public/components/shared/service_link.stories.tsx +++ b/x-pack/plugins/apm/public/components/shared/service_link.stories.tsx @@ -37,6 +37,7 @@ Example.args = { rangeFrom: 'now-15m', rangeTo: 'now', serviceGroup: '', + comparisonEnabled: false, }, serviceName: 'opbeans-java', }; diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/comparison.test.ts b/x-pack/plugins/apm/public/components/shared/time_comparison/comparison.test.ts index fdb812f57e490..f92bcc8a2d096 100644 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/comparison.test.ts +++ b/x-pack/plugins/apm/public/components/shared/time_comparison/comparison.test.ts @@ -5,8 +5,6 @@ * 2.0. */ -import { TimeRangeComparisonEnum } from '../../../../common/runtime_types/comparison_type_rt'; -import { getTimeRangeComparison } from './get_time_range_comparison'; import { getDateRange } from '../../../context/url_params_context/helpers'; import { getComparisonOptions } from './get_comparison_options'; import moment from 'moment-timezone'; @@ -19,24 +17,7 @@ function getExpectedTimesAndComparisons({ rangeTo: string; }) { const { start, end } = getDateRange({ rangeFrom, rangeTo }); - const comparisonOptions = getComparisonOptions({ start, end }); - - const comparisons = comparisonOptions.map(({ value, text }) => { - const { comparisonStart, comparisonEnd, offset } = getTimeRangeComparison({ - comparisonEnabled: true, - comparisonType: value, - start, - end, - }); - - return { - value, - text, - comparisonStart, - comparisonEnd, - offset, - }; - }); + const comparisons = getComparisonOptions({ start, end }); return { start, @@ -79,18 +60,12 @@ describe('Comparison test suite', () => { it('should return comparison by day and week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.DayBefore, text: 'Day before', - comparisonStart: '2022-01-14T18:00:00.000Z', - comparisonEnd: '2022-01-15T18:30:00.000Z', - offset: '1d', + value: '1d', }, { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2022-01-08T18:00:00.000Z', - comparisonEnd: '2022-01-09T18:30:00.000Z', - offset: '1w', + value: '1w', }, ]); }); @@ -114,11 +89,8 @@ describe('Comparison test suite', () => { it('should only return comparison by week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2022-01-08T18:00:00.000Z', - comparisonEnd: '2022-01-09T19:00:00.000Z', - offset: '1w', + value: '1w', }, ]); }); @@ -142,11 +114,8 @@ describe('Comparison test suite', () => { it('should only return comparison by week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2022-01-08T18:00:00.000Z', - comparisonEnd: '2022-01-15T21:00:00.000Z', - offset: '1w', + value: '1w', }, ]); }); @@ -170,11 +139,8 @@ describe('Comparison test suite', () => { it('should only return comparison by period and format text as DD/MM HH:mm when range years are the same', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.PeriodBefore, text: '07/01 18:00 - 15/01 18:00', - comparisonStart: '2022-01-07T18:00:00.000Z', - comparisonEnd: '2022-01-15T18:00:00.000Z', - offset: '691200000ms', + value: '691200000ms', }, ]); }); @@ -182,7 +148,7 @@ describe('Comparison test suite', () => { it('should have the same offset for start / end and comparisonStart / comparisonEnd', () => { const { start, end, comparisons } = expectation; const diffInMs = moment(end).diff(moment(start)); - expect(`${diffInMs}ms`).toBe(comparisons[0].offset); + expect(`${diffInMs}ms`).toBe(comparisons[0].value); }); }); @@ -204,11 +170,8 @@ describe('Comparison test suite', () => { it('should only return comparison by period and format text as DD/MM HH:mm when range years are the same', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.PeriodBefore, text: '06/01 06:00 - 15/01 00:00', - comparisonStart: '2022-01-06T06:00:00.000Z', - comparisonEnd: '2022-01-15T00:00:00.000Z', - offset: '756000000ms', + value: '756000000ms', }, ]); }); @@ -216,7 +179,7 @@ describe('Comparison test suite', () => { it('should have the same offset for start / end and comparisonStart / comparisonEnd', () => { const { start, end, comparisons } = expectation; const diffInMs = moment(end).diff(moment(start)); - expect(`${diffInMs}ms`).toBe(comparisons[0].offset); + expect(`${diffInMs}ms`).toBe(comparisons[0].value); }); }); @@ -238,18 +201,12 @@ describe('Comparison test suite', () => { it('should return comparison by day and week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.DayBefore, text: 'Day before', - comparisonStart: '2022-01-13T00:00:00.000Z', - comparisonEnd: '2022-01-13T23:59:59.999Z', - offset: '1d', + value: '1d', }, { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2022-01-07T00:00:00.000Z', - comparisonEnd: '2022-01-07T23:59:59.999Z', - offset: '1w', + value: '1w', }, ]); }); @@ -273,11 +230,8 @@ describe('Comparison test suite', () => { it('should only return comparison by week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2022-01-02T00:00:00.000Z', - comparisonEnd: '2022-01-08T23:59:59.999Z', - offset: '1w', + value: '1w', }, ]); }); @@ -301,18 +255,12 @@ describe('Comparison test suite', () => { it('should return comparison by day and week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.DayBefore, text: 'Day before', - comparisonStart: '2022-01-12T18:30:15.500Z', - comparisonEnd: '2022-01-13T18:30:15.500Z', - offset: '1d', + value: '1d', }, { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2022-01-06T18:30:15.500Z', - comparisonEnd: '2022-01-07T18:30:15.500Z', - offset: '1w', + value: '1w', }, ]); }); @@ -336,18 +284,12 @@ describe('Comparison test suite', () => { it('should return comparison by day and week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.DayBefore, text: 'Day before', - comparisonStart: '2022-01-12T18:00:00.000Z', - comparisonEnd: '2022-01-13T18:30:15.500Z', - offset: '1d', + value: '1d', }, { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2022-01-06T18:00:00.000Z', - comparisonEnd: '2022-01-07T18:30:15.500Z', - offset: '1w', + value: '1w', }, ]); }); @@ -371,11 +313,8 @@ describe('Comparison test suite', () => { it('should only return comparison by week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2021-12-31T18:30:15.500Z', - comparisonEnd: '2022-01-07T18:30:15.500Z', - offset: '1w', + value: '1w', }, ]); }); @@ -399,11 +338,8 @@ describe('Comparison test suite', () => { it('should only return comparison by week', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.WeekBefore, text: 'Week before', - comparisonStart: '2021-12-31T00:00:00.000Z', - comparisonEnd: '2022-01-07T18:30:15.500Z', - offset: '1w', + value: '1w', }, ]); }); @@ -427,11 +363,8 @@ describe('Comparison test suite', () => { it('should only return comparison by period and format text as DD/MM/YY HH:mm when range years are different', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.PeriodBefore, text: '15/11/21 18:30 - 15/12/21 18:30', - comparisonStart: '2021-11-15T18:30:15.500Z', - comparisonEnd: '2021-12-15T18:30:15.500Z', - offset: '2592000000ms', + value: '2592000000ms', }, ]); }); @@ -439,7 +372,7 @@ describe('Comparison test suite', () => { it('should have the same offset for start / end and comparisonStart / comparisonEnd', () => { const { start, end, comparisons } = expectation; const diffInMs = moment(end).diff(moment(start)); - expect(`${diffInMs}ms`).toBe(comparisons[0].offset); + expect(`${diffInMs}ms`).toBe(comparisons[0].value); }); }); @@ -461,11 +394,8 @@ describe('Comparison test suite', () => { it('should only return comparison by period and format text as DD/MM/YY HH:mm when range years are different', () => { expect(expectation.comparisons).toEqual([ { - value: TimeRangeComparisonEnum.PeriodBefore, text: '14/11/21 05:29 - 15/12/21 00:00', - comparisonStart: '2021-11-14T05:29:44.500Z', - comparisonEnd: '2021-12-15T00:00:00.000Z', - offset: '2658615500ms', + value: '2658615500ms', }, ]); }); @@ -473,7 +403,7 @@ describe('Comparison test suite', () => { it('should have the same offset for start / end and comparisonStart / comparisonEnd', () => { const { start, end, comparisons } = expectation; const diffInMs = moment(end).diff(moment(start)); - expect(`${diffInMs}ms`).toBe(comparisons[0].offset); + expect(`${diffInMs}ms`).toBe(comparisons[0].value); }); }); }); diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/get_comparison_chart_theme.ts b/x-pack/plugins/apm/public/components/shared/time_comparison/get_comparison_chart_theme.ts new file mode 100644 index 0000000000000..91e8461f6d39c --- /dev/null +++ b/x-pack/plugins/apm/public/components/shared/time_comparison/get_comparison_chart_theme.ts @@ -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 { PartialTheme } from '@elastic/charts'; + +export function getComparisonChartTheme(): PartialTheme { + return { + areaSeriesStyle: { + area: { + visible: true, + opacity: 0.5, + }, + line: { + strokeWidth: 1, + visible: true, + }, + point: { + visible: false, + }, + }, + }; +} diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/get_comparison_options.ts b/x-pack/plugins/apm/public/components/shared/time_comparison/get_comparison_options.ts index 9400f668a18f0..741b955d16931 100644 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/get_comparison_options.ts +++ b/x-pack/plugins/apm/public/components/shared/time_comparison/get_comparison_options.ts @@ -7,54 +7,56 @@ import moment from 'moment'; import { i18n } from '@kbn/i18n'; -import { TimeRangeComparisonEnum } from '../../../../common/runtime_types/comparison_type_rt'; -import { getTimeRangeComparison } from './get_time_range_comparison'; +import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; -const eightDaysInHours = moment.duration(8, 'd').asHours(); - -function getDateFormat({ - previousPeriodStart, - currentPeriodEnd, -}: { - previousPeriodStart?: string; - currentPeriodEnd?: string; -}) { - const momentPreviousPeriodStart = moment(previousPeriodStart); - const momentCurrentPeriodEnd = moment(currentPeriodEnd); - const isDifferentYears = - momentPreviousPeriodStart.get('year') !== - momentCurrentPeriodEnd.get('year'); - return isDifferentYears ? 'DD/MM/YY HH:mm' : 'DD/MM HH:mm'; +export enum TimeRangeComparisonEnum { + WeekBefore = 'week', + DayBefore = 'day', + PeriodBefore = 'period', } +export const dayAndWeekBeforeToOffset = { + [TimeRangeComparisonEnum.DayBefore]: '1d', + [TimeRangeComparisonEnum.WeekBefore]: '1w', +} as const; + +const twentyFiveHoursInMs = moment.duration(25, 'h').asMilliseconds(); +const eightDaysInMs = moment.duration(8, 'd').asMilliseconds(); + function formatDate({ - dateFormat, + currentPeriodEnd, previousPeriodStart, previousPeriodEnd, }: { - dateFormat: string; - previousPeriodStart?: string; - previousPeriodEnd?: string; + currentPeriodEnd: moment.Moment; + previousPeriodStart: moment.Moment; + previousPeriodEnd: moment.Moment; }) { - const momentStart = moment(previousPeriodStart); - const momentEnd = moment(previousPeriodEnd); - return `${momentStart.format(dateFormat)} - ${momentEnd.format(dateFormat)}`; + const isDifferentYears = + previousPeriodStart.get('year') !== currentPeriodEnd.get('year'); + const dateFormat = isDifferentYears ? 'DD/MM/YY HH:mm' : 'DD/MM HH:mm'; + + return `${previousPeriodStart.format( + dateFormat + )} - ${previousPeriodEnd.format(dateFormat)}`; } function getSelectOptions({ comparisonTypes, start, end, + msDiff, }: { comparisonTypes: TimeRangeComparisonEnum[]; - start?: string; - end?: string; + start: moment.Moment; + end: moment.Moment; + msDiff: number; }) { return comparisonTypes.map((value) => { switch (value) { case TimeRangeComparisonEnum.DayBefore: { return { - value, + value: dayAndWeekBeforeToOffset[TimeRangeComparisonEnum.DayBefore], text: i18n.translate('xpack.apm.timeComparison.select.dayBefore', { defaultMessage: 'Day before', }), @@ -62,31 +64,27 @@ function getSelectOptions({ } case TimeRangeComparisonEnum.WeekBefore: { return { - value, + value: dayAndWeekBeforeToOffset[TimeRangeComparisonEnum.WeekBefore], text: i18n.translate('xpack.apm.timeComparison.select.weekBefore', { defaultMessage: 'Week before', }), }; } case TimeRangeComparisonEnum.PeriodBefore: { - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - comparisonType: TimeRangeComparisonEnum.PeriodBefore, - start, - end, - comparisonEnabled: true, - }); + const offset = `${msDiff}ms`; - const dateFormat = getDateFormat({ - previousPeriodStart: comparisonStart, - currentPeriodEnd: end, + const { startWithOffset, endWithOffset } = getOffsetInMs({ + start: start.valueOf(), + end: end.valueOf(), + offset, }); return { - value, + value: offset, text: formatDate({ - dateFormat, - previousPeriodStart: comparisonStart, - previousPeriodEnd: comparisonEnd, + currentPeriodEnd: end, + previousPeriodStart: moment(startWithOffset), + previousPeriodEnd: moment(endWithOffset), }), }; } @@ -103,18 +101,18 @@ export function getComparisonOptions({ }) { const momentStart = moment(start); const momentEnd = moment(end); - const hourDiff = momentEnd.diff(momentStart, 'h', true); + const msDiff = momentEnd.diff(momentStart, 'ms', true); let comparisonTypes: TimeRangeComparisonEnum[]; - if (hourDiff < 25) { + if (msDiff < twentyFiveHoursInMs) { // Less than 25 hours. This is because relative times may be rounded when // asking for a day, which can result in a duration > 24h. (e.g. rangeFrom: 'now-24h/h, rangeTo: 'now') comparisonTypes = [ TimeRangeComparisonEnum.DayBefore, TimeRangeComparisonEnum.WeekBefore, ]; - } else if (hourDiff < eightDaysInHours) { + } else if (msDiff < eightDaysInMs) { // Less than 8 days. This is because relative times may be rounded when // asking for a week, which can result in a duration > 7d. (e.g. rangeFrom: 'now-7d/d, rangeTo: 'now') comparisonTypes = [TimeRangeComparisonEnum.WeekBefore]; @@ -122,5 +120,10 @@ export function getComparisonOptions({ comparisonTypes = [TimeRangeComparisonEnum.PeriodBefore]; } - return getSelectOptions({ comparisonTypes, start, end }); + return getSelectOptions({ + comparisonTypes, + start: momentStart, + end: momentEnd, + msDiff, + }); } diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/get_time_range_comparison.test.ts b/x-pack/plugins/apm/public/components/shared/time_comparison/get_time_range_comparison.test.ts deleted file mode 100644 index c6619ad6d35f3..0000000000000 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/get_time_range_comparison.test.ts +++ /dev/null @@ -1,44 +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 { TimeRangeComparisonEnum } from '../../../../common/runtime_types/comparison_type_rt'; -import { getTimeRangeComparison } from './get_time_range_comparison'; - -describe('getTimeRangeComparison', () => { - describe('return empty object', () => { - it('when comparison is disabled', () => { - const end = '2021-01-28T15:00:00.000Z'; - const result = getTimeRangeComparison({ - start: undefined, - end, - comparisonType: TimeRangeComparisonEnum.DayBefore, - comparisonEnabled: false, - }); - expect(result).toEqual({}); - }); - it('when start is not defined', () => { - const end = '2021-01-28T15:00:00.000Z'; - const result = getTimeRangeComparison({ - start: undefined, - end, - comparisonType: TimeRangeComparisonEnum.DayBefore, - comparisonEnabled: true, - }); - expect(result).toEqual({}); - }); - - it('when end is not defined', () => { - const start = '2021-01-28T14:45:00.000Z'; - const result = getTimeRangeComparison({ - start, - end: undefined, - comparisonType: TimeRangeComparisonEnum.DayBefore, - comparisonEnabled: true, - }); - expect(result).toEqual({}); - }); - }); -}); diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/get_time_range_comparison.ts b/x-pack/plugins/apm/public/components/shared/time_comparison/get_time_range_comparison.ts deleted file mode 100644 index 6a1f7b1978ca0..0000000000000 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/get_time_range_comparison.ts +++ /dev/null @@ -1,78 +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 { PartialTheme } from '@elastic/charts'; -import moment from 'moment'; -import { - TimeRangeComparisonType, - TimeRangeComparisonEnum, -} from '../../../../common/runtime_types/comparison_type_rt'; - -export function getComparisonChartTheme(): PartialTheme { - return { - areaSeriesStyle: { - area: { - visible: true, - opacity: 0.5, - }, - line: { - strokeWidth: 1, - visible: true, - }, - point: { - visible: false, - }, - }, - }; -} - -const oneDayInMilliseconds = moment.duration(1, 'day').asMilliseconds(); -const oneWeekInMilliseconds = moment.duration(1, 'week').asMilliseconds(); - -export function getTimeRangeComparison({ - comparisonEnabled, - comparisonType, - start, - end, -}: { - comparisonEnabled?: boolean; - comparisonType?: TimeRangeComparisonType; - start?: string; - end?: string; -}) { - if (!comparisonEnabled || !comparisonType || !start || !end) { - return {}; - } - const startMoment = moment(start); - const endMoment = moment(end); - - let diff: number; - let offset: string; - - switch (comparisonType) { - case TimeRangeComparisonEnum.DayBefore: - diff = oneDayInMilliseconds; - offset = '1d'; - break; - case TimeRangeComparisonEnum.WeekBefore: - diff = oneWeekInMilliseconds; - offset = '1w'; - break; - case TimeRangeComparisonEnum.PeriodBefore: - diff = endMoment.diff(startMoment); - offset = `${diff}ms`; - break; - default: - throw new Error('Unknown comparisonType'); - } - - return { - comparisonStart: startMoment.subtract(diff, 'ms').toISOString(), - comparisonEnd: endMoment.subtract(diff, 'ms').toISOString(), - offset, - }; -} diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/index.test.tsx b/x-pack/plugins/apm/public/components/shared/time_comparison/index.test.tsx index 83d2962316aa2..93d24208a0681 100644 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/index.test.tsx +++ b/x-pack/plugins/apm/public/components/shared/time_comparison/index.test.tsx @@ -18,22 +18,17 @@ import * as urlHelpers from '../../shared/links/url_helpers'; import moment from 'moment'; import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; -import { - TimeRangeComparisonType, - TimeRangeComparisonEnum, -} from '../../../../common/runtime_types/comparison_type_rt'; -import { MockUrlParamsContextProvider } from '../../../context/url_params_context/mock_url_params_context_provider'; function getWrapper({ rangeFrom, rangeTo, - comparisonType, + offset, comparisonEnabled, environment = ENVIRONMENT_ALL.value, }: { rangeFrom: string; rangeTo: string; - comparisonType?: TimeRangeComparisonType; + offset?: string; comparisonEnabled?: boolean; environment?: string; }) { @@ -41,16 +36,12 @@ function getWrapper({ return ( - - - {children} - - + + {children} + ); }; @@ -76,8 +67,7 @@ describe('TimeComparison component', () => { render(, { wrapper: Wrapper }); expect(spy).toHaveBeenCalledWith(expect.anything(), { query: { - comparisonEnabled: 'true', - comparisonType: TimeRangeComparisonEnum.DayBefore, + offset: '1d', }, }); }); @@ -87,7 +77,7 @@ describe('TimeComparison component', () => { rangeFrom: '2021-06-04T16:17:02.335Z', rangeTo: '2021-06-04T16:32:02.335Z', comparisonEnabled: true, - comparisonType: TimeRangeComparisonEnum.DayBefore, + offset: '1d', }); const component = render(, { wrapper: Wrapper }); expectTextsInDocument(component, ['Day before', 'Week before']); @@ -102,7 +92,7 @@ describe('TimeComparison component', () => { rangeFrom: '2021-06-03T16:31:35.748Z', rangeTo: '2021-06-04T16:31:35.748Z', comparisonEnabled: true, - comparisonType: TimeRangeComparisonEnum.DayBefore, + offset: '1d', }); const component = render(, { wrapper: Wrapper }); expectTextsInDocument(component, ['Day before', 'Week before']); @@ -119,7 +109,7 @@ describe('TimeComparison component', () => { rangeFrom: '2021-06-02T12:32:00.000Z', rangeTo: '2021-06-03T13:32:09.079Z', comparisonEnabled: true, - comparisonType: TimeRangeComparisonEnum.WeekBefore, + offset: '1w', }); const component = render(, { wrapper: Wrapper, @@ -138,8 +128,7 @@ describe('TimeComparison component', () => { }); expect(spy).toHaveBeenCalledWith(expect.anything(), { query: { - comparisonEnabled: 'true', - comparisonType: TimeRangeComparisonEnum.WeekBefore, + offset: '1w', }, }); }); @@ -149,7 +138,7 @@ describe('TimeComparison component', () => { rangeFrom: '2021-06-02T12:32:00.000Z', rangeTo: '2021-06-03T13:32:09.079Z', comparisonEnabled: true, - comparisonType: TimeRangeComparisonEnum.WeekBefore, + offset: '1w', }); const component = render(, { wrapper: Wrapper, @@ -169,7 +158,7 @@ describe('TimeComparison component', () => { rangeFrom: '2021-05-27T16:32:46.747Z', rangeTo: '2021-06-04T16:32:46.747Z', comparisonEnabled: true, - comparisonType: TimeRangeComparisonEnum.PeriodBefore, + offset: '691200000ms', }); const component = render(, { wrapper: Wrapper, @@ -187,7 +176,7 @@ describe('TimeComparison component', () => { rangeFrom: '2020-05-27T16:32:46.747Z', rangeTo: '2021-06-04T16:32:46.747Z', comparisonEnabled: true, - comparisonType: TimeRangeComparisonEnum.PeriodBefore, + offset: '32227200000ms', }); const component = render(, { wrapper: Wrapper, diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx b/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx index cb0bc870354c4..d587d363d921d 100644 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx @@ -11,13 +11,10 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; import { useUiTracker } from '../../../../../observability/public'; -import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params'; -import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { useAnyOfApmParams } from '../../../hooks/use_apm_params'; import { useBreakpoints } from '../../../hooks/use_breakpoints'; import { useTimeRange } from '../../../hooks/use_time_range'; import * as urlHelpers from '../../shared/links/url_helpers'; -import { getComparisonEnabled } from './get_comparison_enabled'; import { getComparisonOptions } from './get_comparison_options'; const PrependContainer = euiStyled.div` @@ -30,49 +27,25 @@ const PrependContainer = euiStyled.div` `; export function TimeComparison() { - const { core } = useApmPluginContext(); const trackApmEvent = useUiTracker({ app: 'apm' }); const history = useHistory(); const { isSmall } = useBreakpoints(); const { - query: { rangeFrom, rangeTo }, + query: { rangeFrom, rangeTo, comparisonEnabled, offset }, } = useAnyOfApmParams('/services', '/backends/*', '/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { - urlParams: { comparisonEnabled, comparisonType }, - } = useLegacyUrlParams(); - const comparisonOptions = getComparisonOptions({ start, end }); - // Sets default values - if (comparisonEnabled === undefined || comparisonType === undefined) { - urlHelpers.replace(history, { - query: { - comparisonEnabled: - getComparisonEnabled({ - core, - urlComparisonEnabled: comparisonEnabled, - }) === false - ? 'false' - : 'true', - comparisonType: comparisonType - ? comparisonType - : comparisonOptions[0].value, - }, - }); - return null; - } - const isSelectedComparisonTypeAvailable = comparisonOptions.some( - ({ value }) => value === comparisonType + ({ value }) => value === offset ); // Replaces type when current one is no longer available in the select options if (comparisonOptions.length !== 0 && !isSelectedComparisonTypeAvailable) { urlHelpers.replace(history, { - query: { comparisonType: comparisonOptions[0].value }, + query: { offset: comparisonOptions[0].value }, }); return null; } @@ -83,7 +56,7 @@ export function TimeComparison() { data-test-subj="comparisonSelect" disabled={!comparisonEnabled} options={comparisonOptions} - value={comparisonType} + value={offset} prepend={ ; @@ -50,7 +49,7 @@ export function getColumns({ transactionGroupDetailedStatistics, comparisonEnabled, shouldShowSparkPlots = true, - comparisonType, + offset, }: { serviceName: string; latencyAggregationType?: LatencyAggregationType; @@ -58,8 +57,8 @@ export function getColumns({ transactionGroupDetailedStatistics?: TransactionGroupDetailedStatistics; comparisonEnabled?: boolean; shouldShowSparkPlots?: boolean; - comparisonType?: TimeRangeComparisonType; -}): Array> { + offset?: string; +}): Array> { return [ { field: 'name', @@ -79,7 +78,7 @@ export function getColumns({ transactionType={type} latencyAggregationType={latencyAggregationType} comparisonEnabled={comparisonEnabled} - comparisonType={comparisonType} + offset={offset} > {name} diff --git a/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx b/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx index 66f068f6cb05c..5374439a32609 100644 --- a/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx @@ -5,26 +5,31 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; +import { + EuiBasicTable, + EuiFlexGroup, + EuiFlexItem, + EuiTitle, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { orderBy } from 'lodash'; -import React, { useState } from 'react'; +import React, { useMemo, useState } from 'react'; import uuid from 'uuid'; import { EuiCallOut } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; +import { useHistory } from 'react-router-dom'; import { APIReturnType } from '../../../services/rest/create_call_apm_api'; import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { TransactionOverviewLink } from '../links/apm/transaction_overview_link'; -import { getTimeRangeComparison } from '../time_comparison/get_time_range_comparison'; import { OverviewTableContainer } from '../overview_table_container'; import { getColumns } from './get_columns'; import { ElasticDocsLink } from '../links/elastic_docs_link'; import { useBreakpoints } from '../../../hooks/use_breakpoints'; -import { ManagedTable } from '../managed_table'; import { useAnyOfApmParams } from '../../../hooks/use_apm_params'; import { LatencyAggregationType } from '../../../../common/latency_aggregation_types'; +import { fromQuery, toQuery } from '../links/url_helpers'; type ApiResponse = APIReturnType<'GET /internal/apm/services/{serviceName}/transactions/groups/main_statistics'>; @@ -64,6 +69,7 @@ interface Props { kuery: string; start: string; end: string; + saveTableOptionsToUrl?: boolean; } export function TransactionsTable({ @@ -77,39 +83,45 @@ export function TransactionsTable({ kuery, start, end, + saveTableOptionsToUrl = false, }: Props) { - const [tableOptions] = useState<{ - pageIndex: number; - sort: { - direction: SortDirection; - field: SortField; - }; + const history = useHistory(); + + const { + query: { + comparisonEnabled, + offset, + latencyAggregationType, + page: urlPage = 0, + pageSize: urlPageSize = numberOfTransactionsPerPage, + sortField: urlSortField = 'impact', + sortDirection: urlSortDirection = 'desc', + }, + } = useAnyOfApmParams( + '/services/{serviceName}/transactions', + '/services/{serviceName}/overview' + ); + + const [tableOptions, setTableOptions] = useState<{ + page: { index: number; size: number }; + sort: { direction: SortDirection; field: SortField }; }>({ - pageIndex: 0, - sort: DEFAULT_SORT, + page: { index: urlPage, size: urlPageSize }, + sort: { + field: urlSortField as SortField, + direction: urlSortDirection as SortDirection, + }, }); // SparkPlots should be hidden if we're in two-column view and size XL (1200px) const { isXl } = useBreakpoints(); const shouldShowSparkPlots = isSingleColumn || !isXl; - const { pageIndex, sort } = tableOptions; + const { page, sort } = tableOptions; const { direction, field } = sort; + const { index, size } = page; const { transactionType, serviceName } = useApmServiceContext(); - const { - query: { comparisonEnabled, comparisonType, latencyAggregationType }, - } = useAnyOfApmParams( - '/services/{serviceName}/transactions', - '/services/{serviceName}/overview' - ); - - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const { data = INITIAL_STATE, status } = useFetcher( (callApmApi) => { @@ -137,10 +149,7 @@ export function TransactionsTable({ response.transactionGroups, field, direction - ).slice( - pageIndex * numberOfTransactionsPerPage, - (pageIndex + 1) * numberOfTransactionsPerPage - ); + ).slice(index * size, (index + 1) * size); return { // Everytime the main statistics is refetched, updates the requestId making the detailed API to be refetched. @@ -162,11 +171,12 @@ export function TransactionsTable({ end, transactionType, latencyAggregationType, - pageIndex, + index, + size, direction, field, - // not used, but needed to trigger an update when comparisonType is changed either manually by user or when time range is changed - comparisonType, + // not used, but needed to trigger an update when offset is changed either manually by user or when time range is changed + offset, // not used, but needed to trigger an update when comparison feature is disabled/enabled by user comparisonEnabled, ] @@ -211,8 +221,7 @@ export function TransactionsTable({ transactionNames: JSON.stringify( transactionGroups.map(({ name }) => name).sort() ), - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, }, }, } @@ -234,12 +243,27 @@ export function TransactionsTable({ transactionGroupDetailedStatistics, comparisonEnabled, shouldShowSparkPlots, - comparisonType, + offset, }); const isLoading = status === FETCH_STATUS.LOADING; const isNotInitiated = status === FETCH_STATUS.NOT_INITIATED; + const pagination = useMemo( + () => ({ + pageIndex: index, + pageSize: size, + totalItemCount: transactionGroupsTotalItems, + showPerPageOptions, + }), + [index, size, transactionGroupsTotalItems, showPerPageOptions] + ); + + const sorting = useMemo( + () => ({ sort: { field, direction } }), + [field, direction] + ); + return ( - { + setTableOptions({ + page: { + index: newTableOptions.page?.index ?? 0, + size: + newTableOptions.page?.size ?? numberOfTransactionsPerPage, + }, + sort: newTableOptions.sort + ? { + field: newTableOptions.sort.field as SortField, + direction: newTableOptions.sort.direction, + } + : DEFAULT_SORT, + }); + if (saveTableOptionsToUrl) { + history.push({ + ...history.location, + search: fromQuery({ + ...toQuery(history.location.search), + page: newTableOptions.page?.index, + pageSize: newTableOptions.page?.size, + sortField: newTableOptions.sort?.field, + sortDirection: newTableOptions.sort?.direction, + }), + }); + } + }} /> diff --git a/x-pack/plugins/apm/public/context/apm_plugin/mock_apm_plugin_context.tsx b/x-pack/plugins/apm/public/context/apm_plugin/mock_apm_plugin_context.tsx index fc3771dba499f..025338bb53517 100644 --- a/x-pack/plugins/apm/public/context/apm_plugin/mock_apm_plugin_context.tsx +++ b/x-pack/plugins/apm/public/context/apm_plugin/mock_apm_plugin_context.tsx @@ -19,6 +19,7 @@ import { UI_SETTINGS } from '../../../../../../src/plugins/data/common'; import { createCallApmApi } from '../../services/rest/create_call_apm_api'; import { apmRouter } from '../../components/routing/apm_route_config'; import { MlLocatorDefinition } from '../../../../ml/public'; +import { enableComparisonByDefault } from '../../../../observability/public'; const coreStart = coreMock.createStart({ basePath: '/basepath' }); @@ -52,6 +53,7 @@ const mockCore = merge({}, coreStart, { pause: false, value: 100000, }, + [enableComparisonByDefault]: true, }; return uiSettings[key]; }, diff --git a/x-pack/plugins/apm/public/context/url_params_context/resolve_url_params.ts b/x-pack/plugins/apm/public/context/url_params_context/resolve_url_params.ts index 5bb3a46c3aea4..3a2d1a709b376 100644 --- a/x-pack/plugins/apm/public/context/url_params_context/resolve_url_params.ts +++ b/x-pack/plugins/apm/public/context/url_params_context/resolve_url_params.ts @@ -6,7 +6,6 @@ */ import { Location } from 'history'; -import { TimeRangeComparisonType } from '../../../common/runtime_types/comparison_type_rt'; import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values'; import { LatencyAggregationType } from '../../../common/latency_aggregation_types'; import { toQuery } from '../../components/shared/links/url_helpers'; @@ -49,7 +48,7 @@ export function resolveUrlParams(location: Location, state: TimeUrlParams) { percentile, latencyAggregationType = LatencyAggregationType.avg, comparisonEnabled, - comparisonType, + offset, } = query; return removeUndefinedProps({ @@ -83,6 +82,6 @@ export function resolveUrlParams(location: Location, state: TimeUrlParams) { comparisonEnabled: comparisonEnabled ? toBoolean(comparisonEnabled) : undefined, - comparisonType: comparisonType as TimeRangeComparisonType | undefined, + offset, }); } diff --git a/x-pack/plugins/apm/public/context/url_params_context/types.ts b/x-pack/plugins/apm/public/context/url_params_context/types.ts index 6c0f10f78e7c8..d5932ff73cafb 100644 --- a/x-pack/plugins/apm/public/context/url_params_context/types.ts +++ b/x-pack/plugins/apm/public/context/url_params_context/types.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { TimeRangeComparisonType } from '../../../common/runtime_types/comparison_type_rt'; import { LatencyAggregationType } from '../../../common/latency_aggregation_types'; export interface UrlParams { @@ -34,7 +33,7 @@ export interface UrlParams { percentile?: number; latencyAggregationType?: LatencyAggregationType; comparisonEnabled?: boolean; - comparisonType?: TimeRangeComparisonType; + offset?: string; } export type UxUrlParams = UrlParams; diff --git a/x-pack/plugins/apm/public/hooks/use_error_group_distribution_fetcher.tsx b/x-pack/plugins/apm/public/hooks/use_error_group_distribution_fetcher.tsx index 62e2ab92c4fcc..3f983adf204dc 100644 --- a/x-pack/plugins/apm/public/hooks/use_error_group_distribution_fetcher.tsx +++ b/x-pack/plugins/apm/public/hooks/use_error_group_distribution_fetcher.tsx @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { getTimeRangeComparison } from '../components/shared/time_comparison/get_time_range_comparison'; import { useApmParams } from './use_apm_params'; import { useFetcher } from './use_fetcher'; import { useTimeRange } from './use_time_range'; @@ -21,16 +20,11 @@ export function useErrorGroupDistributionFetcher({ environment: string; }) { const { - query: { rangeFrom, rangeTo, comparisonEnabled, comparisonType }, + query: { rangeFrom, rangeTo, offset, comparisonEnabled }, } = useApmParams('/services/{serviceName}/errors'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); + const { data, status } = useFetcher( (callApmApi) => { if (start && end) { @@ -44,8 +38,7 @@ export function useErrorGroupDistributionFetcher({ kuery, start, end, - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, groupId, }, }, @@ -59,9 +52,9 @@ export function useErrorGroupDistributionFetcher({ serviceName, start, end, - comparisonStart, - comparisonEnd, + offset, groupId, + comparisonEnabled, ] ); diff --git a/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts b/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts index 8dbc1f3a47505..62f21b77f4a15 100644 --- a/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts +++ b/x-pack/plugins/apm/public/hooks/use_transaction_latency_chart_fetcher.ts @@ -10,7 +10,6 @@ import { useFetcher } from './use_fetcher'; import { useLegacyUrlParams } from '../context/url_params_context/use_url_params'; import { useApmServiceContext } from '../context/apm_service/use_apm_service_context'; import { getLatencyChartSelector } from '../selectors/latency_chart_selectors'; -import { getTimeRangeComparison } from '../components/shared/time_comparison/get_time_range_comparison'; import { useTimeRange } from './use_time_range'; import { useApmParams } from './use_apm_params'; @@ -27,17 +26,11 @@ export function useTransactionLatencyChartsFetcher({ } = useLegacyUrlParams(); const { - query: { rangeFrom, rangeTo, comparisonType, comparisonEnabled }, + query: { rangeFrom, rangeTo, offset, comparisonEnabled }, } = useApmParams('/services/{serviceName}'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ - start, - end, - comparisonType, - comparisonEnabled, - }); const { data, error, status } = useFetcher( (callApmApi) => { if ( @@ -60,8 +53,7 @@ export function useTransactionLatencyChartsFetcher({ transactionType, transactionName, latencyAggregationType, - comparisonStart, - comparisonEnd, + offset: comparisonEnabled ? offset : undefined, }, }, } @@ -77,8 +69,8 @@ export function useTransactionLatencyChartsFetcher({ transactionName, transactionType, latencyAggregationType, - comparisonStart, - comparisonEnd, + offset, + comparisonEnabled, ] ); diff --git a/x-pack/plugins/apm/public/tutorial/config_agent/index.tsx b/x-pack/plugins/apm/public/tutorial/config_agent/index.tsx index 087ea8094ea79..68952193282fd 100644 --- a/x-pack/plugins/apm/public/tutorial/config_agent/index.tsx +++ b/x-pack/plugins/apm/public/tutorial/config_agent/index.tsx @@ -9,10 +9,6 @@ import { i18n } from '@kbn/i18n'; import { HttpStart } from 'kibana/public'; import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { - isPrereleaseVersion, - SUPPORTED_APM_PACKAGE_VERSION, -} from '../../../common/fleet'; import { APIReturnType } from '../../services/rest/create_call_apm_api'; import { getCommands } from './commands/get_commands'; import { getPolicyOptions, PolicyOption } from './get_policy_options'; @@ -72,9 +68,7 @@ function getFleetLink({ } : { label: GET_STARTED_WITH_FLEET_LABEL, - href: isPrereleaseVersion(kibanaVersion) - ? `${basePath}/app/integrations#/detail/apm/overview` - : `${basePath}/app/integrations#/detail/apm-${SUPPORTED_APM_PACKAGE_VERSION}/overview`, + href: `${basePath}/app/integrations#/detail/apm/overview`, }; } diff --git a/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx b/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx index 460f61d8ae1c5..87a0d216648f9 100644 --- a/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx +++ b/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx @@ -19,10 +19,6 @@ import { i18n } from '@kbn/i18n'; import { HttpStart } from 'kibana/public'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { - isPrereleaseVersion, - SUPPORTED_APM_PACKAGE_VERSION, -} from '../../../common/fleet'; import { APIReturnType } from '../../services/rest/create_call_apm_api'; interface Props { @@ -78,9 +74,7 @@ function TutorialFleetInstructions({ const apmIntegrationHref = shouldLinkToMigration ? `${basePath}/app/apm/settings/schema` - : isPrereleaseVersion(kibanaVersion) - ? `${basePath}/app/integrations#/detail/apm/overview` - : `${basePath}/app/integrations/detail/apm-${SUPPORTED_APM_PACKAGE_VERSION}/overview`; + : `${basePath}/app/integrations#/detail/apm/overview`; if (isLoading) { return ( @@ -96,7 +90,7 @@ function TutorialFleetInstructions({ {i18n.translate( 'xpack.apm.tutorial.apmServer.fleet.manageApmIntegration.button', diff --git a/x-pack/plugins/apm/scripts/test/api.js b/x-pack/plugins/apm/scripts/test/api.js index 1905c8eb7c2dd..5769224f90ac2 100644 --- a/x-pack/plugins/apm/scripts/test/api.js +++ b/x-pack/plugins/apm/scripts/test/api.js @@ -39,9 +39,22 @@ const { argv } = yargs(process.argv.slice(2)) type: 'string', description: 'Specify the spec files to run', }) + .option('inspect', { + default: false, + type: 'boolean', + description: 'Add --inspect-brk flag to the ftr for debugging', + }) + .check((argv) => { + const { inspect, runner } = argv; + if (inspect && !runner) { + throw new Error('--inspect can only be used with --runner'); + } else { + return true; + } + }) .help(); -const { trial, server, runner, grep } = argv; +const { trial, server, runner, grep, inspect } = argv; const license = trial ? 'trial' : 'basic'; console.log(`License: ${license}`); @@ -53,8 +66,9 @@ if (server) { ftrScript = 'functional_test_runner'; } +const inspectArg = inspect ? '--inspect-brk' : ''; const grepArg = grep ? `--grep "${grep}"` : ''; -const cmd = `node ../../../../scripts/${ftrScript} ${grepArg} --config ../../../../test/apm_api_integration/${license}/config.ts`; +const cmd = `node ${inspectArg} ../../../../scripts/${ftrScript} ${grepArg} --config ../../../../test/apm_api_integration/${license}/config.ts`; console.log(`Running ${cmd}`); diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/get_coldstart_rate.ts b/x-pack/plugins/apm/server/lib/transaction_groups/get_coldstart_rate.ts index e7c9e111be7a5..2a47c4e441dec 100644 --- a/x-pack/plugins/apm/server/lib/transaction_groups/get_coldstart_rate.ts +++ b/x-pack/plugins/apm/server/lib/transaction_groups/get_coldstart_rate.ts @@ -27,6 +27,7 @@ import { getTransactionColdstartRateTimeSeries, } from '../helpers/transaction_coldstart_rate'; import { termQuery } from '../../../../observability/server'; +import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; export async function getColdstartRate({ environment, @@ -38,6 +39,7 @@ export async function getColdstartRate({ searchAggregatedTransactions, start, end, + offset, }: { environment: string; kuery: string; @@ -48,19 +50,26 @@ export async function getColdstartRate({ searchAggregatedTransactions: boolean; start: number; end: number; + offset?: string; }): Promise<{ transactionColdstartRate: Coordinate[]; average: number | null; }> { const { apmEventClient } = setup; + const { startWithOffset, endWithOffset } = getOffsetInMs({ + start, + end, + offset, + }); + const filter = [ ...termQuery(SERVICE_NAME, serviceName), { exists: { field: FAAS_COLDSTART } }, ...(transactionName ? termQuery(TRANSACTION_NAME, transactionName) : []), ...termQuery(TRANSACTION_TYPE, transactionType), ...getDocumentTypeFilterForTransactions(searchAggregatedTransactions), - ...rangeQuery(start, end), + ...rangeQuery(startWithOffset, endWithOffset), ...environmentQuery(environment), ...kqlQuery(kuery), ]; @@ -80,12 +89,12 @@ export async function getColdstartRate({ date_histogram: { field: '@timestamp', fixed_interval: getBucketSizeForAggregatedTransactions({ - start, - end, + start: startWithOffset, + end: endWithOffset, searchAggregatedTransactions, }).intervalString, min_doc_count: 0, - extended_bounds: { min: start, max: end }, + extended_bounds: { min: startWithOffset, max: endWithOffset }, }, aggs: { coldstartStates, @@ -123,10 +132,9 @@ export async function getColdstartRatePeriods({ transactionName = '', setup, searchAggregatedTransactions, - comparisonStart, - comparisonEnd, start, end, + offset, }: { environment: string; kuery: string; @@ -135,10 +143,9 @@ export async function getColdstartRatePeriods({ transactionName?: string; setup: Setup; searchAggregatedTransactions: boolean; - comparisonStart?: number; - comparisonEnd?: number; start: number; end: number; + offset?: string; }) { const commonProps = { environment, @@ -152,14 +159,14 @@ export async function getColdstartRatePeriods({ const currentPeriodPromise = getColdstartRate({ ...commonProps, start, end }); - const previousPeriodPromise = - comparisonStart && comparisonEnd - ? getColdstartRate({ - ...commonProps, - start: comparisonStart, - end: comparisonEnd, - }) - : { transactionColdstartRate: [], average: null }; + const previousPeriodPromise = offset + ? getColdstartRate({ + ...commonProps, + start, + end, + offset, + }) + : { transactionColdstartRate: [], average: null }; const [currentPeriod, previousPeriod] = await Promise.all([ currentPeriodPromise, diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts b/x-pack/plugins/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts index e3b5c995d0563..06c0419f5999e 100644 --- a/x-pack/plugins/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts +++ b/x-pack/plugins/apm/server/lib/transaction_groups/get_failed_transaction_rate.ts @@ -30,6 +30,7 @@ import { getOutcomeAggregation, getFailedTransactionRateTimeSeries, } from '../helpers/transaction_error_rate'; +import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; export async function getFailedTransactionRate({ environment, @@ -42,6 +43,7 @@ export async function getFailedTransactionRate({ start, end, numBuckets, + offset, }: { environment: string; kuery: string; @@ -53,12 +55,19 @@ export async function getFailedTransactionRate({ start: number; end: number; numBuckets?: number; + offset?: string; }): Promise<{ timeseries: Coordinate[]; average: number | null; }> { const { apmEventClient } = setup; + const { startWithOffset, endWithOffset } = getOffsetInMs({ + start, + end, + offset, + }); + const filter = [ { term: { [SERVICE_NAME]: serviceName } }, { @@ -69,7 +78,7 @@ export async function getFailedTransactionRate({ { terms: { [TRANSACTION_TYPE]: transactionTypes } }, ...termQuery(TRANSACTION_NAME, transactionName), ...getDocumentTypeFilterForTransactions(searchAggregatedTransactions), - ...rangeQuery(start, end), + ...rangeQuery(startWithOffset, endWithOffset), ...environmentQuery(environment), ...kqlQuery(kuery), ]; @@ -89,13 +98,13 @@ export async function getFailedTransactionRate({ date_histogram: { field: '@timestamp', fixed_interval: getBucketSizeForAggregatedTransactions({ - start, - end, + start: startWithOffset, + end: endWithOffset, searchAggregatedTransactions, numBuckets, }).intervalString, min_doc_count: 0, - extended_bounds: { min: start, max: end }, + extended_bounds: { min: startWithOffset, max: endWithOffset }, }, aggs: { outcomes, diff --git a/x-pack/plugins/apm/server/routes/backends/route.ts b/x-pack/plugins/apm/server/routes/backends/route.ts index 730ad672a26b7..d8f619af58199 100644 --- a/x-pack/plugins/apm/server/routes/backends/route.ts +++ b/x-pack/plugins/apm/server/routes/backends/route.ts @@ -8,12 +8,7 @@ import * as t from 'io-ts'; import { toNumberRt } from '@kbn/io-ts-utils'; import { setupRequest } from '../../lib/helpers/setup_request'; -import { - environmentRt, - kueryRt, - offsetRt, - rangeRt, -} from '../default_api_types'; +import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getMetadataForBackend } from './get_metadata_for_backend'; import { getLatencyChartsForBackend } from './get_latency_charts_for_backend'; @@ -22,6 +17,7 @@ import { getUpstreamServicesForBackend } from './get_upstream_services_for_backe import { getThroughputChartsForBackend } from './get_throughput_charts_for_backend'; import { getErrorRateChartsForBackend } from './get_error_rate_charts_for_backend'; import { ConnectionStatsItemWithImpact } from './../../../common/connections'; +import { offsetRt } from '../../../common/offset_rt'; const topBackendsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/backends/top_backends', diff --git a/x-pack/plugins/apm/server/routes/default_api_types.ts b/x-pack/plugins/apm/server/routes/default_api_types.ts index 5622b12e1b099..e2b969f00edc5 100644 --- a/x-pack/plugins/apm/server/routes/default_api_types.ts +++ b/x-pack/plugins/apm/server/routes/default_api_types.ts @@ -15,11 +15,4 @@ export const rangeRt = t.type({ end: isoToEpochRt, }); -export const offsetRt = t.partial({ offset: t.string }); - -export const comparisonRangeRt = t.partial({ - comparisonStart: isoToEpochRt, - comparisonEnd: isoToEpochRt, -}); - export const kueryRt = t.type({ kuery: t.string }); diff --git a/x-pack/plugins/apm/server/routes/errors/distribution/get_distribution.ts b/x-pack/plugins/apm/server/routes/errors/distribution/get_distribution.ts index 9e7221b7cd939..b08113be712c2 100644 --- a/x-pack/plugins/apm/server/routes/errors/distribution/get_distribution.ts +++ b/x-pack/plugins/apm/server/routes/errors/distribution/get_distribution.ts @@ -9,6 +9,7 @@ import { offsetPreviousPeriodCoordinates } from '../../../../common/utils/offset import { Setup } from '../../../lib/helpers/setup_request'; import { BUCKET_TARGET_COUNT } from '../../transactions/constants'; import { getBuckets } from './get_buckets'; +import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; function getBucketSize({ start, end }: { start: number; end: number }) { return Math.floor((end - start) / BUCKET_TARGET_COUNT); @@ -22,8 +23,7 @@ export async function getErrorDistribution({ setup, start, end, - comparisonStart, - comparisonEnd, + offset, }: { environment: string; kuery: string; @@ -32,10 +32,19 @@ export async function getErrorDistribution({ setup: Setup; start: number; end: number; - comparisonStart?: number; - comparisonEnd?: number; + offset?: string; }) { - const bucketSize = getBucketSize({ start, end }); + const { startWithOffset, endWithOffset } = getOffsetInMs({ + start, + end, + offset, + }); + + const bucketSize = getBucketSize({ + start: startWithOffset, + end: endWithOffset, + }); + const commonProps = { environment, kuery, @@ -46,17 +55,17 @@ export async function getErrorDistribution({ }; const currentPeriodPromise = getBuckets({ ...commonProps, - start, - end, + start: startWithOffset, + end: endWithOffset, }); - const previousPeriodPromise = - comparisonStart && comparisonEnd - ? getBuckets({ - ...commonProps, - start: comparisonStart, - end: comparisonEnd, - }) - : { buckets: [], bucketSize: null }; + + const previousPeriodPromise = offset + ? getBuckets({ + ...commonProps, + start: startWithOffset, + end: endWithOffset, + }) + : { buckets: [], bucketSize: null }; const [currentPeriod, previousPeriod] = await Promise.all([ currentPeriodPromise, diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts index 9eda5769e7fb8..3ffa084f63463 100644 --- a/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts @@ -16,6 +16,7 @@ import { rangeQuery, kqlQuery } from '../../../../../observability/server'; import { environmentQuery } from '../../../../common/utils/environment_query'; import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; import { Setup } from '../../../lib/helpers/setup_request'; +import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; export async function getErrorGroupDetailedStatistics({ kuery, @@ -26,6 +27,7 @@ export async function getErrorGroupDetailedStatistics({ environment, start, end, + offset, }: { kuery: string; serviceName: string; @@ -35,10 +37,21 @@ export async function getErrorGroupDetailedStatistics({ environment: string; start: number; end: number; + offset?: string; }): Promise> { const { apmEventClient } = setup; - const { intervalString } = getBucketSize({ start, end, numBuckets }); + const { startWithOffset, endWithOffset } = getOffsetInMs({ + start, + end, + offset, + }); + + const { intervalString } = getBucketSize({ + start: startWithOffset, + end: endWithOffset, + numBuckets, + }); const timeseriesResponse = await apmEventClient.search( 'get_service_error_group_detailed_statistics', @@ -53,7 +66,7 @@ export async function getErrorGroupDetailedStatistics({ filter: [ { terms: { [ERROR_GROUP_ID]: groupIds } }, { term: { [SERVICE_NAME]: serviceName } }, - ...rangeQuery(start, end), + ...rangeQuery(startWithOffset, endWithOffset), ...environmentQuery(environment), ...kqlQuery(kuery), ], @@ -72,8 +85,8 @@ export async function getErrorGroupDetailedStatistics({ fixed_interval: intervalString, min_doc_count: 0, extended_bounds: { - min: start, - max: end, + min: startWithOffset, + max: endWithOffset, }, }, }, @@ -109,10 +122,9 @@ export async function getErrorGroupPeriods({ numBuckets, groupIds, environment, - comparisonStart, - comparisonEnd, start, end, + offset, }: { kuery: string; serviceName: string; @@ -120,10 +132,9 @@ export async function getErrorGroupPeriods({ numBuckets: number; groupIds: string[]; environment: string; - comparisonStart?: number; - comparisonEnd?: number; start: number; end: number; + offset?: string; }) { const commonProps = { environment, @@ -140,14 +151,14 @@ export async function getErrorGroupPeriods({ end, }); - const previousPeriodPromise = - comparisonStart && comparisonEnd - ? getErrorGroupDetailedStatistics({ - ...commonProps, - start: comparisonStart, - end: comparisonEnd, - }) - : []; + const previousPeriodPromise = offset + ? getErrorGroupDetailedStatistics({ + ...commonProps, + start, + end, + offset, + }) + : []; const [currentPeriod, previousPeriod] = await Promise.all([ currentPeriodPromise, diff --git a/x-pack/plugins/apm/server/routes/errors/route.ts b/x-pack/plugins/apm/server/routes/errors/route.ts index 52a72a70b7d67..73ad46adb3331 100644 --- a/x-pack/plugins/apm/server/routes/errors/route.ts +++ b/x-pack/plugins/apm/server/routes/errors/route.ts @@ -10,15 +10,11 @@ import * as t from 'io-ts'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getErrorDistribution } from './distribution/get_distribution'; import { setupRequest } from '../../lib/helpers/setup_request'; -import { - environmentRt, - kueryRt, - rangeRt, - comparisonRangeRt, -} from '../default_api_types'; +import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { getErrorGroupMainStatistics } from './get_error_groups/get_error_group_main_statistics'; import { getErrorGroupPeriods } from './get_error_groups/get_error_group_detailed_statistics'; import { getErrorGroupSample } from './get_error_groups/get_error_group_sample'; +import { offsetRt } from '../../../common/offset_rt'; const errorsMainStatisticsRoute = createApmServerRoute({ endpoint: @@ -83,7 +79,7 @@ const errorsDetailedStatisticsRoute = createApmServerRoute({ environmentRt, kueryRt, rangeRt, - comparisonRangeRt, + offsetRt, t.type({ numBuckets: toNumberRt, groupIds: jsonRt.pipe(t.array(t.string)), @@ -111,16 +107,7 @@ const errorsDetailedStatisticsRoute = createApmServerRoute({ const { path: { serviceName }, - query: { - environment, - kuery, - numBuckets, - groupIds, - comparisonStart, - comparisonEnd, - start, - end, - }, + query: { environment, kuery, numBuckets, groupIds, start, end, offset }, } = params; return getErrorGroupPeriods({ @@ -130,10 +117,9 @@ const errorsDetailedStatisticsRoute = createApmServerRoute({ setup, numBuckets, groupIds, - comparisonStart, - comparisonEnd, start, end, + offset, }); }, }); @@ -187,7 +173,7 @@ const errorDistributionRoute = createApmServerRoute({ environmentRt, kueryRt, rangeRt, - comparisonRangeRt, + offsetRt, ]), }), options: { tags: ['access:apm'] }, @@ -204,15 +190,7 @@ const errorDistributionRoute = createApmServerRoute({ const setup = await setupRequest(resources); const { params } = resources; const { serviceName } = params.path; - const { - environment, - kuery, - groupId, - start, - end, - comparisonStart, - comparisonEnd, - } = params.query; + const { environment, kuery, groupId, start, end, offset } = params.query; return getErrorDistribution({ environment, kuery, @@ -221,8 +199,7 @@ const errorDistributionRoute = createApmServerRoute({ setup, start, end, - comparisonStart, - comparisonEnd, + offset, }); }, }); diff --git a/x-pack/plugins/apm/server/routes/fleet/create_cloud_apm_package_policy.ts b/x-pack/plugins/apm/server/routes/fleet/create_cloud_apm_package_policy.ts index 34a6de753d910..797bce77facdb 100644 --- a/x-pack/plugins/apm/server/routes/fleet/create_cloud_apm_package_policy.ts +++ b/x-pack/plugins/apm/server/routes/fleet/create_cloud_apm_package_policy.ts @@ -9,6 +9,7 @@ import { ElasticsearchClient, SavedObjectsClientContract, Logger, + KibanaRequest, } from 'kibana/server'; import { PackagePolicy } from '../../../../fleet/common'; import { @@ -30,7 +31,7 @@ export async function createCloudApmPackgePolicy({ esClient, logger, setup, - kibanaVersion, + request, }: { cloudPluginSetup: APMPluginSetupDependencies['cloud']; fleetPluginStart: NonNullable; @@ -38,7 +39,7 @@ export async function createCloudApmPackgePolicy({ esClient: ElasticsearchClient; logger: Logger; setup: Setup; - kibanaVersion: string; + request: KibanaRequest; }): Promise { const { attributes } = await savedObjectsClient.get( APM_SERVER_SCHEMA_SAVED_OBJECT_TYPE, @@ -52,7 +53,7 @@ export async function createCloudApmPackgePolicy({ apmServerSchema, cloudPluginSetup, fleetPluginStart, - kibanaVersion, + request, }); const mergedAPMPackagePolicy = await mergePackagePolicyWithApm({ setup, diff --git a/x-pack/plugins/apm/server/routes/fleet/get_apm_package_policy_definition.ts b/x-pack/plugins/apm/server/routes/fleet/get_apm_package_policy_definition.ts index 352ff8eb9cca5..85ac03697019c 100644 --- a/x-pack/plugins/apm/server/routes/fleet/get_apm_package_policy_definition.ts +++ b/x-pack/plugins/apm/server/routes/fleet/get_apm_package_policy_definition.ts @@ -5,30 +5,38 @@ * 2.0. */ +import { KibanaRequest } from 'kibana/server'; +import { RegistryVarsEntry } from '../../../../fleet/common'; import { - isPrereleaseVersion, POLICY_ELASTIC_AGENT_ON_CLOUD, - SUPPORTED_APM_PACKAGE_VERSION, + INPUT_VAR_NAME_TO_SCHEMA_PATH, + ELASTIC_CLOUD_APM_AGENT_POLICY_ID, } from '../../../common/fleet'; import { APMPluginSetupDependencies, APMPluginStartDependencies, } from '../../types'; -import { APM_PACKAGE_NAME } from './get_cloud_apm_package_policy'; +import { getLatestApmPackage } from './get_latest_apm_package'; +import { translateLegacySchemaPaths } from './translate_legacy_schema_paths'; -interface GetApmPackagePolicyDefinitionOptions { +export async function getApmPackagePolicyDefinition({ + apmServerSchema, + cloudPluginSetup, + fleetPluginStart, + request, +}: { apmServerSchema: Record; cloudPluginSetup: APMPluginSetupDependencies['cloud']; - fleetPluginStart: APMPluginStartDependencies['fleet']; - kibanaVersion: string; -} -export async function getApmPackagePolicyDefinition( - options: GetApmPackagePolicyDefinitionOptions -) { - const { apmServerSchema, cloudPluginSetup, fleetPluginStart, kibanaVersion } = - options; + fleetPluginStart: NonNullable; + request: KibanaRequest; +}) { + const latestApmPackage = await getLatestApmPackage({ + fleetPluginStart, + request, + }); return { + id: ELASTIC_CLOUD_APM_AGENT_POLICY_ID, name: 'Elastic APM', namespace: 'default', enabled: true, @@ -40,255 +48,45 @@ export async function getApmPackagePolicyDefinition( enabled: true, streams: [], vars: getApmPackageInputVars({ + policyTemplateInputVars: latestApmPackage.policyTemplateInputVars, + apmServerSchema: translateLegacySchemaPaths(apmServerSchema), cloudPluginSetup, - fleetPluginStart, - apmServerSchema: preprocessLegacyFields({ apmServerSchema }), - kibanaVersion, }), }, ], package: { - name: APM_PACKAGE_NAME, - version: await getApmPackageVersion(fleetPluginStart, kibanaVersion), - title: 'Elastic APM', + name: latestApmPackage.package.name, + version: latestApmPackage.package.version, + title: latestApmPackage.package.title, }, }; } -async function getApmPackageVersion( - fleetPluginStart: APMPluginStartDependencies['fleet'], - kibanaVersion: string -) { - if (fleetPluginStart && isPrereleaseVersion(kibanaVersion)) { - try { - const latestApmPackage = - await fleetPluginStart.packageService.asInternalUser.fetchFindLatestPackage( - 'apm' - ); - return latestApmPackage.version; - } catch (error) { - return SUPPORTED_APM_PACKAGE_VERSION; - } - } - return SUPPORTED_APM_PACKAGE_VERSION; -} - -export function preprocessLegacyFields({ +function getApmPackageInputVars({ + policyTemplateInputVars, apmServerSchema, + cloudPluginSetup, }: { + policyTemplateInputVars: RegistryVarsEntry[]; apmServerSchema: Record; -}) { - const copyOfApmServerSchema = { ...apmServerSchema }; - [ - { - key: 'apm-server.auth.anonymous.rate_limit.event_limit', - legacyKey: 'apm-server.rum.event_rate.limit', - }, - { - key: 'apm-server.auth.anonymous.rate_limit.ip_limit', - legacyKey: 'apm-server.rum.event_rate.lru_size', - }, - { - key: 'apm-server.auth.anonymous.allow_service', - legacyKey: 'apm-server.rum.allow_service_names', - }, - { - key: 'apm-server.auth.secret_token', - legacyKey: 'apm-server.secret_token', - }, - { - key: 'apm-server.auth.api_key.enabled', - legacyKey: 'apm-server.api_key.enabled', - }, - ].forEach(({ key, legacyKey }) => { - if (!copyOfApmServerSchema[key]) { - copyOfApmServerSchema[key] = copyOfApmServerSchema[legacyKey]; - delete copyOfApmServerSchema[legacyKey]; - } - }); - return copyOfApmServerSchema; -} - -function getApmPackageInputVars(options: GetApmPackagePolicyDefinitionOptions) { - const { apmServerSchema } = options; - const apmServerConfigs = Object.entries(apmConfigMapping).map( - ([key, { name, type, getValue }]) => ({ key, name, type, getValue }) - ); + cloudPluginSetup: APMPluginSetupDependencies['cloud']; +}): Record { + const overrideValues: Record = { + url: cloudPluginSetup?.apm?.url, // overrides 'apm-server.url' to be the cloud APM host + }; - const inputVars: Record = - apmServerConfigs.reduce((acc, { key, name, type, getValue }) => { - const value = (getValue ? getValue(options) : apmServerSchema[key]) ?? ''; // defaults to an empty string to be edited in Fleet UI - return { - ...acc, - [name]: { type, value }, - }; - }, {}); - return inputVars; + return policyTemplateInputVars.reduce((acc, registryVarsEntry) => { + const { name, type, default: defaultValue } = registryVarsEntry; + return { + ...acc, + [name]: { + type, + value: + overrideValues[name] ?? + apmServerSchema[INPUT_VAR_NAME_TO_SCHEMA_PATH[name]] ?? + defaultValue ?? + '', + }, + }; + }, {}); } - -export const apmConfigMapping: Record< - string, - { - name: string; - type: string; - getValue?: (options: GetApmPackagePolicyDefinitionOptions) => any; - } -> = { - 'apm-server.host': { - name: 'host', - type: 'text', - }, - 'apm-server.url': { - name: 'url', - type: 'text', - getValue: ({ cloudPluginSetup }) => cloudPluginSetup?.apm?.url, - }, - 'apm-server.rum.enabled': { - name: 'enable_rum', - type: 'bool', - }, - 'apm-server.default_service_environment': { - name: 'default_service_environment', - type: 'text', - }, - 'apm-server.rum.allow_origins': { - name: 'rum_allow_origins', - type: 'text', - }, - 'apm-server.rum.allow_headers': { - name: 'rum_allow_headers', - type: 'text', - }, - 'apm-server.rum.event_rate.limit': { - name: 'rum_event_rate_limit', - type: 'integer', - }, - 'apm-server.rum.allow_service_names': { - name: 'rum_allow_service_names', - type: 'text', - }, - 'apm-server.rum.event_rate.lru_size': { - name: 'rum_event_rate_lru_size', - type: 'integer', - }, - 'apm-server.rum.response_headers': { - name: 'rum_response_headers', - type: 'yaml', - }, - 'apm-server.rum.library_pattern': { - name: 'rum_library_pattern', - type: 'text', - }, - 'apm-server.rum.exclude_from_grouping': { - name: 'rum_exclude_from_grouping', - type: 'text', - }, - 'apm-server.max_event_size': { - name: 'max_event_bytes', - type: 'integer', - }, - 'apm-server.capture_personal_data': { - name: 'capture_personal_data', - type: 'bool', - }, - 'apm-server.max_header_size': { - name: 'max_header_bytes', - type: 'integer', - }, - 'apm-server.idle_timeout': { - name: 'idle_timeout', - type: 'text', - }, - 'apm-server.read_timeout': { - name: 'read_timeout', - type: 'text', - }, - 'apm-server.shutdown_timeout': { - name: 'shutdown_timeout', - type: 'text', - }, - 'apm-server.write_timeout': { - name: 'write_timeout', - type: 'text', - }, - 'apm-server.max_connections': { - name: 'max_connections', - type: 'integer', - }, - 'apm-server.response_headers': { - name: 'response_headers', - type: 'yaml', - }, - 'apm-server.expvar.enabled': { - name: 'expvar_enabled', - type: 'bool', - }, - 'apm-server.ssl.enabled': { - name: 'tls_enabled', - type: 'bool', - }, - 'apm-server.ssl.certificate': { - name: 'tls_certificate', - type: 'text', - }, - 'apm-server.ssl.key': { - name: 'tls_key', - type: 'text', - }, - 'apm-server.ssl.supported_protocols': { - name: 'tls_supported_protocols', - type: 'text', - }, - 'apm-server.ssl.cipher_suites': { - name: 'tls_cipher_suites', - type: 'text', - }, - 'apm-server.ssl.curve_types': { - name: 'tls_curve_types', - type: 'text', - }, - 'apm-server.auth.secret_token': { - name: 'secret_token', - type: 'text', - }, - 'apm-server.auth.api_key.enabled': { - name: 'api_key_enabled', - type: 'bool', - }, - 'apm-server.auth.api_key.limit': { - name: 'api_key_limit', - type: 'bool', - }, - 'apm-server.auth.anonymous.enabled': { - name: 'anonymous_enabled', - type: 'bool', - }, - 'apm-server.auth.anonymous.allow_agent': { - name: 'anonymous_allow_agent', - type: 'text', - }, - 'apm-server.auth.anonymous.allow_service': { - name: 'anonymous_allow_service', - type: 'text', - }, - 'apm-server.auth.anonymous.rate_limit.ip_limit': { - name: 'anonymous_rate_limit_ip_limit', - type: 'integer', - }, - 'apm-server.auth.anonymous.rate_limit.event_limit': { - name: 'anonymous_rate_limit_event_limit', - type: 'integer', - }, - 'apm-server.sampling.tail.enabled': { - name: 'tail_sampling_enabled', - type: 'bool', - }, - 'apm-server.sampling.tail.interval': { - name: 'tail_sampling_interval', - type: 'text', - }, - 'apm-server.sampling.tail.policies': { - name: 'tail_sampling_policies', - type: 'yaml', - }, -}; diff --git a/x-pack/plugins/apm/server/routes/fleet/get_latest_apm_package.ts b/x-pack/plugins/apm/server/routes/fleet/get_latest_apm_package.ts new file mode 100644 index 0000000000000..ba5b9f4b919e9 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/fleet/get_latest_apm_package.ts @@ -0,0 +1,28 @@ +/* + * 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 { KibanaRequest } from 'kibana/server'; +import { APMPluginStartDependencies } from '../../types'; +import { APM_PACKAGE_NAME } from './get_cloud_apm_package_policy'; + +export async function getLatestApmPackage({ + fleetPluginStart, + request, +}: { + fleetPluginStart: NonNullable; + request: KibanaRequest; +}) { + const packageClient = fleetPluginStart.packageService.asScoped(request); + const { name, version } = await packageClient.fetchFindLatestPackage( + APM_PACKAGE_NAME + ); + const registryPackage = await packageClient.getRegistryPackage(name, version); + const { title, policy_templates: policyTemplates } = + registryPackage.packageInfo; + const policyTemplateInputVars = policyTemplates?.[0].inputs?.[0].vars ?? []; + return { package: { name, version, title }, policyTemplateInputVars }; +} diff --git a/x-pack/plugins/apm/server/routes/fleet/get_unsupported_apm_server_schema.ts b/x-pack/plugins/apm/server/routes/fleet/get_unsupported_apm_server_schema.ts index 2ced15245b593..fa2b4c585cb9d 100644 --- a/x-pack/plugins/apm/server/routes/fleet/get_unsupported_apm_server_schema.ts +++ b/x-pack/plugins/apm/server/routes/fleet/get_unsupported_apm_server_schema.ts @@ -6,14 +6,12 @@ */ import { SavedObjectsClientContract } from 'kibana/server'; +import { INPUT_VAR_NAME_TO_SCHEMA_PATH } from '../../../common/fleet'; import { APM_SERVER_SCHEMA_SAVED_OBJECT_TYPE, APM_SERVER_SCHEMA_SAVED_OBJECT_ID, } from '../../../common/apm_saved_object_constants'; -import { - apmConfigMapping, - preprocessLegacyFields, -} from './get_apm_package_policy_definition'; +import { translateLegacySchemaPaths } from './translate_legacy_schema_paths'; export async function getUnsupportedApmServerSchema({ savedObjectsClient, @@ -27,10 +25,9 @@ export async function getUnsupportedApmServerSchema({ const apmServerSchema: Record = JSON.parse( (attributes as { schemaJson: string }).schemaJson ); - const preprocessedApmServerSchema = preprocessLegacyFields({ - apmServerSchema, - }); - return Object.entries(preprocessedApmServerSchema) - .filter(([name]) => !(name in apmConfigMapping)) + const translatedApmServerSchema = translateLegacySchemaPaths(apmServerSchema); + const supportedSchemaPaths = Object.values(INPUT_VAR_NAME_TO_SCHEMA_PATH); + return Object.entries(translatedApmServerSchema) + .filter(([name]) => !supportedSchemaPaths.includes(name)) .map(([key, value]) => ({ key, value })); } diff --git a/x-pack/plugins/apm/server/routes/fleet/route.ts b/x-pack/plugins/apm/server/routes/fleet/route.ts index 97949dfc7d0c3..2b6412647641c 100644 --- a/x-pack/plugins/apm/server/routes/fleet/route.ts +++ b/x-pack/plugins/apm/server/routes/fleet/route.ts @@ -25,6 +25,7 @@ import { isSuperuser } from './is_superuser'; import { getInternalSavedObjectsClient } from '../../lib/helpers/get_internal_saved_objects_client'; import { setupRequest } from '../../lib/helpers/setup_request'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; +import { getLatestApmPackage } from './get_latest_apm_package'; const hasFleetDataRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/fleet/has_apm_policies', @@ -177,6 +178,7 @@ const getMigrationCheckRoute = createApmServerRoute({ | import('./../../../../fleet/common/index').PackagePolicy | undefined; has_apm_integrations: boolean; + latest_apm_package_version: string; }> => { const { core, plugins, context, config, request } = resources; const cloudApmMigrationEnabled = config.agent.migrations.enabled; @@ -200,6 +202,10 @@ const getMigrationCheckRoute = createApmServerRoute({ core, fleetPluginStart, }); + const latestApmPackage = await getLatestApmPackage({ + fleetPluginStart, + request, + }); return { has_cloud_agent_policy: !!cloudAgentPolicy, has_cloud_apm_package_policy: !!apmPackagePolicy, @@ -207,6 +213,7 @@ const getMigrationCheckRoute = createApmServerRoute({ has_required_role: hasRequiredRole, cloud_apm_package_policy: apmPackagePolicy, has_apm_integrations: packagePolicies.total > 0, + latest_apm_package_version: latestApmPackage.package.version, }; }, }); @@ -219,8 +226,7 @@ const createCloudApmPackagePolicyRoute = createApmServerRoute({ ): Promise<{ cloudApmPackagePolicy: import('./../../../../fleet/common/index').PackagePolicy; }> => { - const { plugins, context, config, request, logger, kibanaVersion } = - resources; + const { plugins, context, config, request, logger } = resources; const cloudApmMigrationEnabled = config.agent.migrations.enabled; if (!plugins.fleet || !plugins.security) { throw Boom.internal(FLEET_SECURITY_REQUIRED_MESSAGE); @@ -247,7 +253,7 @@ const createCloudApmPackagePolicyRoute = createApmServerRoute({ esClient, logger, setup, - kibanaVersion, + request, }); return { cloudApmPackagePolicy }; diff --git a/x-pack/plugins/apm/server/routes/fleet/get_apm_package_policy_definition.test.ts b/x-pack/plugins/apm/server/routes/fleet/translate_legacy_schema_paths.test.ts similarity index 91% rename from x-pack/plugins/apm/server/routes/fleet/get_apm_package_policy_definition.test.ts rename to x-pack/plugins/apm/server/routes/fleet/translate_legacy_schema_paths.test.ts index 805099d87e1c6..09cab871d3a5b 100644 --- a/x-pack/plugins/apm/server/routes/fleet/get_apm_package_policy_definition.test.ts +++ b/x-pack/plugins/apm/server/routes/fleet/translate_legacy_schema_paths.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { preprocessLegacyFields } from './get_apm_package_policy_definition'; +import { translateLegacySchemaPaths } from './translate_legacy_schema_paths'; const apmServerSchema = { 'apm-server.host': '0.0.0.0:8200', @@ -24,7 +24,7 @@ const apmServerSchema = { describe('get_apm_package_policy_definition', () => { describe('preprocessLegacyFields', () => { it('should replace legacy fields with supported fields', () => { - const result = preprocessLegacyFields({ apmServerSchema }); + const result = translateLegacySchemaPaths(apmServerSchema); expect(result).toMatchInlineSnapshot(` Object { "apm-server.auth.anonymous.allow_service": "opbeans-test", diff --git a/x-pack/plugins/apm/server/routes/fleet/translate_legacy_schema_paths.ts b/x-pack/plugins/apm/server/routes/fleet/translate_legacy_schema_paths.ts new file mode 100644 index 0000000000000..ca8de7d6e7a62 --- /dev/null +++ b/x-pack/plugins/apm/server/routes/fleet/translate_legacy_schema_paths.ts @@ -0,0 +1,21 @@ +/* + * 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 { LEGACY_TO_CURRENT_SCHEMA_PATHS } from '../../../common/fleet'; + +export function translateLegacySchemaPaths( + apmServerSchema: Record +) { + return Object.keys(apmServerSchema).reduce((acc, apmServerSchemaKey) => { + const currentSchemaPath = + LEGACY_TO_CURRENT_SCHEMA_PATHS[apmServerSchemaKey] || apmServerSchemaKey; + return { + ...acc, + [currentSchemaPath]: apmServerSchema[apmServerSchemaKey], + }; + }, {}); +} diff --git a/x-pack/plugins/apm/server/routes/service_map/route.ts b/x-pack/plugins/apm/server/routes/service_map/route.ts index b00a0da8e55bf..b357958d219a9 100644 --- a/x-pack/plugins/apm/server/routes/service_map/route.ts +++ b/x-pack/plugins/apm/server/routes/service_map/route.ts @@ -16,8 +16,9 @@ import { getServiceMap } from './get_service_map'; import { getServiceMapBackendNodeInfo } from './get_service_map_backend_node_info'; import { getServiceMapServiceNodeInfo } from './get_service_map_service_node_info'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; -import { environmentRt, offsetRt, rangeRt } from '../default_api_types'; +import { environmentRt, rangeRt } from '../default_api_types'; import { getServiceGroup } from '../service_groups/get_service_group'; +import { offsetRt } from '../../../common/offset_rt'; const serviceMapRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/service-map', diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/detailed_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/detailed_statistics.ts index 10393e3434779..01e82c6d57c77 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/detailed_statistics.ts @@ -27,6 +27,7 @@ interface ServiceInstanceDetailedStatisticsParams { start: number; end: number; serviceNodeIds: string[]; + offset?: string; } async function getServiceInstancesDetailedStatistics( @@ -72,10 +73,9 @@ export async function getServiceInstancesDetailedStatisticsPeriods({ searchAggregatedTransactions, numBuckets, serviceNodeIds, - comparisonStart, - comparisonEnd, start, end, + offset, }: { environment: string; kuery: string; @@ -86,10 +86,9 @@ export async function getServiceInstancesDetailedStatisticsPeriods({ searchAggregatedTransactions: boolean; numBuckets: number; serviceNodeIds: string[]; - comparisonStart?: number; - comparisonEnd?: number; start: number; end: number; + offset?: string; }) { return withApmSpan( 'get_service_instances_detailed_statistics_periods', @@ -112,14 +111,14 @@ export async function getServiceInstancesDetailedStatisticsPeriods({ end, }); - const previousPeriodPromise = - comparisonStart && comparisonEnd - ? getServiceInstancesDetailedStatistics({ - ...commonParams, - start: comparisonStart, - end: comparisonEnd, - }) - : []; + const previousPeriodPromise = offset + ? getServiceInstancesDetailedStatistics({ + ...commonParams, + start, + end, + offset, + }) + : []; const [currentPeriod, previousPeriod] = await Promise.all([ currentPeriodPromise, previousPeriodPromise, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts index 11fcbd8ce6561..c1cfbed24c91d 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_system_metric_statistics.ts @@ -25,6 +25,7 @@ import { percentCgroupMemoryUsedScript, percentSystemMemoryUsedScript, } from '../../metrics/by_agent/shared/memory'; +import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; interface ServiceInstanceSystemMetricPrimaryStatistics { serviceNodeName: string; @@ -55,6 +56,7 @@ export async function getServiceInstancesSystemMetricStatistics< serviceNodeIds, numBuckets, isComparisonSearch, + offset, }: { setup: Setup; serviceName: string; @@ -66,10 +68,21 @@ export async function getServiceInstancesSystemMetricStatistics< kuery: string; size?: number; isComparisonSearch: T; + offset?: string; }): Promise>> { const { apmEventClient } = setup; - const { intervalString } = getBucketSize({ start, end, numBuckets }); + const { startWithOffset, endWithOffset } = getOffsetInMs({ + start, + end, + offset, + }); + + const { intervalString } = getBucketSize({ + start: startWithOffset, + end: endWithOffset, + numBuckets, + }); const systemMemoryFilter = { bool: { @@ -99,8 +112,8 @@ export async function getServiceInstancesSystemMetricStatistics< fixed_interval: intervalString, min_doc_count: 0, extended_bounds: { - min: start, - max: end, + min: startWithOffset, + max: endWithOffset, }, }, aggs: { avg: { avg: agg } }, @@ -137,7 +150,7 @@ export async function getServiceInstancesSystemMetricStatistics< bool: { filter: [ { term: { [SERVICE_NAME]: serviceName } }, - ...rangeQuery(start, end), + ...rangeQuery(startWithOffset, endWithOffset), ...environmentQuery(environment), ...kqlQuery(kuery), ...(isComparisonSearch && serviceNodeIds diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_transaction_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_transaction_statistics.ts index ec081916f455d..7aa80322269b4 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_transaction_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/get_service_instances_transaction_statistics.ts @@ -28,6 +28,7 @@ import { getLatencyValue, } from '../../../lib/helpers/latency_aggregation_type'; import { Setup } from '../../../lib/helpers/setup_request'; +import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; interface ServiceInstanceTransactionPrimaryStatistics { serviceNodeName: string; @@ -63,6 +64,7 @@ export async function getServiceInstancesTransactionStatistics< serviceNodeIds, numBuckets, isComparisonSearch, + offset, }: { latencyAggregationType: LatencyAggregationType; setup: Setup; @@ -77,13 +79,20 @@ export async function getServiceInstancesTransactionStatistics< kuery: string; size?: number; numBuckets?: number; + offset?: string; }): Promise>> { const { apmEventClient } = setup; + const { startWithOffset, endWithOffset } = getOffsetInMs({ + start, + end, + offset, + }); + const { intervalString, bucketSize } = getBucketSizeForAggregatedTransactions( { - start, - end, + start: startWithOffset, + end: endWithOffset, numBuckets, searchAggregatedTransactions, } @@ -108,7 +117,7 @@ export async function getServiceInstancesTransactionStatistics< { term: { [SERVICE_NAME]: serviceName } }, { term: { [TRANSACTION_TYPE]: transactionType } }, ...getDocumentTypeFilterForTransactions(searchAggregatedTransactions), - ...rangeQuery(start, end), + ...rangeQuery(startWithOffset, endWithOffset), ...environmentQuery(environment), ...kqlQuery(kuery), ...getDocumentTypeFilterForTransactions(searchAggregatedTransactions), @@ -134,7 +143,7 @@ export async function getServiceInstancesTransactionStatistics< field: '@timestamp', fixed_interval: intervalString, min_doc_count: 0, - extended_bounds: { min: start, max: end }, + extended_bounds: { min: startWithOffset, max: endWithOffset }, }, aggs: subAggs, }, @@ -193,7 +202,11 @@ export async function getServiceInstancesTransactionStatistics< aggregation: latency, latencyAggregationType, }), - throughput: calculateThroughput({ start, end, value: count }), + throughput: calculateThroughput({ + start: startWithOffset, + end: endWithOffset, + value: count, + }), }; } } diff --git a/x-pack/plugins/apm/server/routes/services/get_service_instances/main_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_instances/main_statistics.ts index a064c71496de9..a09b105cb5a79 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_instances/main_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_instances/main_statistics.ts @@ -23,6 +23,7 @@ interface ServiceInstanceMainStatisticsParams { size: number; start: number; end: number; + offset?: string; } export async function getServiceInstancesMainStatistics( diff --git a/x-pack/plugins/apm/server/routes/services/get_service_transaction_group_detailed_statistics.ts b/x-pack/plugins/apm/server/routes/services/get_service_transaction_group_detailed_statistics.ts index b14329985db90..2bc9ea328030d 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_transaction_group_detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/services/get_service_transaction_group_detailed_statistics.ts @@ -30,6 +30,7 @@ import { } from '../../lib/helpers/latency_aggregation_type'; import { Setup } from '../../lib/helpers/setup_request'; import { calculateFailedTransactionRate } from '../../lib/helpers/transaction_error_rate'; +import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; export async function getServiceTransactionGroupDetailedStatistics({ environment, @@ -43,6 +44,7 @@ export async function getServiceTransactionGroupDetailedStatistics({ latencyAggregationType, start, end, + offset, }: { environment: string; kuery: string; @@ -55,6 +57,7 @@ export async function getServiceTransactionGroupDetailedStatistics({ latencyAggregationType: LatencyAggregationType; start: number; end: number; + offset?: string; }): Promise< Array<{ transactionName: string; @@ -65,9 +68,16 @@ export async function getServiceTransactionGroupDetailedStatistics({ }> > { const { apmEventClient } = setup; - const { intervalString } = getBucketSizeForAggregatedTransactions({ + + const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, + offset, + }); + + const { intervalString } = getBucketSizeForAggregatedTransactions({ + start: startWithOffset, + end: endWithOffset, numBuckets, searchAggregatedTransactions, }); @@ -92,7 +102,7 @@ export async function getServiceTransactionGroupDetailedStatistics({ ...getDocumentTypeFilterForTransactions( searchAggregatedTransactions ), - ...rangeQuery(start, end), + ...rangeQuery(startWithOffset, endWithOffset), ...environmentQuery(environment), ...kqlQuery(kuery), ], @@ -116,8 +126,8 @@ export async function getServiceTransactionGroupDetailedStatistics({ fixed_interval: intervalString, min_doc_count: 0, extended_bounds: { - min: start, - max: end, + min: startWithOffset, + max: endWithOffset, }, }, aggs: { @@ -179,12 +189,11 @@ export async function getServiceTransactionGroupDetailedStatisticsPeriods({ searchAggregatedTransactions, transactionType, latencyAggregationType, - comparisonStart, - comparisonEnd, environment, kuery, start, end, + offset, }: { serviceName: string; transactionNames: string[]; @@ -193,12 +202,11 @@ export async function getServiceTransactionGroupDetailedStatisticsPeriods({ searchAggregatedTransactions: boolean; transactionType: string; latencyAggregationType: LatencyAggregationType; - comparisonStart?: number; - comparisonEnd?: number; environment: string; kuery: string; start: number; end: number; + offset?: string; }) { const commonProps = { setup, @@ -218,14 +226,14 @@ export async function getServiceTransactionGroupDetailedStatisticsPeriods({ end, }); - const previousPeriodPromise = - comparisonStart && comparisonEnd - ? getServiceTransactionGroupDetailedStatistics({ - ...commonProps, - start: comparisonStart, - end: comparisonEnd, - }) - : []; + const previousPeriodPromise = offset + ? getServiceTransactionGroupDetailedStatistics({ + ...commonProps, + start, + end, + offset, + }) + : []; const [currentPeriod, previousPeriod] = await Promise.all([ currentPeriodPromise, diff --git a/x-pack/plugins/apm/server/routes/services/get_throughput.ts b/x-pack/plugins/apm/server/routes/services/get_throughput.ts index ae730313ed808..fc266d8c8f8ee 100644 --- a/x-pack/plugins/apm/server/routes/services/get_throughput.ts +++ b/x-pack/plugins/apm/server/routes/services/get_throughput.ts @@ -21,6 +21,8 @@ import { getProcessorEventForTransactions, } from '../../lib/helpers/transactions'; import { Setup } from '../../lib/helpers/setup_request'; +import { getOffsetInMs } from '../../../common/utils/get_offset_in_ms'; +import { getBucketSizeForAggregatedTransactions } from '../../lib/helpers/get_bucket_size_for_aggregated_transactions'; interface Options { environment: string; @@ -32,8 +34,7 @@ interface Options { transactionName?: string; start: number; end: number; - intervalString: string; - bucketSize: number; + offset?: string; } export async function getThroughput({ @@ -46,11 +47,22 @@ export async function getThroughput({ transactionName, start, end, - intervalString, - bucketSize, + offset, }: Options) { const { apmEventClient } = setup; + const { startWithOffset, endWithOffset } = getOffsetInMs({ + start, + end, + offset, + }); + + const { intervalString } = getBucketSizeForAggregatedTransactions({ + start: startWithOffset, + end: endWithOffset, + searchAggregatedTransactions, + }); + const params = { apm: { events: [getProcessorEventForTransactions(searchAggregatedTransactions)], @@ -65,7 +77,7 @@ export async function getThroughput({ ...getDocumentTypeFilterForTransactions( searchAggregatedTransactions ), - ...rangeQuery(start, end), + ...rangeQuery(startWithOffset, endWithOffset), ...environmentQuery(environment), ...kqlQuery(kuery), ...termQuery(TRANSACTION_NAME, transactionName), @@ -78,7 +90,7 @@ export async function getThroughput({ field: '@timestamp', fixed_interval: intervalString, min_doc_count: 0, - extended_bounds: { min: start, max: end }, + extended_bounds: { min: startWithOffset, max: endWithOffset }, }, aggs: { throughput: { diff --git a/x-pack/plugins/apm/server/routes/services/route.ts b/x-pack/plugins/apm/server/routes/services/route.ts index 8373e513c8325..fb5b7a56e72fb 100644 --- a/x-pack/plugins/apm/server/routes/services/route.ts +++ b/x-pack/plugins/apm/server/routes/services/route.ts @@ -29,17 +29,10 @@ import { getServiceProfilingTimeline } from './profiling/get_service_profiling_t import { getServiceInfrastructure } from './get_service_infrastructure'; import { withApmSpan } from '../../utils/with_apm_span'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; -import { - comparisonRangeRt, - environmentRt, - kueryRt, - offsetRt, - rangeRt, -} from '../default_api_types'; +import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; import { offsetPreviousPeriodCoordinates } from '../../../common/utils/offset_previous_period_coordinate'; import { getServicesDetailedStatistics } from './get_services_detailed_statistics'; import { getServiceDependenciesBreakdown } from './get_service_dependencies_breakdown'; -import { getBucketSizeForAggregatedTransactions } from '../../lib/helpers/get_bucket_size_for_aggregated_transactions'; import { getAnomalyTimeseries } from '../../lib/anomaly_detection/get_anomaly_timeseries'; import { UnknownMLCapabilitiesError, @@ -54,6 +47,7 @@ import { ConnectionStatsItemWithImpact } from './../../../common/connections'; import { getSortedAndFilteredServices } from './get_services/get_sorted_and_filtered_services'; import { ServiceHealthStatus } from './../../../common/service_health_status'; import { getServiceGroup } from '../service_groups/get_service_group'; +import { offsetRt } from '../../../common/offset_rt'; const servicesRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/services', @@ -509,7 +503,7 @@ const serviceThroughputRoute = createApmServerRoute({ query: t.intersection([ t.type({ transactionType: t.string }), t.partial({ transactionName: t.string }), - t.intersection([environmentRt, kueryRt, rangeRt, comparisonRangeRt]), + t.intersection([environmentRt, kueryRt, rangeRt, offsetRt]), ]), }), options: { tags: ['access:apm'] }, @@ -530,8 +524,7 @@ const serviceThroughputRoute = createApmServerRoute({ kuery, transactionType, transactionName, - comparisonStart, - comparisonEnd, + offset, start, end, } = params.query; @@ -542,13 +535,6 @@ const serviceThroughputRoute = createApmServerRoute({ end, }); - const { bucketSize, intervalString } = - getBucketSizeForAggregatedTransactions({ - start, - end, - searchAggregatedTransactions, - }); - const commonProps = { environment, kuery, @@ -557,8 +543,6 @@ const serviceThroughputRoute = createApmServerRoute({ setup, transactionType, transactionName, - intervalString, - bucketSize, }; const [currentPeriod, previousPeriod] = await Promise.all([ @@ -567,11 +551,12 @@ const serviceThroughputRoute = createApmServerRoute({ start, end, }), - comparisonStart && comparisonEnd + offset ? getThroughput({ ...commonProps, - start: comparisonStart, - end: comparisonEnd, + start, + end, + offset, }) : [], ]); @@ -598,7 +583,7 @@ const serviceInstancesMainStatisticsRoute = createApmServerRoute({ latencyAggregationType: latencyAggregationTypeRt, transactionType: t.string, }), - comparisonRangeRt, + offsetRt, environmentRt, kueryRt, rangeRt, @@ -633,8 +618,7 @@ const serviceInstancesMainStatisticsRoute = createApmServerRoute({ kuery, transactionType, latencyAggregationType, - comparisonStart, - comparisonEnd, + offset, start, end, } = params.query; @@ -658,7 +642,7 @@ const serviceInstancesMainStatisticsRoute = createApmServerRoute({ start, end, }), - ...(comparisonStart && comparisonEnd + ...(offset ? [ getServiceInstancesMainStatistics({ environment, @@ -668,8 +652,9 @@ const serviceInstancesMainStatisticsRoute = createApmServerRoute({ setup, transactionType, searchAggregatedTransactions, - start: comparisonStart, - end: comparisonEnd, + start, + end, + offset, }), ] : []), @@ -696,7 +681,7 @@ const serviceInstancesDetailedStatisticsRoute = createApmServerRoute({ environmentRt, kueryRt, rangeRt, - comparisonRangeRt, + offsetRt, ]), }), options: { tags: ['access:apm'] }, @@ -752,8 +737,7 @@ const serviceInstancesDetailedStatisticsRoute = createApmServerRoute({ environment, kuery, transactionType, - comparisonStart, - comparisonEnd, + offset, serviceNodeIds, numBuckets, latencyAggregationType, @@ -778,8 +762,7 @@ const serviceInstancesDetailedStatisticsRoute = createApmServerRoute({ searchAggregatedTransactions, numBuckets, serviceNodeIds, - comparisonStart, - comparisonEnd, + offset, start, end, }); diff --git a/x-pack/plugins/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts b/x-pack/plugins/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts index 96913b9e197a7..0538832b6e84c 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_failed_transaction_rate_periods.ts @@ -16,10 +16,9 @@ export async function getFailedTransactionRatePeriods({ transactionName, setup, searchAggregatedTransactions, - comparisonStart, - comparisonEnd, start, end, + offset, }: { environment: string; kuery: string; @@ -28,10 +27,9 @@ export async function getFailedTransactionRatePeriods({ transactionName?: string; setup: Setup; searchAggregatedTransactions: boolean; - comparisonStart?: number; - comparisonEnd?: number; start: number; end: number; + offset?: string; }) { const commonProps = { environment, @@ -49,14 +47,14 @@ export async function getFailedTransactionRatePeriods({ end, }); - const previousPeriodPromise = - comparisonStart && comparisonEnd - ? getFailedTransactionRate({ - ...commonProps, - start: comparisonStart, - end: comparisonEnd, - }) - : { timeseries: [], average: null }; + const previousPeriodPromise = offset + ? getFailedTransactionRate({ + ...commonProps, + start, + end, + offset, + }) + : { timeseries: [], average: null }; const [currentPeriod, previousPeriod] = await Promise.all([ currentPeriodPromise, diff --git a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts index 5ae16aab00c23..cb8289200959e 100644 --- a/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts +++ b/x-pack/plugins/apm/server/routes/transactions/get_latency_charts/index.ts @@ -29,6 +29,8 @@ import { getLatencyAggregation, getLatencyValue, } from '../../../lib/helpers/latency_aggregation_type'; +import { getOffsetInMs } from '../../../../common/utils/get_offset_in_ms'; + export type LatencyChartsSearchResponse = Awaited< ReturnType >; @@ -44,6 +46,7 @@ function searchLatency({ latencyAggregationType, start, end, + offset, }: { environment: string; kuery: string; @@ -55,11 +58,19 @@ function searchLatency({ latencyAggregationType: LatencyAggregationType; start: number; end: number; + offset?: string; }) { const { apmEventClient } = setup; - const { intervalString } = getBucketSizeForAggregatedTransactions({ + + const { startWithOffset, endWithOffset } = getOffsetInMs({ start, end, + offset, + }); + + const { intervalString } = getBucketSizeForAggregatedTransactions({ + start: startWithOffset, + end: endWithOffset, searchAggregatedTransactions, }); @@ -80,7 +91,7 @@ function searchLatency({ ...getDocumentTypeFilterForTransactions( searchAggregatedTransactions ), - ...rangeQuery(start, end), + ...rangeQuery(startWithOffset, endWithOffset), ...environmentQuery(environment), ...kqlQuery(kuery), ...termQuery(TRANSACTION_NAME, transactionName), @@ -94,7 +105,7 @@ function searchLatency({ field: '@timestamp', fixed_interval: intervalString, min_doc_count: 0, - extended_bounds: { min: start, max: end }, + extended_bounds: { min: startWithOffset, max: endWithOffset }, }, aggs: getLatencyAggregation( latencyAggregationType, @@ -120,6 +131,7 @@ export async function getLatencyTimeseries({ latencyAggregationType, start, end, + offset, }: { environment: string; kuery: string; @@ -131,6 +143,7 @@ export async function getLatencyTimeseries({ latencyAggregationType: LatencyAggregationType; start: number; end: number; + offset?: string; }) { const response = await searchLatency({ environment, @@ -143,6 +156,7 @@ export async function getLatencyTimeseries({ latencyAggregationType, start, end, + offset, }); if (!response.aggregations) { @@ -173,12 +187,11 @@ export async function getLatencyPeriods({ setup, searchAggregatedTransactions, latencyAggregationType, - comparisonStart, - comparisonEnd, kuery, environment, start, end, + offset, }: { serviceName: string; transactionType: string | undefined; @@ -186,12 +199,11 @@ export async function getLatencyPeriods({ setup: Setup; searchAggregatedTransactions: boolean; latencyAggregationType: LatencyAggregationType; - comparisonStart?: number; - comparisonEnd?: number; kuery: string; environment: string; start: number; end: number; + offset?: string; }) { const options = { serviceName, @@ -210,16 +222,16 @@ export async function getLatencyPeriods({ latencyAggregationType: latencyAggregationType as LatencyAggregationType, }); - const previousPeriodPromise = - comparisonStart && comparisonEnd - ? getLatencyTimeseries({ - ...options, - start: comparisonStart, - end: comparisonEnd, - latencyAggregationType: - latencyAggregationType as LatencyAggregationType, - }) - : { latencyTimeseries: [], overallAvgDuration: null }; + const previousPeriodPromise = offset + ? getLatencyTimeseries({ + ...options, + start, + end, + offset, + latencyAggregationType: + latencyAggregationType as LatencyAggregationType, + }) + : { latencyTimeseries: [], overallAvgDuration: null }; const [currentPeriod, previousPeriod] = await Promise.all([ currentPeriodPromise, diff --git a/x-pack/plugins/apm/server/routes/transactions/route.ts b/x-pack/plugins/apm/server/routes/transactions/route.ts index 657387037855f..d5a380ffefa19 100644 --- a/x-pack/plugins/apm/server/routes/transactions/route.ts +++ b/x-pack/plugins/apm/server/routes/transactions/route.ts @@ -21,12 +21,8 @@ import { getLatencyPeriods } from './get_latency_charts'; import { getFailedTransactionRatePeriods } from './get_failed_transaction_rate_periods'; import { getColdstartRatePeriods } from '../../lib/transaction_groups/get_coldstart_rate'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; -import { - comparisonRangeRt, - environmentRt, - kueryRt, - rangeRt, -} from '../default_api_types'; +import { environmentRt, kueryRt, rangeRt } from '../default_api_types'; +import { offsetRt } from '../../../common/offset_rt'; const transactionGroupsMainStatisticsRoute = createApmServerRoute({ endpoint: @@ -104,7 +100,7 @@ const transactionGroupsDetailedStatisticsRoute = createApmServerRoute({ environmentRt, kueryRt, rangeRt, - comparisonRangeRt, + offsetRt, t.type({ transactionNames: jsonRt.pipe(t.array(t.string)), numBuckets: toNumberRt, @@ -155,10 +151,9 @@ const transactionGroupsDetailedStatisticsRoute = createApmServerRoute({ latencyAggregationType, numBuckets, transactionType, - comparisonStart, - comparisonEnd, start, end, + offset, }, } = params; @@ -179,10 +174,9 @@ const transactionGroupsDetailedStatisticsRoute = createApmServerRoute({ transactionType, numBuckets, latencyAggregationType, - comparisonStart, - comparisonEnd, start, end, + offset, }); }, }); @@ -200,7 +194,7 @@ const transactionLatencyChartsRoute = createApmServerRoute({ latencyAggregationType: latencyAggregationTypeRt, }), t.partial({ transactionName: t.string }), - t.intersection([environmentRt, kueryRt, rangeRt, comparisonRangeRt]), + t.intersection([environmentRt, kueryRt, rangeRt, offsetRt]), ]), }), options: { tags: ['access:apm'] }, @@ -237,10 +231,9 @@ const transactionLatencyChartsRoute = createApmServerRoute({ transactionType, transactionName, latencyAggregationType, - comparisonStart, - comparisonEnd, start, end, + offset, } = params.query; const searchAggregatedTransactions = await getSearchAggregatedTransactions({ @@ -266,8 +259,7 @@ const transactionLatencyChartsRoute = createApmServerRoute({ const { currentPeriod, previousPeriod } = await getLatencyPeriods({ ...options, latencyAggregationType: latencyAggregationType as LatencyAggregationType, - comparisonStart, - comparisonEnd, + offset, }); return { @@ -397,7 +389,7 @@ const transactionChartsErrorRateRoute = createApmServerRoute({ query: t.intersection([ t.type({ transactionType: t.string }), t.partial({ transactionName: t.string }), - t.intersection([environmentRt, kueryRt, rangeRt, comparisonRangeRt]), + t.intersection([environmentRt, kueryRt, rangeRt, offsetRt]), ]), }), options: { tags: ['access:apm'] }, @@ -433,10 +425,9 @@ const transactionChartsErrorRateRoute = createApmServerRoute({ kuery, transactionType, transactionName, - comparisonStart, - comparisonEnd, start, end, + offset, } = params.query; const searchAggregatedTransactions = await getSearchAggregatedTransactions({ @@ -454,10 +445,9 @@ const transactionChartsErrorRateRoute = createApmServerRoute({ transactionName, setup, searchAggregatedTransactions, - comparisonStart, - comparisonEnd, start, end, + offset, }); }, }); @@ -471,7 +461,7 @@ const transactionChartsColdstartRateRoute = createApmServerRoute({ }), query: t.intersection([ t.type({ transactionType: t.string }), - t.intersection([environmentRt, kueryRt, rangeRt, comparisonRangeRt]), + t.intersection([environmentRt, kueryRt, rangeRt, offsetRt]), ]), }), options: { tags: ['access:apm'] }, @@ -504,15 +494,8 @@ const transactionChartsColdstartRateRoute = createApmServerRoute({ const { params } = resources; const { serviceName } = params.path; - const { - environment, - kuery, - transactionType, - comparisonStart, - comparisonEnd, - start, - end, - } = params.query; + const { environment, kuery, transactionType, start, end, offset } = + params.query; const searchAggregatedTransactions = await getSearchAggregatedTransactions({ ...setup, @@ -528,10 +511,9 @@ const transactionChartsColdstartRateRoute = createApmServerRoute({ transactionType, setup, searchAggregatedTransactions, - comparisonStart, - comparisonEnd, start, end, + offset, }); }, }); @@ -546,7 +528,7 @@ const transactionChartsColdstartRateByTransactionNameRoute = }), query: t.intersection([ t.type({ transactionType: t.string, transactionName: t.string }), - t.intersection([environmentRt, kueryRt, rangeRt, comparisonRangeRt]), + t.intersection([environmentRt, kueryRt, rangeRt, offsetRt]), ]), }), options: { tags: ['access:apm'] }, @@ -584,10 +566,9 @@ const transactionChartsColdstartRateByTransactionNameRoute = kuery, transactionType, transactionName, - comparisonStart, - comparisonEnd, start, end, + offset, } = params.query; const searchAggregatedTransactions = @@ -606,10 +587,9 @@ const transactionChartsColdstartRateByTransactionNameRoute = transactionName, setup, searchAggregatedTransactions, - comparisonStart, - comparisonEnd, start, end, + offset, }); }, }); diff --git a/x-pack/plugins/cases/docs/README.md b/x-pack/plugins/cases/docs/README.md deleted file mode 100644 index 03f089280bc57..0000000000000 --- a/x-pack/plugins/cases/docs/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Cases Client API Docs - -This directory contains generated docs using `typedoc` for the cases client API that can be called from other server -plugins. This README will describe how to generate a new version of these markdown docs in the event that new methods -or parameters are added. - -## TypeDoc Info - -See more info at: -markdown plugin: -missing exports plugin: - -## Install dependencies - -Ensure that your global typescript version is the same as kibana's - -You can run `npx tsc --version` to find the global compiler version and then check the version under `node_modules/typescript/lib`. - -```bash -yarn global add typedoc typedoc-plugin-markdown typedoc-plugin-missing-exports -``` - -## Generate the docs - -```bash -cd x-pack/plugins/cases/docs -npx typedoc --options cases_client_typedoc.json -``` - -After running the above commands the files in the `server` directory will be updated to match the new tsdocs. -If additional markdown directory should be created we can create a new typedoc configuration file and adjust the `out` -directory accordingly. - -## Troubleshooting - -If you run into tsc errors that seem unrelated to the cases plugin try executing these commands before running `typedoc` - -```bash -cd -npx yarn kbn bootstrap -node scripts/build_ts_refs.js --clean --no-cache -``` diff --git a/x-pack/plugins/cases/docs/cases_client/.nojekyll b/x-pack/plugins/cases/docs/cases_client/.nojekyll deleted file mode 100644 index e2ac6616addc2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/.nojekyll +++ /dev/null @@ -1 +0,0 @@ -TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/x-pack/plugins/cases/docs/cases_client/README.md b/x-pack/plugins/cases/docs/cases_client/README.md deleted file mode 100644 index c3fa291458cca..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Cases Client API Interface - -# Cases Client API Interface - -## Table of contents - -### Modules - -- [attachments/client](modules/attachments_client.md) -- [cases/client](modules/cases_client.md) -- [cases/get](modules/cases_get.md) -- [cases/push](modules/cases_push.md) -- [client](modules/client.md) -- [configure/client](modules/configure_client.md) -- [metrics/client](modules/metrics_client.md) -- [stats/client](modules/stats_client.md) -- [typedoc\_interfaces](modules/typedoc_interfaces.md) -- [user\_actions/client](modules/user_actions_client.md) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionExecutor.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionExecutor.md deleted file mode 100644 index 720db77a77e7e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionExecutor.md +++ /dev/null @@ -1,153 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionExecutor - -# Class: ActionExecutor - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionExecutor - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.ActionExecutor.md#constructor) - -### Properties - -- [actionExecutorContext](client._internal_namespace.ActionExecutor.md#actionexecutorcontext) -- [actionInfo](client._internal_namespace.ActionExecutor.md#actioninfo) -- [isESOCanEncrypt](client._internal_namespace.ActionExecutor.md#isesocanencrypt) -- [isInitialized](client._internal_namespace.ActionExecutor.md#isinitialized) - -### Methods - -- [execute](client._internal_namespace.ActionExecutor.md#execute) -- [initialize](client._internal_namespace.ActionExecutor.md#initialize) -- [logCancellation](client._internal_namespace.ActionExecutor.md#logcancellation) - -## Constructors - -### constructor - -• **new ActionExecutor**(`__namedParameters`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.isESOCanEncrypt` | `boolean` | - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:40 - -## Properties - -### actionExecutorContext - -• `Private` `Optional` **actionExecutorContext**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:37 - -___ - -### actionInfo - -• `Private` **actionInfo**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:39 - -___ - -### isESOCanEncrypt - -• `Private` `Readonly` **isESOCanEncrypt**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:38 - -___ - -### isInitialized - -• `Private` **isInitialized**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:36 - -## Methods - -### execute - -▸ **execute**(`__namedParameters`): `Promise`<[`ActionTypeExecutorResult`](../interfaces/client._internal_namespace.ActionTypeExecutorResult.md)<`unknown`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`ExecuteOptions`](../interfaces/client._internal_namespace.ExecuteOptions.md)<`unknown`\> | - -#### Returns - -`Promise`<[`ActionTypeExecutorResult`](../interfaces/client._internal_namespace.ActionTypeExecutorResult.md)<`unknown`\>\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:44 - -___ - -### initialize - -▸ **initialize**(`actionExecutorContext`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionExecutorContext` | [`ActionExecutorContext`](../interfaces/client._internal_namespace.ActionExecutorContext.md) | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:43 - -___ - -### logCancellation - -▸ **logCancellation**<`Source`\>(`__namedParameters`): `Promise`<`void`\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Source` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.actionId` | `string` | -| `__namedParameters.executionId?` | `string` | -| `__namedParameters.relatedSavedObjects` | `Readonly`<{ `namespace?`: `string` ; `typeId?`: `string` } & { `id`: `string` ; `type`: `string` }\>[] | -| `__namedParameters.request` | [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | -| `__namedParameters.source?` | [`ActionExecutionSource`](../interfaces/client._internal_namespace.ActionExecutionSource.md)<`Source`\> | -| `__namedParameters.taskInfo?` | [`TaskInfo`](../interfaces/client._internal_namespace.TaskInfo.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:45 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionTypeRegistry.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionTypeRegistry.md deleted file mode 100644 index b801bdf26a158..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionTypeRegistry.md +++ /dev/null @@ -1,288 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionTypeRegistry - -# Class: ActionTypeRegistry - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionTypeRegistry - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.ActionTypeRegistry.md#constructor) - -### Properties - -- [actionTypes](client._internal_namespace.ActionTypeRegistry.md#actiontypes) -- [actionsConfigUtils](client._internal_namespace.ActionTypeRegistry.md#actionsconfigutils) -- [licenseState](client._internal_namespace.ActionTypeRegistry.md#licensestate) -- [licensing](client._internal_namespace.ActionTypeRegistry.md#licensing) -- [preconfiguredActions](client._internal_namespace.ActionTypeRegistry.md#preconfiguredactions) -- [taskManager](client._internal_namespace.ActionTypeRegistry.md#taskmanager) -- [taskRunnerFactory](client._internal_namespace.ActionTypeRegistry.md#taskrunnerfactory) - -### Methods - -- [ensureActionTypeEnabled](client._internal_namespace.ActionTypeRegistry.md#ensureactiontypeenabled) -- [get](client._internal_namespace.ActionTypeRegistry.md#get) -- [has](client._internal_namespace.ActionTypeRegistry.md#has) -- [isActionExecutable](client._internal_namespace.ActionTypeRegistry.md#isactionexecutable) -- [isActionTypeEnabled](client._internal_namespace.ActionTypeRegistry.md#isactiontypeenabled) -- [list](client._internal_namespace.ActionTypeRegistry.md#list) -- [register](client._internal_namespace.ActionTypeRegistry.md#register) - -## Constructors - -### constructor - -• **new ActionTypeRegistry**(`constructorParams`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `constructorParams` | [`ActionTypeRegistryOpts`](../interfaces/client._internal_namespace.ActionTypeRegistryOpts.md) | - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:23 - -## Properties - -### actionTypes - -• `Private` `Readonly` **actionTypes**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:17 - -___ - -### actionsConfigUtils - -• `Private` `Readonly` **actionsConfigUtils**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:19 - -___ - -### licenseState - -• `Private` `Readonly` **licenseState**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:20 - -___ - -### licensing - -• `Private` `Readonly` **licensing**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:22 - -___ - -### preconfiguredActions - -• `Private` `Readonly` **preconfiguredActions**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:21 - -___ - -### taskManager - -• `Private` `Readonly` **taskManager**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:16 - -___ - -### taskRunnerFactory - -• `Private` `Readonly` **taskRunnerFactory**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:18 - -## Methods - -### ensureActionTypeEnabled - -▸ **ensureActionTypeEnabled**(`id`): `void` - -Throws error if action type is not enabled. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | `string` | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:31 - -___ - -### get - -▸ **get**<`Config`, `Secrets`, `Params`, `ExecutorResultData`\>(`id`): [`ActionType`](../interfaces/client._internal_namespace.ActionType-1.md)<`Config`, `Secrets`, `Params`, `ExecutorResultData`\> - -Returns an action type, throws if not registered - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Config` | extends [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) = [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) | -| `Secrets` | extends [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets) = [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets) | -| `Params` | extends [`ActionTypeParams`](../modules/client._internal_namespace.md#actiontypeparams) = [`ActionTypeParams`](../modules/client._internal_namespace.md#actiontypeparams) | -| `ExecutorResultData` | `void` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | `string` | - -#### Returns - -[`ActionType`](../interfaces/client._internal_namespace.ActionType-1.md)<`Config`, `Secrets`, `Params`, `ExecutorResultData`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:51 - -___ - -### has - -▸ **has**(`id`): `boolean` - -Returns if the action type registry has the given action type registered - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:27 - -___ - -### isActionExecutable - -▸ **isActionExecutable**(`actionId`, `actionTypeId`, `options?`): `boolean` - -Returns true if action type is enabled or it is a preconfigured action type. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionId` | `string` | -| `actionTypeId` | `string` | -| `options?` | `Object` | -| `options.notifyUsage` | `boolean` | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:41 - -___ - -### isActionTypeEnabled - -▸ **isActionTypeEnabled**(`id`, `options?`): `boolean` - -Returns true if action type is enabled in the config and a valid license is used. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | `string` | -| `options?` | `Object` | -| `options.notifyUsage` | `boolean` | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:35 - -___ - -### list - -▸ **list**(): [`ActionType`](../interfaces/client._internal_namespace.ActionType.md)[] - -Returns a list of registered action types [{ id, name, enabled }] - -#### Returns - -[`ActionType`](../interfaces/client._internal_namespace.ActionType.md)[] - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:55 - -___ - -### register - -▸ **register**<`Config`, `Secrets`, `Params`, `ExecutorResultData`\>(`actionType`): `void` - -Registers an action type to the action type registry - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Config` | extends [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) = [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) | -| `Secrets` | extends [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets) = [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets) | -| `Params` | extends [`ActionTypeParams`](../modules/client._internal_namespace.md#actiontypeparams) = [`ActionTypeParams`](../modules/client._internal_namespace.md#actiontypeparams) | -| `ExecutorResultData` | `void` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionType` | [`ActionType`](../interfaces/client._internal_namespace.ActionType-1.md)<`Config`, `Secrets`, `Params`, `ExecutorResultData`\> | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:47 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.Actions.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.Actions.md deleted file mode 100644 index c05dbe40c3657..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.Actions.md +++ /dev/null @@ -1,144 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Actions - -# Class: Actions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Actions - -Actions are used to create the "actions" that are associated with Elasticsearch's -application privileges, and are used to perform the authorization checks implemented -by the various `checkPrivilegesWithRequest` derivatives. - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.Actions.md#constructor) - -### Properties - -- [alerting](client._internal_namespace.Actions.md#alerting) -- [api](client._internal_namespace.Actions.md#api) -- [app](client._internal_namespace.Actions.md#app) -- [cases](client._internal_namespace.Actions.md#cases) -- [login](client._internal_namespace.Actions.md#login) -- [savedObject](client._internal_namespace.Actions.md#savedobject) -- [space](client._internal_namespace.Actions.md#space) -- [ui](client._internal_namespace.Actions.md#ui) -- [version](client._internal_namespace.Actions.md#version) -- [versionNumber](client._internal_namespace.Actions.md#versionnumber) - -## Constructors - -### constructor - -• **new Actions**(`versionNumber`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionNumber` | `string` | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:23 - -## Properties - -### alerting - -• `Readonly` **alerting**: [`AlertingActions`](client._internal_namespace.AlertingActions.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:19 - -___ - -### api - -• `Readonly` **api**: [`ApiActions`](client._internal_namespace.ApiActions.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:14 - -___ - -### app - -• `Readonly` **app**: [`AppActions`](client._internal_namespace.AppActions.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:15 - -___ - -### cases - -• `Readonly` **cases**: [`CasesActions`](client._internal_namespace.CasesActions.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:16 - -___ - -### login - -• `Readonly` **login**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:17 - -___ - -### savedObject - -• `Readonly` **savedObject**: [`SavedObjectActions`](client._internal_namespace.SavedObjectActions.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:18 - -___ - -### space - -• `Readonly` **space**: [`SpaceActions`](client._internal_namespace.SpaceActions.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:20 - -___ - -### ui - -• `Readonly` **ui**: [`UIActions`](client._internal_namespace.UIActions.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:21 - -___ - -### version - -• `Readonly` **version**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:22 - -___ - -### versionNumber - -• `Private` `Readonly` **versionNumber**: `any` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/actions.d.ts:13 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionsAuthorization.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionsAuthorization.md deleted file mode 100644 index eb1403431969d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionsAuthorization.md +++ /dev/null @@ -1,99 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionsAuthorization - -# Class: ActionsAuthorization - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionsAuthorization - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.ActionsAuthorization.md#constructor) - -### Properties - -- [authorization](client._internal_namespace.ActionsAuthorization.md#authorization) -- [authorizationMode](client._internal_namespace.ActionsAuthorization.md#authorizationmode) -- [isOperationExemptDueToLegacyRbac](client._internal_namespace.ActionsAuthorization.md#isoperationexemptduetolegacyrbac) -- [request](client._internal_namespace.ActionsAuthorization.md#request) - -### Methods - -- [ensureAuthorized](client._internal_namespace.ActionsAuthorization.md#ensureauthorized) - -## Constructors - -### constructor - -• **new ActionsAuthorization**(`__namedParameters`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`ConstructorOptions`](../interfaces/client._internal_namespace.ConstructorOptions-1.md) | - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:14 - -## Properties - -### authorization - -• `Private` `Optional` `Readonly` **authorization**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:12 - -___ - -### authorizationMode - -• `Private` `Readonly` **authorizationMode**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:13 - -___ - -### isOperationExemptDueToLegacyRbac - -• `Private` **isOperationExemptDueToLegacyRbac**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:16 - -___ - -### request - -• `Private` `Readonly` **request**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:11 - -## Methods - -### ensureAuthorized - -▸ **ensureAuthorized**(`operation`, `actionTypeId?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `operation` | `string` | -| `actionTypeId?` | `string` | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:15 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionsClient.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionsClient.md deleted file mode 100644 index a566950c5fa21..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ActionsClient.md +++ /dev/null @@ -1,432 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionsClient - -# Class: ActionsClient - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionsClient - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.ActionsClient.md#constructor) - -### Properties - -- [actionExecutor](client._internal_namespace.ActionsClient.md#actionexecutor) -- [actionTypeRegistry](client._internal_namespace.ActionsClient.md#actiontyperegistry) -- [auditLogger](client._internal_namespace.ActionsClient.md#auditlogger) -- [authorization](client._internal_namespace.ActionsClient.md#authorization) -- [connectorTokenClient](client._internal_namespace.ActionsClient.md#connectortokenclient) -- [defaultKibanaIndex](client._internal_namespace.ActionsClient.md#defaultkibanaindex) -- [ephemeralExecutionEnqueuer](client._internal_namespace.ActionsClient.md#ephemeralexecutionenqueuer) -- [executionEnqueuer](client._internal_namespace.ActionsClient.md#executionenqueuer) -- [preconfiguredActions](client._internal_namespace.ActionsClient.md#preconfiguredactions) -- [request](client._internal_namespace.ActionsClient.md#request) -- [scopedClusterClient](client._internal_namespace.ActionsClient.md#scopedclusterclient) -- [unsecuredSavedObjectsClient](client._internal_namespace.ActionsClient.md#unsecuredsavedobjectsclient) -- [usageCounter](client._internal_namespace.ActionsClient.md#usagecounter) - -### Methods - -- [create](client._internal_namespace.ActionsClient.md#create) -- [delete](client._internal_namespace.ActionsClient.md#delete) -- [enqueueExecution](client._internal_namespace.ActionsClient.md#enqueueexecution) -- [ephemeralEnqueuedExecution](client._internal_namespace.ActionsClient.md#ephemeralenqueuedexecution) -- [execute](client._internal_namespace.ActionsClient.md#execute) -- [get](client._internal_namespace.ActionsClient.md#get) -- [getAll](client._internal_namespace.ActionsClient.md#getall) -- [getBulk](client._internal_namespace.ActionsClient.md#getbulk) -- [isActionTypeEnabled](client._internal_namespace.ActionsClient.md#isactiontypeenabled) -- [isPreconfigured](client._internal_namespace.ActionsClient.md#ispreconfigured) -- [listTypes](client._internal_namespace.ActionsClient.md#listtypes) -- [update](client._internal_namespace.ActionsClient.md#update) - -## Constructors - -### constructor - -• **new ActionsClient**(`__namedParameters`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`ConstructorOptions`](../interfaces/client._internal_namespace.ConstructorOptions.md) | - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:57 - -## Properties - -### actionExecutor - -• `Private` `Readonly` **actionExecutor**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:49 - -___ - -### actionTypeRegistry - -• `Private` `Readonly` **actionTypeRegistry**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:47 - -___ - -### auditLogger - -• `Private` `Optional` `Readonly` **auditLogger**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:54 - -___ - -### authorization - -• `Private` `Readonly` **authorization**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:51 - -___ - -### connectorTokenClient - -• `Private` `Readonly` **connectorTokenClient**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:56 - -___ - -### defaultKibanaIndex - -• `Private` `Readonly` **defaultKibanaIndex**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:44 - -___ - -### ephemeralExecutionEnqueuer - -• `Private` `Readonly` **ephemeralExecutionEnqueuer**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:53 - -___ - -### executionEnqueuer - -• `Private` `Readonly` **executionEnqueuer**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:52 - -___ - -### preconfiguredActions - -• `Private` `Readonly` **preconfiguredActions**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:48 - -___ - -### request - -• `Private` `Readonly` **request**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:50 - -___ - -### scopedClusterClient - -• `Private` `Readonly` **scopedClusterClient**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:45 - -___ - -### unsecuredSavedObjectsClient - -• `Private` `Readonly` **unsecuredSavedObjectsClient**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:46 - -___ - -### usageCounter - -• `Private` `Optional` `Readonly` **usageCounter**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:55 - -## Methods - -### create - -▸ **create**(`__namedParameters`): `Promise`<[`ActionResult`](../interfaces/client._internal_namespace.ActionResult.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig)\>\> - -Create an action - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CreateOptions`](../interfaces/client._internal_namespace.CreateOptions.md) | - -#### Returns - -`Promise`<[`ActionResult`](../interfaces/client._internal_namespace.ActionResult.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig)\>\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:61 - -___ - -### delete - -▸ **delete**(`__namedParameters`): `Promise`<{}\> - -Delete action - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | - -#### Returns - -`Promise`<{}\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:83 - -___ - -### enqueueExecution - -▸ **enqueueExecution**(`options`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `options` | [`ExecuteOptions`](../interfaces/client._internal_namespace.ExecuteOptions-1.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:87 - -___ - -### ephemeralEnqueuedExecution - -▸ **ephemeralEnqueuedExecution**(`options`): `Promise`<[`RunNowResult`](../interfaces/client._internal_namespace.RunNowResult.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `options` | [`ExecuteOptions`](../interfaces/client._internal_namespace.ExecuteOptions-1.md) | - -#### Returns - -`Promise`<[`RunNowResult`](../interfaces/client._internal_namespace.RunNowResult.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:88 - -___ - -### execute - -▸ **execute**(`__namedParameters`): `Promise`<[`ActionTypeExecutorResult`](../interfaces/client._internal_namespace.ActionTypeExecutorResult.md)<`unknown`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Omit`<[`ExecuteOptions`](../interfaces/client._internal_namespace.ExecuteOptions.md)<`unknown`\>, ``"request"``\> | - -#### Returns - -`Promise`<[`ActionTypeExecutorResult`](../interfaces/client._internal_namespace.ActionTypeExecutorResult.md)<`unknown`\>\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:86 - -___ - -### get - -▸ **get**(`__namedParameters`): `Promise`<[`ActionResult`](../interfaces/client._internal_namespace.ActionResult.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig)\>\> - -Get an action - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.id` | `string` | - -#### Returns - -`Promise`<[`ActionResult`](../interfaces/client._internal_namespace.ActionResult.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig)\>\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:69 - -___ - -### getAll - -▸ **getAll**(): `Promise`<[`FindActionResult`](../interfaces/client._internal_namespace.FindActionResult.md)[]\> - -Get all actions with preconfigured list - -#### Returns - -`Promise`<[`FindActionResult`](../interfaces/client._internal_namespace.FindActionResult.md)[]\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:75 - -___ - -### getBulk - -▸ **getBulk**(`ids`): `Promise`<[`ActionResult`](../interfaces/client._internal_namespace.ActionResult.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig)\>[]\> - -Get bulk actions with preconfigured list - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `ids` | `string`[] | - -#### Returns - -`Promise`<[`ActionResult`](../interfaces/client._internal_namespace.ActionResult.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig)\>[]\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:79 - -___ - -### isActionTypeEnabled - -▸ **isActionTypeEnabled**(`actionTypeId`, `options?`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionTypeId` | `string` | -| `options?` | `Object` | -| `options.notifyUsage` | `boolean` | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:90 - -___ - -### isPreconfigured - -▸ **isPreconfigured**(`connectorId`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `connectorId` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:93 - -___ - -### listTypes - -▸ **listTypes**(): `Promise`<[`ActionType`](../interfaces/client._internal_namespace.ActionType.md)[]\> - -#### Returns - -`Promise`<[`ActionType`](../interfaces/client._internal_namespace.ActionType.md)[]\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:89 - -___ - -### update - -▸ **update**(`__namedParameters`): `Promise`<[`ActionResult`](../interfaces/client._internal_namespace.ActionResult.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig)\>\> - -Update action - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`UpdateOptions`](../interfaces/client._internal_namespace.UpdateOptions.md) | - -#### Returns - -`Promise`<[`ActionResult`](../interfaces/client._internal_namespace.ActionResult.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig)\>\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:65 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AlertService.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AlertService.md deleted file mode 100644 index b231fddac4c61..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AlertService.md +++ /dev/null @@ -1,206 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AlertService - -# Class: AlertService - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AlertService - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.AlertService.md#constructor) - -### Methods - -- [bucketAlertsByIndexAndStatus](client._internal_namespace.AlertService.md#bucketalertsbyindexandstatus) -- [executeAggregations](client._internal_namespace.AlertService.md#executeaggregations) -- [getAlerts](client._internal_namespace.AlertService.md#getalerts) -- [translateStatus](client._internal_namespace.AlertService.md#translatestatus) -- [updateAlertsStatus](client._internal_namespace.AlertService.md#updatealertsstatus) -- [updateByQuery](client._internal_namespace.AlertService.md#updatebyquery) -- [getUniqueIdsIndices](client._internal_namespace.AlertService.md#getuniqueidsindices) -- [isEmptyAlert](client._internal_namespace.AlertService.md#isemptyalert) - -## Constructors - -### constructor - -• **new AlertService**(`scopedClusterClient`, `logger`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `scopedClusterClient` | [`ElasticsearchClient`](../modules/client._internal_namespace.md#elasticsearchclient) | -| `logger` | `Logger` | - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:24](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L24) - -## Methods - -### bucketAlertsByIndexAndStatus - -▸ `Private` **bucketAlertsByIndexAndStatus**(`alerts`): `Map`<`string`, `Map`<`STATUS_VALUES`, [`TranslatedUpdateAlertRequest`](../interfaces/client._internal_namespace.TranslatedUpdateAlertRequest.md)[]\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `alerts` | [`UpdateAlertRequest`](../interfaces/client._internal_namespace.UpdateAlertRequest.md)[] | - -#### Returns - -`Map`<`string`, `Map`<`STATUS_VALUES`, [`TranslatedUpdateAlertRequest`](../interfaces/client._internal_namespace.TranslatedUpdateAlertRequest.md)[]\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:98](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L98) - -___ - -### executeAggregations - -▸ **executeAggregations**(`__namedParameters`): `Promise`<[`AggregationResponse`](../modules/client._internal_namespace.md#aggregationresponse)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.aggregationBuilders` | [`AggregationBuilder`](../interfaces/client._internal_namespace.AggregationBuilder.md)[] | -| `__namedParameters.alerts` | [`AlertIdIndex`](../interfaces/client._internal_namespace.AlertIdIndex.md)[] | - -#### Returns - -`Promise`<[`AggregationResponse`](../modules/client._internal_namespace.md#aggregationresponse)\> - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:29](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L29) - -___ - -### getAlerts - -▸ **getAlerts**(`alertsInfo`): `Promise`<`undefined` \| [`AlertsResponse`](../interfaces/client._internal_namespace.AlertsResponse.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `alertsInfo` | [`AlertInfo`](../interfaces/client._internal_namespace.AlertInfo.md)[] | - -#### Returns - -`Promise`<`undefined` \| [`AlertsResponse`](../interfaces/client._internal_namespace.AlertsResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:182](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L182) - -___ - -### translateStatus - -▸ `Private` **translateStatus**(`alert`): `STATUS_VALUES` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `alert` | [`UpdateAlertRequest`](../interfaces/client._internal_namespace.UpdateAlertRequest.md) | - -#### Returns - -`STATUS_VALUES` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:133](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L133) - -___ - -### updateAlertsStatus - -▸ **updateAlertsStatus**(`alerts`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `alerts` | [`UpdateAlertRequest`](../interfaces/client._internal_namespace.UpdateAlertRequest.md)[] | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:78](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L78) - -___ - -### updateByQuery - -▸ `Private` **updateByQuery**(`__namedParameters`): `Promise`<`TransportResult`<`UpdateByQueryResponse`, `unknown`\>[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`string`, `Map`<`STATUS_VALUES`, [`TranslatedUpdateAlertRequest`](../interfaces/client._internal_namespace.TranslatedUpdateAlertRequest.md)[]\>] | - -#### Returns - -`Promise`<`TransportResult`<`UpdateByQueryResponse`, `unknown`\>[]\> - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:151](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L151) - -___ - -### getUniqueIdsIndices - -▸ `Static` `Private` **getUniqueIdsIndices**(`alerts`): `Object` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `alerts` | [`AlertIdIndex`](../interfaces/client._internal_namespace.AlertIdIndex.md)[] | - -#### Returns - -`Object` - -| Name | Type | -| :------ | :------ | -| `ids` | `string`[] | -| `indices` | `string`[] | - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:62](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L62) - -___ - -### isEmptyAlert - -▸ `Static` `Private` **isEmptyAlert**(`alert`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `alert` | [`AlertInfo`](../interfaces/client._internal_namespace.AlertInfo.md) | - -#### Returns - -`boolean` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:129](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L129) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AlertingActions.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AlertingActions.md deleted file mode 100644 index 6b45ea9b28110..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AlertingActions.md +++ /dev/null @@ -1,68 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AlertingActions - -# Class: AlertingActions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AlertingActions - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.AlertingActions.md#constructor) - -### Properties - -- [prefix](client._internal_namespace.AlertingActions.md#prefix) - -### Methods - -- [get](client._internal_namespace.AlertingActions.md#get) - -## Constructors - -### constructor - -• **new AlertingActions**(`versionNumber`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionNumber` | `string` | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/alerting.d.ts:3 - -## Properties - -### prefix - -• `Private` `Readonly` **prefix**: `any` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/alerting.d.ts:2 - -## Methods - -### get - -▸ **get**(`ruleTypeId`, `consumer`, `alertingEntity`, `operation`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `ruleTypeId` | `string` | -| `consumer` | `string` | -| `alertingEntity` | `string` | -| `operation` | `string` | - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/alerting.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ApiActions.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ApiActions.md deleted file mode 100644 index a7e6c51d4a649..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ApiActions.md +++ /dev/null @@ -1,65 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ApiActions - -# Class: ApiActions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ApiActions - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.ApiActions.md#constructor) - -### Properties - -- [prefix](client._internal_namespace.ApiActions.md#prefix) - -### Methods - -- [get](client._internal_namespace.ApiActions.md#get) - -## Constructors - -### constructor - -• **new ApiActions**(`versionNumber`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionNumber` | `string` | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/api.d.ts:3 - -## Properties - -### prefix - -• `Private` `Readonly` **prefix**: `any` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/api.d.ts:2 - -## Methods - -### get - -▸ **get**(`operation`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `operation` | `string` | - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/api.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AppActions.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AppActions.md deleted file mode 100644 index 76fbfc84021c5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AppActions.md +++ /dev/null @@ -1,65 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AppActions - -# Class: AppActions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AppActions - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.AppActions.md#constructor) - -### Properties - -- [prefix](client._internal_namespace.AppActions.md#prefix) - -### Methods - -- [get](client._internal_namespace.AppActions.md#get) - -## Constructors - -### constructor - -• **new AppActions**(`versionNumber`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionNumber` | `string` | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/app.d.ts:3 - -## Properties - -### prefix - -• `Private` `Readonly` **prefix**: `any` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/app.d.ts:2 - -## Methods - -### get - -▸ **get**(`appId`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `appId` | `string` | - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/app.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AttachmentService.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AttachmentService.md deleted file mode 100644 index 064f9cf9567b3..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AttachmentService.md +++ /dev/null @@ -1,217 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AttachmentService - -# Class: AttachmentService - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AttachmentService - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.AttachmentService.md#constructor) - -### Methods - -- [buildCountAlertsAggs](client._internal_namespace.AttachmentService.md#buildcountalertsaggs) -- [bulkUpdate](client._internal_namespace.AttachmentService.md#bulkupdate) -- [countAlertsAttachedToCase](client._internal_namespace.AttachmentService.md#countalertsattachedtocase) -- [create](client._internal_namespace.AttachmentService.md#create) -- [delete](client._internal_namespace.AttachmentService.md#delete) -- [executeCaseActionsAggregations](client._internal_namespace.AttachmentService.md#executecaseactionsaggregations) -- [get](client._internal_namespace.AttachmentService.md#get) -- [getAllAlertsAttachToCase](client._internal_namespace.AttachmentService.md#getallalertsattachtocase) -- [update](client._internal_namespace.AttachmentService.md#update) - -## Constructors - -### constructor - -• **new AttachmentService**(`log`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `log` | `Logger` | - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:66](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L66) - -## Methods - -### buildCountAlertsAggs - -▸ `Private` **buildCountAlertsAggs**(): `Record`<`string`, `AggregationsAggregationContainer`\> - -#### Returns - -`Record`<`string`, `AggregationsAggregationContainer`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:104](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L104) - -___ - -### bulkUpdate - -▸ **bulkUpdate**(`__namedParameters`): `Promise`<[`SavedObjectsBulkUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`BulkUpdateAttachmentArgs`](../interfaces/client._internal_namespace.BulkUpdateAttachmentArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsBulkUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:262](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L262) - -___ - -### countAlertsAttachedToCase - -▸ **countAlertsAttachedToCase**(`__namedParameters`): `Promise`<`undefined` \| `number`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`AttachedToCaseArgs`](../interfaces/client._internal_namespace.AttachedToCaseArgs.md) | - -#### Returns - -`Promise`<`undefined` \| `number`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:68](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L68) - -___ - -### create - -▸ **create**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CreateAttachmentArgs`](../interfaces/client._internal_namespace.CreateAttachmentArgs.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:220](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L220) - -___ - -### delete - -▸ **delete**(`__namedParameters`): `Promise`<{}\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetAttachmentArgs`](../interfaces/client._internal_namespace.GetAttachmentArgs.md) | - -#### Returns - -`Promise`<{}\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:210](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L210) - -___ - -### executeCaseActionsAggregations - -▸ **executeCaseActionsAggregations**(`__namedParameters`): `Promise`<[`AggregationResponse`](../modules/client._internal_namespace.md#aggregationresponse)\> - -Executes the aggregations against the actions attached to a case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CountActionsAttachedToCaseArgs`](../interfaces/client._internal_namespace.CountActionsAttachedToCaseArgs.md) | - -#### Returns - -`Promise`<[`AggregationResponse`](../modules/client._internal_namespace.md#aggregationresponse)\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:157](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L157) - -___ - -### get - -▸ **get**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetAttachmentArgs`](../interfaces/client._internal_namespace.GetAttachmentArgs.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:194](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L194) - -___ - -### getAllAlertsAttachToCase - -▸ **getAllAlertsAttachToCase**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>[]\> - -Retrieves all the alerts attached to a case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`AttachedToCaseArgs`](../interfaces/client._internal_namespace.AttachedToCaseArgs.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>[]\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:117](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L117) - -___ - -### update - -▸ **update**(`__namedParameters`): `Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`UpdateAttachmentArgs`](../modules/client._internal_namespace.md#updateattachmentargs) | - -#### Returns - -`Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:242](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L242) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.Authorization.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.Authorization.md deleted file mode 100644 index 7c09e59f2216a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.Authorization.md +++ /dev/null @@ -1,241 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Authorization - -# Class: Authorization - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Authorization - -This class handles ensuring that the user making a request has the correct permissions -for the API request. - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.Authorization.md#constructor) - -### Properties - -- [auditLogger](client._internal_namespace.Authorization.md#auditlogger) -- [featureCaseOwners](client._internal_namespace.Authorization.md#featurecaseowners) -- [request](client._internal_namespace.Authorization.md#request) -- [securityAuth](client._internal_namespace.Authorization.md#securityauth) - -### Methods - -- [\_ensureAuthorized](client._internal_namespace.Authorization.md#_ensureauthorized) -- [\_getAuthorizationFilter](client._internal_namespace.Authorization.md#_getauthorizationfilter) -- [ensureAuthorized](client._internal_namespace.Authorization.md#ensureauthorized) -- [getAuthorizationFilter](client._internal_namespace.Authorization.md#getauthorizationfilter) -- [getAuthorizedOwners](client._internal_namespace.Authorization.md#getauthorizedowners) -- [shouldCheckAuthorization](client._internal_namespace.Authorization.md#shouldcheckauthorization) -- [create](client._internal_namespace.Authorization.md#create) - -## Constructors - -### constructor - -• `Private` **new Authorization**(`__namedParameters`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.auditLogger` | [`AuthorizationAuditLogger`](client._internal_namespace.AuthorizationAuditLogger.md) | -| `__namedParameters.caseOwners` | `Set`<`string`\> | -| `__namedParameters.request` | [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | -| `__namedParameters.securityAuth?` | [`AuthorizationServiceSetup`](../interfaces/client._internal_namespace.AuthorizationServiceSetup.md) | - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:27](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L27) - -## Properties - -### auditLogger - -• `Private` `Readonly` **auditLogger**: [`AuthorizationAuditLogger`](client._internal_namespace.AuthorizationAuditLogger.md) - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:25](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L25) - -___ - -### featureCaseOwners - -• `Private` `Readonly` **featureCaseOwners**: `Set`<`string`\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:24](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L24) - -___ - -### request - -• `Private` `Readonly` **request**: [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:22](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L22) - -___ - -### securityAuth - -• `Private` `Readonly` **securityAuth**: `undefined` \| [`AuthorizationServiceSetup`](../interfaces/client._internal_namespace.AuthorizationServiceSetup.md) - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:23](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L23) - -## Methods - -### \_ensureAuthorized - -▸ `Private` **_ensureAuthorized**(`owners`, `operation`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `owners` | `string`[] | -| `operation` | [`OperationDetails`](../interfaces/client._internal_namespace.OperationDetails.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:135](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L135) - -___ - -### \_getAuthorizationFilter - -▸ `Private` **_getAuthorizationFilter**(`operation`): `Promise`<[`AuthFilterHelpers`](../interfaces/client._internal_namespace.AuthFilterHelpers.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `operation` | [`OperationDetails`](../interfaces/client._internal_namespace.OperationDetails.md) | - -#### Returns - -`Promise`<[`AuthFilterHelpers`](../interfaces/client._internal_namespace.AuthFilterHelpers.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:170](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L170) - -___ - -### ensureAuthorized - -▸ **ensureAuthorized**(`__namedParameters`): `Promise`<`void`\> - -Checks that the user making the request for the passed in owners and operation has the correct authorization. This -function will throw if the user is not authorized for the requested operation and owners. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.entities` | [`OwnerEntity`](../interfaces/client._internal_namespace.OwnerEntity.md)[] | -| `__namedParameters.operation` | [`OperationDetails`](../interfaces/client._internal_namespace.OperationDetails.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:97](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L97) - -___ - -### getAuthorizationFilter - -▸ **getAuthorizationFilter**(`operation`): `Promise`<[`AuthFilterHelpers`](../interfaces/client._internal_namespace.AuthFilterHelpers.md)\> - -Returns an object to filter the saved object find request to the authorized owners of an entity. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `operation` | [`OperationDetails`](../interfaces/client._internal_namespace.OperationDetails.md) | - -#### Returns - -`Promise`<[`AuthFilterHelpers`](../interfaces/client._internal_namespace.AuthFilterHelpers.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:126](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L126) - -___ - -### getAuthorizedOwners - -▸ `Private` **getAuthorizedOwners**(`operations`): `Promise`<{ `authorizedOwners`: `string`[] ; `hasAllRequested`: `boolean` ; `username?`: `string` }\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `operations` | [`OperationDetails`](../interfaces/client._internal_namespace.OperationDetails.md)[] | - -#### Returns - -`Promise`<{ `authorizedOwners`: `string`[] ; `hasAllRequested`: `boolean` ; `username?`: `string` }\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:207](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L207) - -___ - -### shouldCheckAuthorization - -▸ `Private` **shouldCheckAuthorization**(): `boolean` - -#### Returns - -`boolean` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:85](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L85) - -___ - -### create - -▸ `Static` **create**(`__namedParameters`): `Promise`<[`Authorization`](client._internal_namespace.Authorization.md)\> - -Creates an Authorization object. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.auditLogger` | [`AuthorizationAuditLogger`](client._internal_namespace.AuthorizationAuditLogger.md) | -| `__namedParameters.features` | [`PluginStartContract`](../interfaces/client._internal_namespace.PluginStartContract.md) | -| `__namedParameters.getSpace` | [`GetSpaceFn`](../modules/client._internal_namespace.md#getspacefn) | -| `__namedParameters.logger` | `Logger` | -| `__namedParameters.request` | [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | -| `__namedParameters.securityAuth?` | [`AuthorizationServiceSetup`](../interfaces/client._internal_namespace.AuthorizationServiceSetup.md) | - -#### Returns - -`Promise`<[`Authorization`](client._internal_namespace.Authorization.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/authorization.ts:47](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/authorization.ts#L47) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AuthorizationAuditLogger.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AuthorizationAuditLogger.md deleted file mode 100644 index 5f80d4d21f4b2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.AuthorizationAuditLogger.md +++ /dev/null @@ -1,117 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuthorizationAuditLogger - -# Class: AuthorizationAuditLogger - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuthorizationAuditLogger - -Audit logger for authorization operations - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.AuthorizationAuditLogger.md#constructor) - -### Properties - -- [auditLogger](client._internal_namespace.AuthorizationAuditLogger.md#auditlogger) - -### Methods - -- [log](client._internal_namespace.AuthorizationAuditLogger.md#log) -- [createAuditMsg](client._internal_namespace.AuthorizationAuditLogger.md#createauditmsg) -- [createFailureMessage](client._internal_namespace.AuthorizationAuditLogger.md#createfailuremessage) - -## Constructors - -### constructor - -• **new AuthorizationAuditLogger**(`logger?`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `logger?` | [`AuditLogger`](../interfaces/client._internal_namespace.AuditLogger.md) | - -#### Defined in - -[x-pack/plugins/cases/server/authorization/audit_logger.ts:25](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/audit_logger.ts#L25) - -## Properties - -### auditLogger - -• `Private` `Optional` `Readonly` **auditLogger**: [`AuditLogger`](../interfaces/client._internal_namespace.AuditLogger.md) - -#### Defined in - -[x-pack/plugins/cases/server/authorization/audit_logger.ts:23](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/audit_logger.ts#L23) - -## Methods - -### log - -▸ **log**(`auditMsgParams`): `void` - -Logs an audit event based on the status of an operation. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `auditMsgParams` | [`CreateAuditMsgParams`](../interfaces/client._internal_namespace.CreateAuditMsgParams.md) | - -#### Returns - -`void` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/audit_logger.ts:98](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/audit_logger.ts#L98) - -___ - -### createAuditMsg - -▸ `Static` `Private` **createAuditMsg**(`__namedParameters`): [`AuditEvent`](../interfaces/client._internal_namespace.AuditEvent.md) - -Creates an AuditEvent describing the state of a request. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CreateAuditMsgParams`](../interfaces/client._internal_namespace.CreateAuditMsgParams.md) | - -#### Returns - -[`AuditEvent`](../interfaces/client._internal_namespace.AuditEvent.md) - -#### Defined in - -[x-pack/plugins/cases/server/authorization/audit_logger.ts:32](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/audit_logger.ts#L32) - -___ - -### createFailureMessage - -▸ `Static` **createFailureMessage**(`__namedParameters`): `string` - -Creates a message to be passed to an Error or Boom. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.operation` | [`OperationDetails`](../interfaces/client._internal_namespace.OperationDetails.md) | -| `__namedParameters.owners` | `string`[] | - -#### Returns - -`string` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/audit_logger.ts:79](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/audit_logger.ts#L79) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.BasePath.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.BasePath.md deleted file mode 100644 index 50d50b457bfea..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.BasePath.md +++ /dev/null @@ -1,189 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BasePath - -# Class: BasePath - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BasePath - -Access or manipulate the Kibana base path - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.BasePath.md#constructor) - -### Properties - -- [basePathCache](client._internal_namespace.BasePath.md#basepathcache) -- [get](client._internal_namespace.BasePath.md#get) -- [prepend](client._internal_namespace.BasePath.md#prepend) -- [publicBaseUrl](client._internal_namespace.BasePath.md#publicbaseurl) -- [remove](client._internal_namespace.BasePath.md#remove) -- [serverBasePath](client._internal_namespace.BasePath.md#serverbasepath) -- [set](client._internal_namespace.BasePath.md#set) - -## Constructors - -### constructor - -• **new BasePath**(`serverBasePath?`, `publicBaseUrl?`) - -**`internal`** - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `serverBasePath?` | `string` | -| `publicBaseUrl?` | `string` | - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:24 - -## Properties - -### basePathCache - -• `Private` `Readonly` **basePathCache**: `any` - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:8 - -___ - -### get - -• **get**: (`request`: [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\>) => `string` - -#### Type declaration - -▸ (`request`): `string` - -returns `basePath` value, specific for an incoming request. - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | - -##### Returns - -`string` - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:28 - -___ - -### prepend - -• **prepend**: (`path`: `string`) => `string` - -#### Type declaration - -▸ (`path`): `string` - -Prepends `path` with the basePath. - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `path` | `string` | - -##### Returns - -`string` - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:38 - -___ - -### publicBaseUrl - -• `Optional` `Readonly` **publicBaseUrl**: `string` - -The server's publicly exposed base URL, if configured. Includes protocol, host, port (optional) and the -[BasePath.serverBasePath](client._internal_namespace.BasePath.md#serverbasepath). - -**`remarks`** -Should be used for generating external URL links back to this Kibana instance. - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:22 - -___ - -### remove - -• **remove**: (`path`: `string`) => `string` - -#### Type declaration - -▸ (`path`): `string` - -Removes the prepended basePath from the `path`. - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `path` | `string` | - -##### Returns - -`string` - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:42 - -___ - -### serverBasePath - -• `Readonly` **serverBasePath**: `string` - -returns the server's basePath - -See [BasePath.get](client._internal_namespace.BasePath.md#get) for getting the basePath value for a specific request - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:14 - -___ - -### set - -• **set**: (`request`: [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\>, `requestSpecificBasePath`: `string`) => `void` - -#### Type declaration - -▸ (`request`, `requestSpecificBasePath`): `void` - -sets `basePath` value, specific for an incoming request. - -**`privateremarks`** should work only for KibanaRequest as soon as spaces migrate to NP - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | -| `requestSpecificBasePath` | `string` | - -##### Returns - -`void` - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:34 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.BuilderFactory.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.BuilderFactory.md deleted file mode 100644 index a6f48bc77918b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.BuilderFactory.md +++ /dev/null @@ -1,47 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BuilderFactory - -# Class: BuilderFactory - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BuilderFactory - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.BuilderFactory.md#constructor) - -### Methods - -- [getBuilder](client._internal_namespace.BuilderFactory.md#getbuilder) - -## Constructors - -### constructor - -• **new BuilderFactory**() - -## Methods - -### getBuilder - -▸ **getBuilder**<`T`\>(`type`): `undefined` \| [`UserActionBuilder`](client._internal_namespace.UserActionBuilder.md) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | extends ``"description"`` \| ``"tags"`` \| ``"title"`` \| ``"connector"`` \| ``"settings"`` \| ``"status"`` \| ``"comment"`` \| ``"pushed"`` \| ``"create_case"`` \| ``"delete_case"`` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `T` | - -#### Returns - -`undefined` \| [`UserActionBuilder`](client._internal_namespace.UserActionBuilder.md) - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/builder_factory.ts:35](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/builder_factory.ts#L35) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CaseConfigureService.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CaseConfigureService.md deleted file mode 100644 index bf61548e826ce..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CaseConfigureService.md +++ /dev/null @@ -1,135 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CaseConfigureService - -# Class: CaseConfigureService - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CaseConfigureService - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.CaseConfigureService.md#constructor) - -### Methods - -- [delete](client._internal_namespace.CaseConfigureService.md#delete) -- [find](client._internal_namespace.CaseConfigureService.md#find) -- [get](client._internal_namespace.CaseConfigureService.md#get) -- [patch](client._internal_namespace.CaseConfigureService.md#patch) -- [post](client._internal_namespace.CaseConfigureService.md#post) - -## Constructors - -### constructor - -• **new CaseConfigureService**(`log`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `log` | `Logger` | - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:52](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L52) - -## Methods - -### delete - -▸ **delete**(`__namedParameters`): `Promise`<{}\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetCaseConfigureArgs`](../interfaces/client._internal_namespace.GetCaseConfigureArgs.md) | - -#### Returns - -`Promise`<{}\> - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:54](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L54) - -___ - -### find - -▸ **find**(`__namedParameters`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`FindCaseConfigureArgs`](../interfaces/client._internal_namespace.FindCaseConfigureArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, `unknown`\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:82](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L82) - -___ - -### get - -▸ **get**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetCaseConfigureArgs`](../interfaces/client._internal_namespace.GetCaseConfigureArgs.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:64](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L64) - -___ - -### patch - -▸ **patch**(`__namedParameters`): `Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `closure_type`: `undefined` \| ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: `undefined` \| { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } = CaseConnectorRt } & { `version`: `string` = rt.string }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`PatchCaseConfigureArgs`](../interfaces/client._internal_namespace.PatchCaseConfigureArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `closure_type`: `undefined` \| ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: `undefined` \| { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } = CaseConnectorRt } & { `version`: `string` = rt.string }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:125](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L125) - -___ - -### post - -▸ **post**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`PostCaseConfigureArgs`](../interfaces/client._internal_namespace.PostCaseConfigureArgs.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:104](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L104) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CaseUserActionService.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CaseUserActionService.md deleted file mode 100644 index ed34d0f5389b7..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CaseUserActionService.md +++ /dev/null @@ -1,304 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CaseUserActionService - -# Class: CaseUserActionService - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CaseUserActionService - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.CaseUserActionService.md#constructor) - -### Properties - -- [builderFactory](client._internal_namespace.CaseUserActionService.md#builderfactory) -- [userActionFieldsAllowed](client._internal_namespace.CaseUserActionService.md#useractionfieldsallowed) - -### Methods - -- [buildCountConnectorsAggs](client._internal_namespace.CaseUserActionService.md#buildcountconnectorsaggs) -- [bulkCreate](client._internal_namespace.CaseUserActionService.md#bulkcreate) -- [bulkCreateAttachmentDeletion](client._internal_namespace.CaseUserActionService.md#bulkcreateattachmentdeletion) -- [bulkCreateCaseDeletion](client._internal_namespace.CaseUserActionService.md#bulkcreatecasedeletion) -- [bulkCreateUpdateCase](client._internal_namespace.CaseUserActionService.md#bulkcreateupdatecase) -- [create](client._internal_namespace.CaseUserActionService.md#create) -- [createUserAction](client._internal_namespace.CaseUserActionService.md#createuseraction) -- [findStatusChanges](client._internal_namespace.CaseUserActionService.md#findstatuschanges) -- [getAll](client._internal_namespace.CaseUserActionService.md#getall) -- [getUniqueConnectors](client._internal_namespace.CaseUserActionService.md#getuniqueconnectors) -- [getUserActionItemByDifference](client._internal_namespace.CaseUserActionService.md#getuseractionitembydifference) - -## Constructors - -### constructor - -• **new CaseUserActionService**(`log`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `log` | `Logger` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:106](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L106) - -## Properties - -### builderFactory - -• `Private` `Readonly` **builderFactory**: [`BuilderFactory`](client._internal_namespace.BuilderFactory.md) - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:104](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L104) - -___ - -### userActionFieldsAllowed - -▪ `Static` `Private` `Readonly` **userActionFieldsAllowed**: `Set`<`string`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:102](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L102) - -## Methods - -### buildCountConnectorsAggs - -▸ `Private` **buildCountConnectorsAggs**(`size?`): `Record`<`string`, `AggregationsAggregationContainer`\> - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `size` | `number` | `100` | - -#### Returns - -`Record`<`string`, `AggregationsAggregationContainer`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:470](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L470) - -___ - -### bulkCreate - -▸ **bulkCreate**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`PostCaseUserActionArgs`](../interfaces/client._internal_namespace.PostCaseUserActionArgs.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:352](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L352) - -___ - -### bulkCreateAttachmentDeletion - -▸ **bulkCreateAttachmentDeletion**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`BulkCreateAttachmentDeletionUserAction`](../interfaces/client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:244](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L244) - -___ - -### bulkCreateCaseDeletion - -▸ **bulkCreateCaseDeletion**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`BulkCreateCaseDeletionUserAction`](../interfaces/client._internal_namespace.BulkCreateCaseDeletionUserAction.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:171](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L171) - -___ - -### bulkCreateUpdateCase - -▸ **bulkCreateUpdateCase**(`__namedParameters`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`BulkCreateBulkUpdateCaseUserActions`](../interfaces/client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:198](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L198) - -___ - -### create - -▸ **create**<`T`\>(`__namedParameters`): `Promise`<`void`\> - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CreateUserActionES`](../interfaces/client._internal_namespace.CreateUserActionES.md)<`T`\> | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:335](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L335) - -___ - -### createUserAction - -▸ **createUserAction**<`T`\>(`__namedParameters`): `Promise`<`void`\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | extends keyof [`BuilderParameters`](../interfaces/client._internal_namespace.BuilderParameters.md) | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CreateUserActionClient`](../modules/client._internal_namespace.md#createuseractionclient)<`T`\> | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:275](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L275) - -___ - -### findStatusChanges - -▸ **findStatusChanges**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `payload`: { description: string; } = DescriptionUserActionPayloadRt; `type`: ``"description"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { comment: { comment: string; type: CommentType.user; owner: string; } \| { type: CommentType.alert; alertId: string \| string[]; index: string \| string[]; rule: { id: string \| null; name: string \| null; }; owner: string; } \| { ...; }; } = CommentUserActionPayloadRt; `type`: ``"comment"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { tags: string[]; } = TagsUserActionPayloadRt; `type`: ``"tags"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { title: string; } = TitleUserActionPayloadRt; `type`: ``"title"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { settings: { syncAlerts: boolean; }; } = SettingsUserActionPayloadRt; `type`: ``"settings"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { status: CaseStatuses; } = StatusUserActionPayloadRt; `type`: ``"status"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `type`: ``"create_case"`` } & { `payload`: { connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; }) \| ... 4 more ... \| ({ ...; } & { ...; })); } & { description: string; status: string; tags: string[]; title: string; settings: { syncAlerts: boolean; }; owner: string; } } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; }) \| ... 4 more ... \| ({ ...; } & { ...; })); } = ConnectorUserActionPayloadRt; `type`: ``"connector"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { externalService: { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| ... 1 more ... \| undefined; username: string \| ... 1 more ... \| undefined; }; }; } = PushedUserActionPayloadRt; `type`: ``"pushed"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: {} ; `type`: ``"delete_case"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` }\>[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.caseId` | `string` | -| `__namedParameters.filter?` | `KueryNode` | -| `__namedParameters.unsecuredSavedObjectsClient` | [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `payload`: { description: string; } = DescriptionUserActionPayloadRt; `type`: ``"description"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { comment: { comment: string; type: CommentType.user; owner: string; } \| { type: CommentType.alert; alertId: string \| string[]; index: string \| string[]; rule: { id: string \| null; name: string \| null; }; owner: string; } \| { ...; }; } = CommentUserActionPayloadRt; `type`: ``"comment"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { tags: string[]; } = TagsUserActionPayloadRt; `type`: ``"tags"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { title: string; } = TitleUserActionPayloadRt; `type`: ``"title"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { settings: { syncAlerts: boolean; }; } = SettingsUserActionPayloadRt; `type`: ``"settings"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { status: CaseStatuses; } = StatusUserActionPayloadRt; `type`: ``"status"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `type`: ``"create_case"`` } & { `payload`: { connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; }) \| ... 4 more ... \| ({ ...; } & { ...; })); } & { description: string; status: string; tags: string[]; title: string; settings: { syncAlerts: boolean; }; owner: string; } } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; }) \| ... 4 more ... \| ({ ...; } & { ...; })); } = ConnectorUserActionPayloadRt; `type`: ``"connector"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { externalService: { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| ... 1 more ... \| undefined; username: string \| ... 1 more ... \| undefined; }; }; } = PushedUserActionPayloadRt; `type`: ``"pushed"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: {} ; `type`: ``"delete_case"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` }\>[]\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:372](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L372) - -___ - -### getAll - -▸ **getAll**(`__namedParameters`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `payload`: { description: string; } = DescriptionUserActionPayloadRt; `type`: ``"description"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { comment: { comment: string; type: CommentType.user; owner: string; } \| { type: CommentType.alert; alertId: string \| string[]; index: string \| string[]; rule: { id: string \| null; name: string \| null; }; owner: string; } \| { ...; }; } = CommentUserActionPayloadRt; `type`: ``"comment"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { tags: string[]; } = TagsUserActionPayloadRt; `type`: ``"tags"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { title: string; } = TitleUserActionPayloadRt; `type`: ``"title"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { settings: { syncAlerts: boolean; }; } = SettingsUserActionPayloadRt; `type`: ``"settings"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { status: CaseStatuses; } = StatusUserActionPayloadRt; `type`: ``"status"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `type`: ``"create_case"`` } & { `payload`: { connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; }) \| ... 4 more ... \| ({ ...; } & { ...; })); } & { description: string; status: string; tags: string[]; title: string; settings: { syncAlerts: boolean; }; owner: string; } } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; }) \| ... 4 more ... \| ({ ...; } & { ...; })); } = ConnectorUserActionPayloadRt; `type`: ``"connector"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { externalService: { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| ... 1 more ... \| undefined; username: string \| ... 1 more ... \| undefined; }; }; } = PushedUserActionPayloadRt; `type`: ``"pushed"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: {} ; `type`: ``"delete_case"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` }, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetCaseUserActionArgs`](../interfaces/client._internal_namespace.GetCaseUserActionArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `payload`: { description: string; } = DescriptionUserActionPayloadRt; `type`: ``"description"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { comment: { comment: string; type: CommentType.user; owner: string; } \| { type: CommentType.alert; alertId: string \| string[]; index: string \| string[]; rule: { id: string \| null; name: string \| null; }; owner: string; } \| { ...; }; } = CommentUserActionPayloadRt; `type`: ``"comment"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { tags: string[]; } = TagsUserActionPayloadRt; `type`: ``"tags"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { title: string; } = TitleUserActionPayloadRt; `type`: ``"title"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { settings: { syncAlerts: boolean; }; } = SettingsUserActionPayloadRt; `type`: ``"settings"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { status: CaseStatuses; } = StatusUserActionPayloadRt; `type`: ``"status"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `type`: ``"create_case"`` } & { `payload`: { connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; }) \| ... 4 more ... \| ({ ...; } & { ...; })); } & { description: string; status: string; tags: string[]; title: string; settings: { syncAlerts: boolean; }; owner: string; } } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; }) \| ... 4 more ... \| ({ ...; } & { ...; })); } = ConnectorUserActionPayloadRt; `type`: ``"connector"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: { externalService: { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| ... 1 more ... \| undefined; username: string \| ... 1 more ... \| undefined; }; }; } = PushedUserActionPayloadRt; `type`: ``"pushed"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` } & { `payload`: {} ; `type`: ``"delete_case"`` } & { `action`: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` = ActionsRt; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string } & { `action_id`: `string` = rt.string; `case_id`: `string` = rt.string; `comment_id`: ``null`` \| `string` }, `unknown`\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:310](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L310) - -___ - -### getUniqueConnectors - -▸ **getUniqueConnectors**(`__namedParameters`): `Promise`<{ `id`: `string` }[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.caseId` | `string` | -| `__namedParameters.filter?` | `KueryNode` | -| `__namedParameters.unsecuredSavedObjectsClient` | [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) | - -#### Returns - -`Promise`<{ `id`: `string` }[]\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:426](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L426) - -___ - -### getUserActionItemByDifference - -▸ `Private` **getUserActionItemByDifference**(`__namedParameters`): [`BuilderReturnValue`](../interfaces/client._internal_namespace.BuilderReturnValue.md)[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetUserActionItemByDifference`](../interfaces/client._internal_namespace.GetUserActionItemByDifference.md) | - -#### Returns - -[`BuilderReturnValue`](../interfaces/client._internal_namespace.BuilderReturnValue.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:108](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L108) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesActions.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesActions.md deleted file mode 100644 index 40c474c66fc37..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesActions.md +++ /dev/null @@ -1,66 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CasesActions - -# Class: CasesActions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CasesActions - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.CasesActions.md#constructor) - -### Properties - -- [prefix](client._internal_namespace.CasesActions.md#prefix) - -### Methods - -- [get](client._internal_namespace.CasesActions.md#get) - -## Constructors - -### constructor - -• **new CasesActions**(`versionNumber`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionNumber` | `string` | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/cases.d.ts:3 - -## Properties - -### prefix - -• `Private` `Readonly` **prefix**: `any` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/cases.d.ts:2 - -## Methods - -### get - -▸ **get**(`owner`, `operation`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `owner` | `string` | -| `operation` | `string` | - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/cases.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesClientInternal.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesClientInternal.md deleted file mode 100644 index 9a7fe6f6c11d5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesClientInternal.md +++ /dev/null @@ -1,59 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CasesClientInternal - -# Class: CasesClientInternal - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CasesClientInternal - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.CasesClientInternal.md#constructor) - -### Properties - -- [\_configuration](client._internal_namespace.CasesClientInternal.md#_configuration) - -### Accessors - -- [configuration](client._internal_namespace.CasesClientInternal.md#configuration) - -## Constructors - -### constructor - -• **new CasesClientInternal**(`args`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `args` | [`CasesClientArgs`](../interfaces/client._internal_namespace.CasesClientArgs.md) | - -#### Defined in - -[x-pack/plugins/cases/server/client/client_internal.ts:17](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client_internal.ts#L17) - -## Properties - -### \_configuration - -• `Private` `Readonly` **\_configuration**: `InternalConfigureSubClient` - -#### Defined in - -[x-pack/plugins/cases/server/client/client_internal.ts:15](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client_internal.ts#L15) - -## Accessors - -### configuration - -• `get` **configuration**(): `InternalConfigureSubClient` - -#### Returns - -`InternalConfigureSubClient` - -#### Defined in - -[x-pack/plugins/cases/server/client/client_internal.ts:21](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client_internal.ts#L21) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesService.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesService.md deleted file mode 100644 index eb31fa2722c15..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.CasesService.md +++ /dev/null @@ -1,470 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CasesService - -# Class: CasesService - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CasesService - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.CasesService.md#constructor) - -### Methods - -- [asArray](client._internal_namespace.CasesService.md#asarray) -- [buildCaseIdsAggs](client._internal_namespace.CasesService.md#buildcaseidsaggs) -- [deleteCase](client._internal_namespace.CasesService.md#deletecase) -- [findCaseStatusStats](client._internal_namespace.CasesService.md#findcasestatusstats) -- [findCases](client._internal_namespace.CasesService.md#findcases) -- [findCasesGroupedByID](client._internal_namespace.CasesService.md#findcasesgroupedbyid) -- [getAllCaseComments](client._internal_namespace.CasesService.md#getallcasecomments) -- [getAllComments](client._internal_namespace.CasesService.md#getallcomments) -- [getCase](client._internal_namespace.CasesService.md#getcase) -- [getCaseCommentStats](client._internal_namespace.CasesService.md#getcasecommentstats) -- [getCaseIdsByAlertId](client._internal_namespace.CasesService.md#getcaseidsbyalertid) -- [getCases](client._internal_namespace.CasesService.md#getcases) -- [getReporters](client._internal_namespace.CasesService.md#getreporters) -- [getResolveCase](client._internal_namespace.CasesService.md#getresolvecase) -- [getTags](client._internal_namespace.CasesService.md#gettags) -- [getUser](client._internal_namespace.CasesService.md#getuser) -- [patchCase](client._internal_namespace.CasesService.md#patchcase) -- [patchCases](client._internal_namespace.CasesService.md#patchcases) -- [postNewCase](client._internal_namespace.CasesService.md#postnewcase) -- [getCaseIDsFromAlertAggs](client._internal_namespace.CasesService.md#getcaseidsfromalertaggs) - -## Constructors - -### constructor - -• **new CasesService**(`log`, `authentication?`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `log` | `Logger` | -| `authentication?` | `Object` | -| `authentication.getCurrentUser` | (`request`: [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\>) => ``null`` \| [`AuthenticatedUser`](../interfaces/client._internal_namespace.AuthenticatedUser.md) | - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:138](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L138) - -## Methods - -### asArray - -▸ `Private` **asArray**(`id`): `string`[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | `undefined` \| `string` \| `string`[] | - -#### Returns - -`string`[] - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:413](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L413) - -___ - -### buildCaseIdsAggs - -▸ `Private` **buildCaseIdsAggs**(`size?`): `Record`<`string`, `AggregationsAggregationContainer`\> - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `size` | `number` | `100` | - -#### Returns - -`Record`<`string`, `AggregationsAggregationContainer`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:143](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L143) - -___ - -### deleteCase - -▸ **deleteCase**(`__namedParameters`): `Promise`<{}\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetCaseArgs`](../interfaces/client._internal_namespace.GetCaseArgs.md) | - -#### Returns - -`Promise`<{}\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:332](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L332) - -___ - -### findCaseStatusStats - -▸ **findCaseStatusStats**(`__namedParameters`): `Promise`<`number`\> - -Retrieves the number of cases that exist with a given status (open, closed, etc). - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.caseOptions` | [`SavedObjectFindOptionsKueryNode`](../modules/client._internal_namespace.md#savedobjectfindoptionskuerynode) | -| `__namedParameters.ensureSavedObjectsAreAuthorized` | [`EnsureSOAuthCallback`](../modules/client._internal_namespace.md#ensuresoauthcallback) | -| `__namedParameters.unsecuredSavedObjectsClient` | [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) | - -#### Returns - -`Promise`<`number`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:251](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L251) - -___ - -### findCases - -▸ **findCases**(`__namedParameters`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`FindCasesArgs`](../interfaces/client._internal_namespace.FindCasesArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, `unknown`\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:395](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L395) - -___ - -### findCasesGroupedByID - -▸ **findCasesGroupedByID**(`__namedParameters`): `Promise`<[`CasesMapWithPageInfo`](../interfaces/client._internal_namespace.CasesMapWithPageInfo.md)\> - -Returns a map of all cases. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.caseOptions` | [`FindCaseOptions`](../modules/client._internal_namespace.md#findcaseoptions) | -| `__namedParameters.unsecuredSavedObjectsClient` | [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) | - -#### Returns - -`Promise`<[`CasesMapWithPageInfo`](../interfaces/client._internal_namespace.CasesMapWithPageInfo.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:206](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L206) - -___ - -### getAllCaseComments - -▸ **getAllCaseComments**(`__namedParameters`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, `unknown`\>\> - -Default behavior is to retrieve all comments that adhere to a given filter (if one is included). -to override this pass in the either the page or perPage options. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`FindCaseCommentsArgs`](../interfaces/client._internal_namespace.FindCaseCommentsArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, `unknown`\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:455](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L455) - -___ - -### getAllComments - -▸ `Private` **getAllComments**(`__namedParameters`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`FindCommentsArgs`](../interfaces/client._internal_namespace.FindCommentsArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, `unknown`\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:423](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L423) - -___ - -### getCase - -▸ **getCase**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetCaseArgs`](../interfaces/client._internal_namespace.GetCaseArgs.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:342](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L342) - -___ - -### getCaseCommentStats - -▸ **getCaseCommentStats**(`__namedParameters`): `Promise`<[`CaseCommentStats`](../interfaces/client._internal_namespace.CaseCommentStats.md)\> - -Returns the number of total comments and alerts for a case - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.ids` | `string`[] | -| `__namedParameters.unsecuredSavedObjectsClient` | [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) | - -#### Returns - -`Promise`<[`CaseCommentStats`](../interfaces/client._internal_namespace.CaseCommentStats.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:280](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L280) - -___ - -### getCaseIdsByAlertId - -▸ **getCaseIdsByAlertId**(`__namedParameters`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, { `references`: { doc\_count: number; caseIds: { buckets: { key: string; }[]; }; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetCaseIdsByAlertIdArgs`](../interfaces/client._internal_namespace.GetCaseIdsByAlertIdArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, { `references`: { doc\_count: number; caseIds: { buckets: { key: string; }[]; }; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:161](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L161) - -___ - -### getCases - -▸ **getCases**(`__namedParameters`): `Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetCasesArgs`](../interfaces/client._internal_namespace.GetCasesArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:379](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L379) - -___ - -### getReporters - -▸ **getReporters**(`__namedParameters`): `Promise`<{ `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` }[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetReportersArgs`](../interfaces/client._internal_namespace.GetReportersArgs.md) | - -#### Returns - -`Promise`<{ `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` }[]\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:488](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L488) - -___ - -### getResolveCase - -▸ **getResolveCase**(`__namedParameters`): `Promise`<[`SavedObjectsResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsResolveResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetCaseArgs`](../interfaces/client._internal_namespace.GetCaseArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsResolveResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:359](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L359) - -___ - -### getTags - -▸ **getTags**(`__namedParameters`): `Promise`<`string`[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetTagsArgs`](../interfaces/client._internal_namespace.GetTagsArgs.md) | - -#### Returns - -`Promise`<`string`[]\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:552](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L552) - -___ - -### getUser - -▸ **getUser**(`__namedParameters`): [`AuthenticatedUser`](../interfaces/client._internal_namespace.AuthenticatedUser.md) \| { `email`: ``null`` = null; `full_name`: ``null`` = null; `username`: ``null`` = null } - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetUserArgs`](../interfaces/client._internal_namespace.GetUserArgs.md) | - -#### Returns - -[`AuthenticatedUser`](../interfaces/client._internal_namespace.AuthenticatedUser.md) \| { `email`: ``null`` = null; `full_name`: ``null`` = null; `username`: ``null`` = null } - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:582](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L582) - -___ - -### patchCase - -▸ **patchCase**(`__namedParameters`): `Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`PatchCaseArgs`](../modules/client._internal_namespace.md#patchcaseargs) | - -#### Returns - -`Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:627](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L627) - -___ - -### patchCases - -▸ **patchCases**(`__namedParameters`): `Promise`<[`SavedObjectsBulkUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`PatchCasesArgs`](../interfaces/client._internal_namespace.PatchCasesArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsBulkUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:655](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L655) - -___ - -### postNewCase - -▸ **postNewCase**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`PostCaseArgs`](../interfaces/client._internal_namespace.PostCaseArgs.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:607](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L607) - -___ - -### getCaseIDsFromAlertAggs - -▸ `Static` **getCaseIDsFromAlertAggs**(`result`): `string`[] - -Extracts the case IDs from the alert aggregation - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `result` | [`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }, { `references`: { doc\_count: number; caseIds: { buckets: { key: string; }[]; }; } }\> | - -#### Returns - -`string`[] - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:197](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L197) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ConnectorMappingsService.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ConnectorMappingsService.md deleted file mode 100644 index 2b6649eca4111..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ConnectorMappingsService.md +++ /dev/null @@ -1,93 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ConnectorMappingsService - -# Class: ConnectorMappingsService - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ConnectorMappingsService - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.ConnectorMappingsService.md#constructor) - -### Methods - -- [find](client._internal_namespace.ConnectorMappingsService.md#find) -- [post](client._internal_namespace.ConnectorMappingsService.md#post) -- [update](client._internal_namespace.ConnectorMappingsService.md#update) - -## Constructors - -### constructor - -• **new ConnectorMappingsService**(`log`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `log` | `Logger` | - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:33](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L33) - -## Methods - -### find - -▸ **find**(`__namedParameters`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `mappings`: { action\_type: "append" \| "nothing" \| "overwrite"; source: "description" \| "title" \| "comments"; target: string; }[] ; `owner`: `string` = rt.string }, `unknown`\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`FindConnectorMappingsArgs`](../interfaces/client._internal_namespace.FindConnectorMappingsArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<{ `mappings`: { action\_type: "append" \| "nothing" \| "overwrite"; source: "description" \| "title" \| "comments"; target: string; }[] ; `owner`: `string` = rt.string }, `unknown`\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:35](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L35) - -___ - -### post - -▸ **post**(`__namedParameters`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `mappings`: { action\_type: "append" \| "nothing" \| "overwrite"; source: "description" \| "title" \| "comments"; target: string; }[] ; `owner`: `string` = rt.string }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`PostConnectorMappingsArgs`](../interfaces/client._internal_namespace.PostConnectorMappingsArgs.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<{ `mappings`: { action\_type: "append" \| "nothing" \| "overwrite"; source: "description" \| "title" \| "comments"; target: string; }[] ; `owner`: `string` = rt.string }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:48](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L48) - -___ - -### update - -▸ **update**(`__namedParameters`): `Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `mappings`: { action\_type: "append" \| "nothing" \| "overwrite"; source: "description" \| "title" \| "comments"; target: string; }[] ; `owner`: `string` = rt.string }\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`UpdateConnectorMappingsArgs`](../interfaces/client._internal_namespace.UpdateConnectorMappingsArgs.md) | - -#### Returns - -`Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `mappings`: { action\_type: "append" \| "nothing" \| "overwrite"; source: "description" \| "title" \| "comments"; target: string; }[] ; `owner`: `string` = rt.string }\>\> - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:68](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L68) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ConnectorTokenClient.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ConnectorTokenClient.md deleted file mode 100644 index 7e2a19e11efbe..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ConnectorTokenClient.md +++ /dev/null @@ -1,162 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ConnectorTokenClient - -# Class: ConnectorTokenClient - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ConnectorTokenClient - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.ConnectorTokenClient.md#constructor) - -### Properties - -- [encryptedSavedObjectsClient](client._internal_namespace.ConnectorTokenClient.md#encryptedsavedobjectsclient) -- [logger](client._internal_namespace.ConnectorTokenClient.md#logger) -- [unsecuredSavedObjectsClient](client._internal_namespace.ConnectorTokenClient.md#unsecuredsavedobjectsclient) - -### Methods - -- [create](client._internal_namespace.ConnectorTokenClient.md#create) -- [deleteConnectorTokens](client._internal_namespace.ConnectorTokenClient.md#deleteconnectortokens) -- [get](client._internal_namespace.ConnectorTokenClient.md#get) -- [update](client._internal_namespace.ConnectorTokenClient.md#update) - -## Constructors - -### constructor - -• **new ConnectorTokenClient**(`__namedParameters`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`ConstructorOptions`](../interfaces/client._internal_namespace.ConstructorOptions-2.md) | - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:26 - -## Properties - -### encryptedSavedObjectsClient - -• `Private` `Readonly` **encryptedSavedObjectsClient**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:25 - -___ - -### logger - -• `Private` `Readonly` **logger**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:23 - -___ - -### unsecuredSavedObjectsClient - -• `Private` `Readonly` **unsecuredSavedObjectsClient**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:24 - -## Methods - -### create - -▸ **create**(`__namedParameters`): `Promise`<[`ConnectorToken`](../interfaces/client._internal_namespace.ConnectorToken.md)\> - -Create new token for connector - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CreateOptions`](../interfaces/client._internal_namespace.CreateOptions-1.md) | - -#### Returns - -`Promise`<[`ConnectorToken`](../interfaces/client._internal_namespace.ConnectorToken.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:30 - -___ - -### deleteConnectorTokens - -▸ **deleteConnectorTokens**(`__namedParameters`): `Promise`<{}[]\> - -Delete all connector tokens - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.connectorId` | `string` | -| `__namedParameters.tokenType?` | `string` | - -#### Returns - -`Promise`<{}[]\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:48 - -___ - -### get - -▸ **get**(`__namedParameters`): `Promise`<{ `connectorToken`: ``null`` \| [`ConnectorToken`](../interfaces/client._internal_namespace.ConnectorToken.md) ; `hasErrors`: `boolean` }\> - -Get connector token - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.connectorId` | `string` | -| `__namedParameters.tokenType?` | `string` | - -#### Returns - -`Promise`<{ `connectorToken`: ``null`` \| [`ConnectorToken`](../interfaces/client._internal_namespace.ConnectorToken.md) ; `hasErrors`: `boolean` }\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:38 - -___ - -### update - -▸ **update**(`__namedParameters`): `Promise`<``null`` \| [`ConnectorToken`](../interfaces/client._internal_namespace.ConnectorToken.md)\> - -Update connector token - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`UpdateOptions`](../interfaces/client._internal_namespace.UpdateOptions-1.md) | - -#### Returns - -`Promise`<``null`` \| [`ConnectorToken`](../interfaces/client._internal_namespace.ConnectorToken.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:34 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ElasticsearchFeature.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ElasticsearchFeature.md deleted file mode 100644 index 95ffabe03d983..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.ElasticsearchFeature.md +++ /dev/null @@ -1,122 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ElasticsearchFeature - -# Class: ElasticsearchFeature - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ElasticsearchFeature - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.ElasticsearchFeature.md#constructor) - -### Properties - -- [config](client._internal_namespace.ElasticsearchFeature.md#config) - -### Accessors - -- [catalogue](client._internal_namespace.ElasticsearchFeature.md#catalogue) -- [id](client._internal_namespace.ElasticsearchFeature.md#id) -- [management](client._internal_namespace.ElasticsearchFeature.md#management) -- [privileges](client._internal_namespace.ElasticsearchFeature.md#privileges) - -### Methods - -- [toRaw](client._internal_namespace.ElasticsearchFeature.md#toraw) - -## Constructors - -### constructor - -• **new ElasticsearchFeature**(`config`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `config` | `Readonly`<{ `catalogue?`: `RecursiveReadonlyArray`<`string`\> ; `id`: `string` ; `management?`: `Readonly`<{ [x: string]: RecursiveReadonlyArray; }\> ; `privileges`: `RecursiveReadonlyArray`<[`FeatureElasticsearchPrivileges`](../interfaces/client._internal_namespace.FeatureElasticsearchPrivileges.md)\> }\> | - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:54 - -## Properties - -### config - -• `Protected` `Readonly` **config**: `Readonly`<{ `catalogue?`: `RecursiveReadonlyArray`<`string`\> ; `id`: `string` ; `management?`: `Readonly`<{ [x: string]: RecursiveReadonlyArray; }\> ; `privileges`: `RecursiveReadonlyArray`<[`FeatureElasticsearchPrivileges`](../interfaces/client._internal_namespace.FeatureElasticsearchPrivileges.md)\> }\> - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:53 - -## Accessors - -### catalogue - -• `get` **catalogue**(): `undefined` \| `RecursiveReadonlyArray`<`string`\> - -#### Returns - -`undefined` \| `RecursiveReadonlyArray`<`string`\> - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:56 - -___ - -### id - -• `get` **id**(): `string` - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:55 - -___ - -### management - -• `get` **management**(): `undefined` \| `Readonly`<{ [x: string]: `RecursiveReadonlyArray`; }\> - -#### Returns - -`undefined` \| `Readonly`<{ [x: string]: `RecursiveReadonlyArray`; }\> - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:57 - -___ - -### privileges - -• `get` **privileges**(): `RecursiveReadonlyArray`<[`FeatureElasticsearchPrivileges`](../interfaces/client._internal_namespace.FeatureElasticsearchPrivileges.md)\> - -#### Returns - -`RecursiveReadonlyArray`<[`FeatureElasticsearchPrivileges`](../interfaces/client._internal_namespace.FeatureElasticsearchPrivileges.md)\> - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:60 - -## Methods - -### toRaw - -▸ **toRaw**(): [`ElasticsearchFeatureConfig`](../interfaces/client._internal_namespace.ElasticsearchFeatureConfig.md) - -#### Returns - -[`ElasticsearchFeatureConfig`](../interfaces/client._internal_namespace.ElasticsearchFeatureConfig.md) - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:61 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaFeature.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaFeature.md deleted file mode 100644 index 88e1f958de6dc..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaFeature.md +++ /dev/null @@ -1,268 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / KibanaFeature - -# Class: KibanaFeature - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).KibanaFeature - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.KibanaFeature.md#constructor) - -### Properties - -- [config](client._internal_namespace.KibanaFeature.md#config) -- [subFeatures](client._internal_namespace.KibanaFeature.md#subfeatures) - -### Accessors - -- [alerting](client._internal_namespace.KibanaFeature.md#alerting) -- [app](client._internal_namespace.KibanaFeature.md#app) -- [cases](client._internal_namespace.KibanaFeature.md#cases) -- [catalogue](client._internal_namespace.KibanaFeature.md#catalogue) -- [category](client._internal_namespace.KibanaFeature.md#category) -- [excludeFromBasePrivileges](client._internal_namespace.KibanaFeature.md#excludefrombaseprivileges) -- [id](client._internal_namespace.KibanaFeature.md#id) -- [management](client._internal_namespace.KibanaFeature.md#management) -- [minimumLicense](client._internal_namespace.KibanaFeature.md#minimumlicense) -- [name](client._internal_namespace.KibanaFeature.md#name) -- [order](client._internal_namespace.KibanaFeature.md#order) -- [privileges](client._internal_namespace.KibanaFeature.md#privileges) -- [reserved](client._internal_namespace.KibanaFeature.md#reserved) - -### Methods - -- [toRaw](client._internal_namespace.KibanaFeature.md#toraw) - -## Constructors - -### constructor - -• **new KibanaFeature**(`config`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `config` | `Readonly`<{ `alerting?`: readonly `string`[] ; `app`: readonly `string`[] ; `cases?`: readonly `string`[] ; `catalogue?`: readonly `string`[] ; `category`: `Readonly`<{ id: string; label: string; ariaLabel?: string \| undefined; order?: number \| undefined; euiIconType?: string \| undefined; }\> ; `excludeFromBasePrivileges?`: `boolean` ; `id`: `string` ; `management?`: `Readonly`<{ [x: string]: readonly string[]; }\> ; `minimumLicense?`: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` ; `name`: `string` ; `order?`: `number` ; `privileges`: ``null`` \| `Readonly`<{ all: Readonly<{ excludeFromBasePrivileges?: boolean \| undefined; requireAllSpaces?: boolean \| undefined; disabled?: boolean \| undefined; management?: Readonly<{ [x: string]: readonly string[]; }\> \| undefined; ... 6 more ...; ui: readonly string[]; }\>; read: Readonly<...\>; }\> ; `privilegesTooltip?`: `string` ; `reserved?`: `Readonly`<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean \| undefined; requireAllSpaces?: boolean \| undefined; disabled?: boolean \| undefined; ... 7 more ...; ui: readonly string[]; }\>; }\>[]; }\> ; `subFeatures?`: readonly `Readonly`<{ name: string; privilegeGroups: readonly Readonly<{ groupType: SubFeaturePrivilegeGroupType; privileges: readonly Readonly<{ id: string; name: string; includeIn: "all" \| "none" \| "read"; ... 10 more ...; ui: readonly string[]; }\>[]; }\>[]; }\>[] }\> | - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:123 - -## Properties - -### config - -• `Protected` `Readonly` **config**: `Readonly`<{ `alerting?`: readonly `string`[] ; `app`: readonly `string`[] ; `cases?`: readonly `string`[] ; `catalogue?`: readonly `string`[] ; `category`: `Readonly`<{ id: string; label: string; ariaLabel?: string \| undefined; order?: number \| undefined; euiIconType?: string \| undefined; }\> ; `excludeFromBasePrivileges?`: `boolean` ; `id`: `string` ; `management?`: `Readonly`<{ [x: string]: readonly string[]; }\> ; `minimumLicense?`: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` ; `name`: `string` ; `order?`: `number` ; `privileges`: ``null`` \| `Readonly`<{ all: Readonly<{ excludeFromBasePrivileges?: boolean \| undefined; requireAllSpaces?: boolean \| undefined; disabled?: boolean \| undefined; management?: Readonly<{ [x: string]: readonly string[]; }\> \| undefined; ... 6 more ...; ui: readonly string[]; }\>; read: Readonly<...\>; }\> ; `privilegesTooltip?`: `string` ; `reserved?`: `Readonly`<{ description: string; privileges: readonly Readonly<{ id: string; privilege: Readonly<{ excludeFromBasePrivileges?: boolean \| undefined; requireAllSpaces?: boolean \| undefined; disabled?: boolean \| undefined; ... 7 more ...; ui: readonly string[]; }\>; }\>[]; }\> ; `subFeatures?`: readonly `Readonly`<{ name: string; privilegeGroups: readonly Readonly<{ groupType: SubFeaturePrivilegeGroupType; privileges: readonly Readonly<{ id: string; name: string; includeIn: "all" \| "none" \| "read"; ... 10 more ...; ui: readonly string[]; }\>[]; }\>[]; }\>[] }\> - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:121 - -___ - -### subFeatures - -• `Readonly` **subFeatures**: [`SubFeature`](client._internal_namespace.SubFeature.md)[] - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:122 - -## Accessors - -### alerting - -• `get` **alerting**(): `undefined` \| readonly `string`[] - -#### Returns - -`undefined` \| readonly `string`[] - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:202 - -___ - -### app - -• `get` **app**(): readonly `string`[] - -#### Returns - -readonly `string`[] - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:134 - -___ - -### cases - -• `get` **cases**(): `undefined` \| readonly `string`[] - -#### Returns - -`undefined` \| readonly `string`[] - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:203 - -___ - -### catalogue - -• `get` **catalogue**(): `undefined` \| readonly `string`[] - -#### Returns - -`undefined` \| readonly `string`[] - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:135 - -___ - -### category - -• `get` **category**(): `Readonly`<{ `ariaLabel?`: `string` ; `euiIconType?`: `string` ; `id`: `string` ; `label`: `string` ; `order?`: `number` }\> - -#### Returns - -`Readonly`<{ `ariaLabel?`: `string` ; `euiIconType?`: `string` ; `id`: `string` ; `label`: `string` ; `order?`: `number` }\> - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:127 - -___ - -### excludeFromBasePrivileges - -• `get` **excludeFromBasePrivileges**(): `boolean` - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:204 - -___ - -### id - -• `get` **id**(): `string` - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:124 - -___ - -### management - -• `get` **management**(): `undefined` \| `Readonly`<{ [x: string]: readonly `string`[]; }\> - -#### Returns - -`undefined` \| `Readonly`<{ [x: string]: readonly `string`[]; }\> - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:136 - -___ - -### minimumLicense - -• `get` **minimumLicense**(): `undefined` \| ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -#### Returns - -`undefined` \| ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:139 - -___ - -### name - -• `get` **name**(): `string` - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:125 - -___ - -### order - -• `get` **order**(): `undefined` \| `number` - -#### Returns - -`undefined` \| `number` - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:126 - -___ - -### privileges - -• `get` **privileges**(): ``null`` \| `Readonly`<{ `all`: `Readonly`<{ `alerting?`: `Readonly`<{ `alert?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> ; `rule?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> }\> ; `api?`: readonly `string`[] ; `app?`: readonly `string`[] ; `cases?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> ; `catalogue?`: readonly `string`[] ; `disabled?`: `boolean` ; `excludeFromBasePrivileges?`: `boolean` ; `management?`: `Readonly`<{ [x: string]: readonly `string`[]; }\> ; `requireAllSpaces?`: `boolean` ; `savedObject`: `Readonly`<{ `all`: readonly `string`[] ; `read`: readonly `string`[] }\> ; `ui`: readonly `string`[] }\> ; `read`: `Readonly`<{ `alerting?`: `Readonly`<{ `alert?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> ; `rule?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> }\> ; `api?`: readonly `string`[] ; `app?`: readonly `string`[] ; `cases?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> ; `catalogue?`: readonly `string`[] ; `disabled?`: `boolean` ; `excludeFromBasePrivileges?`: `boolean` ; `management?`: `Readonly`<{ [x: string]: readonly `string`[]; }\> ; `requireAllSpaces?`: `boolean` ; `savedObject`: `Readonly`<{ `all`: readonly `string`[] ; `read`: readonly `string`[] }\> ; `ui`: readonly `string`[] }\> }\> - -#### Returns - -``null`` \| `Readonly`<{ `all`: `Readonly`<{ `alerting?`: `Readonly`<{ `alert?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> ; `rule?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> }\> ; `api?`: readonly `string`[] ; `app?`: readonly `string`[] ; `cases?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> ; `catalogue?`: readonly `string`[] ; `disabled?`: `boolean` ; `excludeFromBasePrivileges?`: `boolean` ; `management?`: `Readonly`<{ [x: string]: readonly `string`[]; }\> ; `requireAllSpaces?`: `boolean` ; `savedObject`: `Readonly`<{ `all`: readonly `string`[] ; `read`: readonly `string`[] }\> ; `ui`: readonly `string`[] }\> ; `read`: `Readonly`<{ `alerting?`: `Readonly`<{ `alert?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> ; `rule?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> }\> ; `api?`: readonly `string`[] ; `app?`: readonly `string`[] ; `cases?`: `Readonly`<{ `all?`: readonly `string`[] ; `read?`: readonly `string`[] }\> ; `catalogue?`: readonly `string`[] ; `disabled?`: `boolean` ; `excludeFromBasePrivileges?`: `boolean` ; `management?`: `Readonly`<{ [x: string]: readonly `string`[]; }\> ; `requireAllSpaces?`: `boolean` ; `savedObject`: `Readonly`<{ `all`: readonly `string`[] ; `read`: readonly `string`[] }\> ; `ui`: readonly `string`[] }\> }\> - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:140 - -___ - -### reserved - -• `get` **reserved**(): `undefined` \| `Readonly`<{ `description`: `string` ; `privileges`: readonly `Readonly`<{ `id`: `string` ; `privilege`: `Readonly`<{ `alerting?`: `Readonly`<{ `alert?`: `Readonly`<{ `all?`: readonly string[] ; `read?`: readonly string[] }\> ; `rule?`: `Readonly`<{ `all?`: readonly string[] ; `read?`: readonly string[] }\> }\> ; `api?`: readonly string[] ; `app?`: readonly string[] ; `cases?`: `Readonly`<{ `all?`: readonly string[] ; `read?`: readonly string[] }\> ; `catalogue?`: readonly string[] ; `disabled?`: `boolean` ; `excludeFromBasePrivileges?`: `boolean` ; `management?`: `Readonly`<{ [x: string]: readonly `string`[]; }\> ; `requireAllSpaces?`: `boolean` ; `savedObject`: `Readonly`<{ `all`: readonly string[] ; `read`: readonly string[] }\> ; `ui`: readonly string[] }\> }\>[] }\> - -#### Returns - -`undefined` \| `Readonly`<{ `description`: `string` ; `privileges`: readonly `Readonly`<{ `id`: `string` ; `privilege`: `Readonly`<{ `alerting?`: `Readonly`<{ `alert?`: `Readonly`<{ `all?`: readonly string[] ; `read?`: readonly string[] }\> ; `rule?`: `Readonly`<{ `all?`: readonly string[] ; `read?`: readonly string[] }\> }\> ; `api?`: readonly string[] ; `app?`: readonly string[] ; `cases?`: `Readonly`<{ `all?`: readonly string[] ; `read?`: readonly string[] }\> ; `catalogue?`: readonly string[] ; `disabled?`: `boolean` ; `excludeFromBasePrivileges?`: `boolean` ; `management?`: `Readonly`<{ [x: string]: readonly `string`[]; }\> ; `requireAllSpaces?`: `boolean` ; `savedObject`: `Readonly`<{ `all`: readonly string[] ; `read`: readonly string[] }\> ; `ui`: readonly string[] }\> }\>[] }\> - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:205 - -## Methods - -### toRaw - -▸ **toRaw**(): [`KibanaFeatureConfig`](../interfaces/client._internal_namespace.KibanaFeatureConfig.md) - -#### Returns - -[`KibanaFeatureConfig`](../interfaces/client._internal_namespace.KibanaFeatureConfig.md) - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:241 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaMigrator.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaMigrator.md deleted file mode 100644 index a26089d3ed6f4..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaMigrator.md +++ /dev/null @@ -1,286 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / KibanaMigrator - -# Class: KibanaMigrator - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).KibanaMigrator - -Manages the shape of mappings and documents in the Kibana index. - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.KibanaMigrator.md#constructor) - -### Properties - -- [activeMappings](client._internal_namespace.KibanaMigrator.md#activemappings) -- [client](client._internal_namespace.KibanaMigrator.md#client) -- [documentMigrator](client._internal_namespace.KibanaMigrator.md#documentmigrator) -- [kibanaIndex](client._internal_namespace.KibanaMigrator.md#kibanaindex) -- [kibanaVersion](client._internal_namespace.KibanaMigrator.md#kibanaversion) -- [log](client._internal_namespace.KibanaMigrator.md#log) -- [mappingProperties](client._internal_namespace.KibanaMigrator.md#mappingproperties) -- [migrationResult](client._internal_namespace.KibanaMigrator.md#migrationresult) -- [runMigrationsInternal](client._internal_namespace.KibanaMigrator.md#runmigrationsinternal) -- [serializer](client._internal_namespace.KibanaMigrator.md#serializer) -- [soMigrationsConfig](client._internal_namespace.KibanaMigrator.md#somigrationsconfig) -- [status$](client._internal_namespace.KibanaMigrator.md#status$) -- [typeRegistry](client._internal_namespace.KibanaMigrator.md#typeregistry) - -### Methods - -- [getActiveMappings](client._internal_namespace.KibanaMigrator.md#getactivemappings) -- [getStatus$](client._internal_namespace.KibanaMigrator.md#getstatus$) -- [migrateDocument](client._internal_namespace.KibanaMigrator.md#migratedocument) -- [prepareMigrations](client._internal_namespace.KibanaMigrator.md#preparemigrations) -- [runMigrations](client._internal_namespace.KibanaMigrator.md#runmigrations) - -## Constructors - -### constructor - -• **new KibanaMigrator**(`__namedParameters`) - -Creates an instance of KibanaMigrator. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`KibanaMigratorOptions`](../interfaces/client._internal_namespace.KibanaMigratorOptions.md) | - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:42 - -## Properties - -### activeMappings - -• `Private` `Readonly` **activeMappings**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:36 - -___ - -### client - -• `Private` `Readonly` **client**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:27 - -___ - -### documentMigrator - -• `Private` `Readonly` **documentMigrator**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:28 - -___ - -### kibanaIndex - -• `Private` `Readonly` **kibanaIndex**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:29 - -___ - -### kibanaVersion - -• `Readonly` **kibanaVersion**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:38 - -___ - -### log - -• `Private` `Readonly` **log**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:30 - -___ - -### mappingProperties - -• `Private` `Readonly` **mappingProperties**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:31 - -___ - -### migrationResult - -• `Private` `Optional` **migrationResult**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:34 - -___ - -### runMigrationsInternal - -• `Private` **runMigrationsInternal**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:68 - -___ - -### serializer - -• `Private` `Readonly` **serializer**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:33 - -___ - -### soMigrationsConfig - -• `Private` `Readonly` **soMigrationsConfig**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:37 - -___ - -### status$ - -• `Private` `Readonly` **status$**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:35 - -___ - -### typeRegistry - -• `Private` `Readonly` **typeRegistry**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:32 - -## Methods - -### getActiveMappings - -▸ **getActiveMappings**(): [`IndexMapping`](../interfaces/client._internal_namespace.IndexMapping.md) - -Gets all the index mappings defined by Kibana's enabled plugins. - -#### Returns - -[`IndexMapping`](../interfaces/client._internal_namespace.IndexMapping.md) - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:73 - -___ - -### getStatus$ - -▸ **getStatus$**(): `Observable`<[`KibanaMigratorStatus`](../interfaces/client._internal_namespace.KibanaMigratorStatus.md)\> - -#### Returns - -`Observable`<[`KibanaMigratorStatus`](../interfaces/client._internal_namespace.KibanaMigratorStatus.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:67 - -___ - -### migrateDocument - -▸ **migrateDocument**(`doc`): [`SavedObjectUnsanitizedDoc`](../modules/client._internal_namespace.md#savedobjectunsanitizeddoc)<`unknown`\> - -Migrates an individual doc to the latest version, as defined by the plugin migrations. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `doc` | [`SavedObjectUnsanitizedDoc`](../modules/client._internal_namespace.md#savedobjectunsanitizeddoc)<`unknown`\> | The saved object to migrate | - -#### Returns - -[`SavedObjectUnsanitizedDoc`](../modules/client._internal_namespace.md#savedobjectunsanitizeddoc)<`unknown`\> - -`doc` with all registered migrations applied. - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:80 - -___ - -### prepareMigrations - -▸ **prepareMigrations**(): `void` - -#### Returns - -`void` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:66 - -___ - -### runMigrations - -▸ **runMigrations**(`rerun?`): `Promise`<{ `status`: `string` }[]\> - -Migrates the mappings and documents in the Kibana index. By default, this will run only -once and subsequent calls will return the result of the original call. - -**`remarks`** When the `rerun` parameter is set to true, no checks are performed to ensure that no migration -is currently running. Chained or concurrent calls to `runMigrations({ rerun: true })` can lead to -multiple migrations running at the same time. When calling with this parameter, it's expected that the calling -code should ensure that the initial call resolves before calling the function again. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `rerun?` | `Object` | If true, method will run a new migration when called again instead of returning the result of the initial migration. This should only be used when factors external to Kibana itself alter the kibana index causing the saved objects mappings or data to change after the Kibana server performed the initial migration. | -| `rerun.rerun?` | `boolean` | - | - -#### Returns - -`Promise`<{ `status`: `string` }[]\> - -- A promise which resolves once all migrations have been applied. - The promise resolves with an array of migration statuses, one for each - elasticsearch index which was migrated. - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:61 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaRequest.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaRequest.md deleted file mode 100644 index e0aae4835d6b7..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.KibanaRequest.md +++ /dev/null @@ -1,347 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / KibanaRequest - -# Class: KibanaRequest - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).KibanaRequest - -Kibana specific abstraction for an incoming request. - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Params` | `unknown` | -| `Query` | `unknown` | -| `Body` | `unknown` | -| `Method` | extends [`RouteMethod`](../modules/client._internal_namespace.md#routemethod) = `any` | - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.KibanaRequest.md#constructor) - -### Properties - -- [[requestSymbol]](client._internal_namespace.KibanaRequest.md#[requestsymbol]) -- [auth](client._internal_namespace.KibanaRequest.md#auth) -- [body](client._internal_namespace.KibanaRequest.md#body) -- [events](client._internal_namespace.KibanaRequest.md#events) -- [getAuthRequired](client._internal_namespace.KibanaRequest.md#getauthrequired) -- [getEvents](client._internal_namespace.KibanaRequest.md#getevents) -- [getRouteInfo](client._internal_namespace.KibanaRequest.md#getrouteinfo) -- [headers](client._internal_namespace.KibanaRequest.md#headers) -- [id](client._internal_namespace.KibanaRequest.md#id) -- [isSystemRequest](client._internal_namespace.KibanaRequest.md#issystemrequest) -- [params](client._internal_namespace.KibanaRequest.md#params) -- [query](client._internal_namespace.KibanaRequest.md#query) -- [rewrittenUrl](client._internal_namespace.KibanaRequest.md#rewrittenurl) -- [route](client._internal_namespace.KibanaRequest.md#route) -- [socket](client._internal_namespace.KibanaRequest.md#socket) -- [url](client._internal_namespace.KibanaRequest.md#url) -- [uuid](client._internal_namespace.KibanaRequest.md#uuid) -- [withoutSecretHeaders](client._internal_namespace.KibanaRequest.md#withoutsecretheaders) -- [validate](client._internal_namespace.KibanaRequest.md#validate) - -### Methods - -- [from](client._internal_namespace.KibanaRequest.md#from) - -## Constructors - -### constructor - -• **new KibanaRequest**<`Params`, `Query`, `Body`, `Method`\>(`request`, `params`, `query`, `body`, `withoutSecretHeaders`) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Params` | `unknown` | -| `Query` | `unknown` | -| `Body` | `unknown` | -| `Method` | extends [`RouteMethod`](../modules/client._internal_namespace.md#routemethod) = `any` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | `Request` | -| `params` | `Params` | -| `query` | `Query` | -| `body` | `Body` | -| `withoutSecretHeaders` | `boolean` | - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:126 - -## Properties - -### [requestSymbol] - -• `Protected` `Readonly` **[requestSymbol]**: `Request` - -**`internal`** - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:125 - -___ - -### auth - -• `Readonly` **auth**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `isAuthenticated` | `boolean` | - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:117 - -___ - -### body - -• `Readonly` **body**: `Body` - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:66 - -___ - -### events - -• `Readonly` **events**: [`KibanaRequestEvents`](../interfaces/client._internal_namespace.KibanaRequestEvents.md) - -Request events [KibanaRequestEvents](../interfaces/client._internal_namespace.KibanaRequestEvents.md) - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:116 - -___ - -### getAuthRequired - -• `Private` **getAuthRequired**: `any` - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:129 - -___ - -### getEvents - -• `Private` **getEvents**: `any` - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:127 - -___ - -### getRouteInfo - -• `Private` **getRouteInfo**: `any` - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:128 - -___ - -### headers - -• `Readonly` **headers**: [`Headers`](../modules/client._internal_namespace.md#headers) - -Readonly copy of incoming request headers. - -**`remarks`** -This property will contain a `filtered` copy of request headers. - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:107 - -___ - -### id - -• `Readonly` **id**: `string` - -A identifier to identify this request. - -**`remarks`** -Depending on the user's configuration, this value may be sourced from the -incoming request's `X-Opaque-Id` header which is not guaranteed to be unique -per request. - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:89 - -___ - -### isSystemRequest - -• `Readonly` **isSystemRequest**: `boolean` - -Whether or not the request is a "system request" rather than an application-level request. -Can be set on the client using the `HttpFetchOptions#asSystemRequest` option. - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:112 - -___ - -### params - -• `Readonly` **params**: `Params` - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:64 - -___ - -### query - -• `Readonly` **query**: `Query` - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:65 - -___ - -### rewrittenUrl - -• `Optional` `Readonly` **rewrittenUrl**: `URL` - -URL rewritten in onPreRouting request interceptor. - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:123 - -___ - -### route - -• `Readonly` **route**: `Readonly`<{ `method`: `RecursiveReadonly`<`Method`\> ; `options`: `RecursiveReadonly`<[`KibanaRequestRouteOptions`](../modules/client._internal_namespace.md#kibanarequestrouteoptions)<`Method`\>\> ; `path`: `string` }\> - -matched route details - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:101 - -___ - -### socket - -• `Readonly` **socket**: [`IKibanaSocket`](../interfaces/client._internal_namespace.IKibanaSocket.md) - -[IKibanaSocket](../interfaces/client._internal_namespace.IKibanaSocket.md) - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:114 - -___ - -### url - -• `Readonly` **url**: `URL` - -a WHATWG URL standard object. - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:99 - -___ - -### uuid - -• `Readonly` **uuid**: `string` - -A UUID to identify this request. - -**`remarks`** -This value is NOT sourced from the incoming request's `X-Opaque-Id` header. it -is always a UUID uniquely identifying the request. - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:97 - -___ - -### withoutSecretHeaders - -• `Private` `Readonly` **withoutSecretHeaders**: `any` - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:67 - -___ - -### validate - -▪ `Static` `Private` **validate**: `any` - -Validates the different parts of a request based on the schemas defined for -the route. Builds up the actual params, query and body object that will be -received in the route handler. - -**`internal`** - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:80 - -## Methods - -### from - -▸ `Static` **from**<`P`, `Q`, `B`\>(`req`, `routeSchemas?`, `withoutSecretHeaders?`): [`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`P`, `Q`, `B`, `any`\> - -Factory for creating requests. Validates the request before creating an -instance of a KibanaRequest. - -**`internal`** - -#### Type parameters - -| Name | -| :------ | -| `P` | -| `Q` | -| `B` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `req` | `Request` | -| `routeSchemas?` | [`RouteValidator`](client._internal_namespace.RouteValidator.md)<`P`, `Q`, `B`\> \| [`RouteValidatorFullConfig`](../modules/client._internal_namespace.md#routevalidatorfullconfig)<`P`, `Q`, `B`\> | -| `withoutSecretHeaders?` | `boolean` | - -#### Returns - -[`KibanaRequest`](client._internal_namespace.KibanaRequest.md)<`P`, `Q`, `B`, `any`\> - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:73 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.LicenseState.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.LicenseState.md deleted file mode 100644 index 9b8af11cd73cf..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.LicenseState.md +++ /dev/null @@ -1,215 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / LicenseState - -# Class: LicenseState - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).LicenseState - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.LicenseState.md#constructor) - -### Properties - -- [\_notifyUsage](client._internal_namespace.LicenseState.md#_notifyusage) -- [license](client._internal_namespace.LicenseState.md#license) -- [licenseInformation](client._internal_namespace.LicenseState.md#licenseinformation) -- [notifyUsage](client._internal_namespace.LicenseState.md#notifyusage) -- [subscription](client._internal_namespace.LicenseState.md#subscription) -- [updateInformation](client._internal_namespace.LicenseState.md#updateinformation) - -### Methods - -- [checkLicense](client._internal_namespace.LicenseState.md#checklicense) -- [clean](client._internal_namespace.LicenseState.md#clean) -- [ensureLicenseForActionType](client._internal_namespace.LicenseState.md#ensurelicenseforactiontype) -- [getLicenseInformation](client._internal_namespace.LicenseState.md#getlicenseinformation) -- [isLicenseValidForActionType](client._internal_namespace.LicenseState.md#islicensevalidforactiontype) -- [setNotifyUsage](client._internal_namespace.LicenseState.md#setnotifyusage) - -## Constructors - -### constructor - -• **new LicenseState**(`license$`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `license$` | `Observable`<[`ILicense`](../interfaces/client._internal_namespace.ILicense.md)\> | - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:17 - -## Properties - -### \_notifyUsage - -• `Private` **\_notifyUsage**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:16 - -___ - -### license - -• `Private` `Optional` **license**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:15 - -___ - -### licenseInformation - -• `Private` **licenseInformation**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:13 - -___ - -### notifyUsage - -• `Private` **notifyUsage**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:30 - -___ - -### subscription - -• `Private` **subscription**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:14 - -___ - -### updateInformation - -• `Private` **updateInformation**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:18 - -## Methods - -### checkLicense - -▸ **checkLicense**(`license`): [`ActionsLicenseInformation`](../interfaces/client._internal_namespace.ActionsLicenseInformation.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `license` | `undefined` \| [`ILicense`](../interfaces/client._internal_namespace.ILicense.md) | - -#### Returns - -[`ActionsLicenseInformation`](../interfaces/client._internal_namespace.ActionsLicenseInformation.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:32 - -___ - -### clean - -▸ **clean**(): `void` - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:20 - -___ - -### ensureLicenseForActionType - -▸ **ensureLicenseForActionType**(`actionType`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionType` | [`ActionType`](../interfaces/client._internal_namespace.ActionType-1.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig), [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets), [`ActionTypeParams`](../modules/client._internal_namespace.md#actiontypeparams), `void`\> | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:31 - -___ - -### getLicenseInformation - -▸ **getLicenseInformation**(): [`ActionsLicenseInformation`](../interfaces/client._internal_namespace.ActionsLicenseInformation.md) - -#### Returns - -[`ActionsLicenseInformation`](../interfaces/client._internal_namespace.ActionsLicenseInformation.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:21 - -___ - -### isLicenseValidForActionType - -▸ **isLicenseValidForActionType**(`actionType`, `__namedParameters?`): { `isValid`: ``true`` } \| { `isValid`: ``false`` ; `reason`: ``"unavailable"`` \| ``"expired"`` \| ``"invalid"`` } - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionType` | [`ActionType`](../interfaces/client._internal_namespace.ActionType-1.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig), [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets), [`ActionTypeParams`](../modules/client._internal_namespace.md#actiontypeparams), `void`\> | -| `__namedParameters?` | `Object` | -| `__namedParameters.notifyUsage` | `boolean` | - -#### Returns - -{ `isValid`: ``true`` } \| { `isValid`: ``false`` ; `reason`: ``"unavailable"`` \| ``"expired"`` \| ``"invalid"`` } - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:22 - -___ - -### setNotifyUsage - -▸ **setNotifyUsage**(`notifyUsage`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `notifyUsage` | (`featureName`: `string`, `usedAt?`: `number` \| `Date`) => `void` | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:19 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.RouteValidationError.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.RouteValidationError.md deleted file mode 100644 index a9fcf909bd74a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.RouteValidationError.md +++ /dev/null @@ -1,40 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RouteValidationError - -# Class: RouteValidationError - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RouteValidationError - -Error to return when the validation is not successful. - -## Hierarchy - -- `SchemaTypeError` - - ↳ **`RouteValidationError`** - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.RouteValidationError.md#constructor) - -## Constructors - -### constructor - -• **new RouteValidationError**(`error`, `path?`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `string` \| `Error` | -| `path?` | `string`[] | - -#### Overrides - -SchemaTypeError.constructor - -#### Defined in - -src/core/target/types/server/http/router/validator/validator_error.d.ts:7 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.RouteValidator.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.RouteValidator.md deleted file mode 100644 index bf73fbda85719..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.RouteValidator.md +++ /dev/null @@ -1,272 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RouteValidator - -# Class: RouteValidator - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RouteValidator - -Route validator class to define the validation logic for each new route. - -**`internal`** - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `P` | {} | -| `Q` | {} | -| `B` | {} | - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.RouteValidator.md#constructor) - -### Properties - -- [config](client._internal_namespace.RouteValidator.md#config) -- [customValidation](client._internal_namespace.RouteValidator.md#customvalidation) -- [options](client._internal_namespace.RouteValidator.md#options) -- [preValidateSchema](client._internal_namespace.RouteValidator.md#prevalidateschema) -- [safetyPostchecks](client._internal_namespace.RouteValidator.md#safetypostchecks) -- [safetyPrechecks](client._internal_namespace.RouteValidator.md#safetyprechecks) -- [validate](client._internal_namespace.RouteValidator.md#validate) -- [validateFunction](client._internal_namespace.RouteValidator.md#validatefunction) -- [ResultFactory](client._internal_namespace.RouteValidator.md#resultfactory) - -### Methods - -- [getBody](client._internal_namespace.RouteValidator.md#getbody) -- [getParams](client._internal_namespace.RouteValidator.md#getparams) -- [getQuery](client._internal_namespace.RouteValidator.md#getquery) -- [hasBody](client._internal_namespace.RouteValidator.md#hasbody) -- [from](client._internal_namespace.RouteValidator.md#from) - -## Constructors - -### constructor - -• `Private` **new RouteValidator**<`P`, `Q`, `B`\>() - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `P` | {} | -| `Q` | {} | -| `B` | {} | - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:112 - -## Properties - -### config - -• `Private` `Readonly` **config**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:108 - -___ - -### customValidation - -• `Private` **customValidation**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:136 - -___ - -### options - -• `Private` `Readonly` **options**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:109 - -___ - -### preValidateSchema - -• `Private` **preValidateSchema**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:138 - -___ - -### safetyPostchecks - -• `Private` **safetyPostchecks**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:135 - -___ - -### safetyPrechecks - -• `Private` **safetyPrechecks**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:134 - -___ - -### validate - -• `Private` **validate**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:133 - -___ - -### validateFunction - -• `Private` **validateFunction**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:137 - -___ - -### ResultFactory - -▪ `Static` `Private` **ResultFactory**: `any` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:111 - -## Methods - -### getBody - -▸ **getBody**(`data`, `namespace?`): `Readonly`<`B`\> - -Get validated body - -**`internal`** - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `unknown` | -| `namespace?` | `string` | - -#### Returns - -`Readonly`<`B`\> - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:127 - -___ - -### getParams - -▸ **getParams**(`data`, `namespace?`): `Readonly`<`P`\> - -Get validated URL params - -**`internal`** - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `unknown` | -| `namespace?` | `string` | - -#### Returns - -`Readonly`<`P`\> - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:117 - -___ - -### getQuery - -▸ **getQuery**(`data`, `namespace?`): `Readonly`<`Q`\> - -Get validated query params - -**`internal`** - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `unknown` | -| `namespace?` | `string` | - -#### Returns - -`Readonly`<`Q`\> - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:122 - -___ - -### hasBody - -▸ **hasBody**(): `boolean` - -Has body validation - -**`internal`** - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:132 - -___ - -### from - -▸ `Static` **from**<`_P`, `_Q`, `_B`\>(`opts`): [`RouteValidator`](client._internal_namespace.RouteValidator.md)<`_P`, `_Q`, `_B`\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `_P` | {} | -| `_Q` | {} | -| `_B` | {} | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `opts` | [`RouteValidator`](client._internal_namespace.RouteValidator.md)<`_P`, `_Q`, `_B`\> \| [`RouteValidatorFullConfig`](../modules/client._internal_namespace.md#routevalidatorfullconfig)<`_P`, `_Q`, `_B`\> | - -#### Returns - -[`RouteValidator`](client._internal_namespace.RouteValidator.md)<`_P`, `_Q`, `_B`\> - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:110 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectActions.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectActions.md deleted file mode 100644 index cced678be25cc..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectActions.md +++ /dev/null @@ -1,66 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectActions - -# Class: SavedObjectActions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectActions - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.SavedObjectActions.md#constructor) - -### Properties - -- [prefix](client._internal_namespace.SavedObjectActions.md#prefix) - -### Methods - -- [get](client._internal_namespace.SavedObjectActions.md#get) - -## Constructors - -### constructor - -• **new SavedObjectActions**(`versionNumber`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionNumber` | `string` | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/saved_object.d.ts:3 - -## Properties - -### prefix - -• `Private` `Readonly` **prefix**: `any` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/saved_object.d.ts:2 - -## Methods - -### get - -▸ **get**(`type`, `operation`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `operation` | `string` | - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/saved_object.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectTypeRegistry.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectTypeRegistry.md deleted file mode 100644 index bc38c9d6773b1..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectTypeRegistry.md +++ /dev/null @@ -1,306 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectTypeRegistry - -# Class: SavedObjectTypeRegistry - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectTypeRegistry - -Registry holding information about all the registered [saved object types](../interfaces/client._internal_namespace.SavedObjectsType.md). - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.SavedObjectTypeRegistry.md#constructor) - -### Properties - -- [types](client._internal_namespace.SavedObjectTypeRegistry.md#types) - -### Methods - -- [getAllTypes](client._internal_namespace.SavedObjectTypeRegistry.md#getalltypes) -- [getImportableAndExportableTypes](client._internal_namespace.SavedObjectTypeRegistry.md#getimportableandexportabletypes) -- [getIndex](client._internal_namespace.SavedObjectTypeRegistry.md#getindex) -- [getType](client._internal_namespace.SavedObjectTypeRegistry.md#gettype) -- [getVisibleTypes](client._internal_namespace.SavedObjectTypeRegistry.md#getvisibletypes) -- [isHidden](client._internal_namespace.SavedObjectTypeRegistry.md#ishidden) -- [isImportableAndExportable](client._internal_namespace.SavedObjectTypeRegistry.md#isimportableandexportable) -- [isMultiNamespace](client._internal_namespace.SavedObjectTypeRegistry.md#ismultinamespace) -- [isNamespaceAgnostic](client._internal_namespace.SavedObjectTypeRegistry.md#isnamespaceagnostic) -- [isShareable](client._internal_namespace.SavedObjectTypeRegistry.md#isshareable) -- [isSingleNamespace](client._internal_namespace.SavedObjectTypeRegistry.md#issinglenamespace) -- [registerType](client._internal_namespace.SavedObjectTypeRegistry.md#registertype) - -## Constructors - -### constructor - -• **new SavedObjectTypeRegistry**() - -## Properties - -### types - -• `Private` `Readonly` **types**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:14 - -## Methods - -### getAllTypes - -▸ **getAllTypes**(): [`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\>[] - -Return all [types](../interfaces/client._internal_namespace.SavedObjectsType.md) currently registered, including the hidden ones. - -To only get the visible types (which is the most common use case), use `getVisibleTypes` instead. - -#### Returns - -[`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\>[] - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:35 - -___ - -### getImportableAndExportableTypes - -▸ **getImportableAndExportableTypes**(): [`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\>[] - -Return all [types](../interfaces/client._internal_namespace.SavedObjectsType.md) currently registered that are importable/exportable. - -#### Returns - -[`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\>[] - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:39 - -___ - -### getIndex - -▸ **getIndex**(`type`): `undefined` \| `string` - -Returns the `indexPattern` property for given type, or `undefined` if -the type is not registered. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -`undefined` \| `string` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:69 - -___ - -### getType - -▸ **getType**(`type`): `undefined` \| [`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\> - -Return the [type](../interfaces/client._internal_namespace.SavedObjectsType.md) definition for given type name. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -`undefined` \| [`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\> - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:23 - -___ - -### getVisibleTypes - -▸ **getVisibleTypes**(): [`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\>[] - -Returns all visible [types](../interfaces/client._internal_namespace.SavedObjectsType.md). - -A visible type is a type that doesn't explicitly define `hidden=true` during registration. - -#### Returns - -[`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\>[] - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:29 - -___ - -### isHidden - -▸ **isHidden**(`type`): `boolean` - -Returns the `hidden` property for given type, or `false` if -the type is not registered. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:64 - -___ - -### isImportableAndExportable - -▸ **isImportableAndExportable**(`type`): `boolean` - -Returns the `management.importableAndExportable` property for given type, or -`false` if the type is not registered or does not define a management section. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:74 - -___ - -### isMultiNamespace - -▸ **isMultiNamespace**(`type`): `boolean` - -Returns whether the type is multi-namespace (shareable *or* isolated); -resolves to `false` if the type is not registered - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:54 - -___ - -### isNamespaceAgnostic - -▸ **isNamespaceAgnostic**(`type`): `boolean` - -Returns whether the type is namespace-agnostic (global); -resolves to `false` if the type is not registered - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:44 - -___ - -### isShareable - -▸ **isShareable**(`type`): `boolean` - -Returns whether the type is multi-namespace (shareable); -resolves to `false` if the type is not registered - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:59 - -___ - -### isSingleNamespace - -▸ **isSingleNamespace**(`type`): `boolean` - -Returns whether the type is single-namespace (isolated); -resolves to `true` if the type is not registered - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:49 - -___ - -### registerType - -▸ **registerType**(`type`): `void` - -Register a [type](../interfaces/client._internal_namespace.SavedObjectsType.md) inside the registry. -A type can only be registered once. subsequent calls with the same type name will throw an error. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | [`SavedObjectsType`](../interfaces/client._internal_namespace.SavedObjectsType.md)<`any`\> | - -#### Returns - -`void` - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:19 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsClient.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsClient.md deleted file mode 100644 index 1d97deadff81a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsClient.md +++ /dev/null @@ -1,617 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsClient - -# Class: SavedObjectsClient - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsClient - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.SavedObjectsClient.md#constructor) - -### Properties - -- [\_repository](client._internal_namespace.SavedObjectsClient.md#_repository) -- [errors](client._internal_namespace.SavedObjectsClient.md#errors) -- [errors](client._internal_namespace.SavedObjectsClient.md#errors) - -### Methods - -- [bulkCreate](client._internal_namespace.SavedObjectsClient.md#bulkcreate) -- [bulkGet](client._internal_namespace.SavedObjectsClient.md#bulkget) -- [bulkResolve](client._internal_namespace.SavedObjectsClient.md#bulkresolve) -- [bulkUpdate](client._internal_namespace.SavedObjectsClient.md#bulkupdate) -- [checkConflicts](client._internal_namespace.SavedObjectsClient.md#checkconflicts) -- [closePointInTime](client._internal_namespace.SavedObjectsClient.md#closepointintime) -- [collectMultiNamespaceReferences](client._internal_namespace.SavedObjectsClient.md#collectmultinamespacereferences) -- [create](client._internal_namespace.SavedObjectsClient.md#create) -- [createPointInTimeFinder](client._internal_namespace.SavedObjectsClient.md#createpointintimefinder) -- [delete](client._internal_namespace.SavedObjectsClient.md#delete) -- [find](client._internal_namespace.SavedObjectsClient.md#find) -- [get](client._internal_namespace.SavedObjectsClient.md#get) -- [openPointInTimeForType](client._internal_namespace.SavedObjectsClient.md#openpointintimefortype) -- [removeReferencesTo](client._internal_namespace.SavedObjectsClient.md#removereferencesto) -- [resolve](client._internal_namespace.SavedObjectsClient.md#resolve) -- [update](client._internal_namespace.SavedObjectsClient.md#update) -- [updateObjectsSpaces](client._internal_namespace.SavedObjectsClient.md#updateobjectsspaces) - -## Constructors - -### constructor - -• **new SavedObjectsClient**(`repository`) - -**`internal`** - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `repository` | [`ISavedObjectsRepository`](../modules/client._internal_namespace.md#isavedobjectsrepository) | - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:371 - -## Properties - -### \_repository - -• `Private` **\_repository**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:369 - -___ - -### errors - -• **errors**: typeof [`SavedObjectsErrorHelpers`](client._internal_namespace.SavedObjectsErrorHelpers.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:368 - -___ - -### errors - -▪ `Static` **errors**: typeof [`SavedObjectsErrorHelpers`](client._internal_namespace.SavedObjectsErrorHelpers.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:367 - -## Methods - -### bulkCreate - -▸ **bulkCreate**<`T`\>(`objects`, `options?`): `Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<`T`\>\> - -Persists multiple documents batched together as a single request - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `objects` | [`SavedObjectsBulkCreateObject`](../interfaces/client._internal_namespace.SavedObjectsBulkCreateObject.md)<`T`\>[] | -| `options?` | [`SavedObjectsCreateOptions`](../interfaces/client._internal_namespace.SavedObjectsCreateOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:386 - -___ - -### bulkGet - -▸ **bulkGet**<`T`\>(`objects?`, `options?`): `Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<`T`\>\> - -Returns an array of objects by id - -**`example`** - -bulkGet([ - { id: 'one', type: 'config' }, - { id: 'foo', type: 'index-pattern' } -]) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `objects?` | [`SavedObjectsBulkGetObject`](../interfaces/client._internal_namespace.SavedObjectsBulkGetObject.md)[] | an array of ids, or an array of objects containing id, type and optionally fields | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - | - -#### Returns - -`Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:420 - -___ - -### bulkResolve - -▸ **bulkResolve**<`T`\>(`objects`, `options?`): `Promise`<[`SavedObjectsBulkResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResolveResponse.md)<`T`\>\> - -Resolves an array of objects by id, using any legacy URL aliases if they exist - -**`example`** - -bulkResolve([ - { id: 'one', type: 'config' }, - { id: 'foo', type: 'index-pattern' } -]) - -**`note`** Saved objects that Kibana fails to find are replaced with an error object and an "exactMatch" outcome. The rationale behind the -outcome is that "exactMatch" is the default outcome, and the outcome only changes if an alias is found. This behavior is unique to -`bulkResolve`; the regular `resolve` API will throw an error instead. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `objects` | [`SavedObjectsBulkResolveObject`](../interfaces/client._internal_namespace.SavedObjectsBulkResolveObject.md)[] | an array of objects containing id, type | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - | - -#### Returns - -`Promise`<[`SavedObjectsBulkResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResolveResponse.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:444 - -___ - -### bulkUpdate - -▸ **bulkUpdate**<`T`\>(`objects`, `options?`): `Promise`<[`SavedObjectsBulkUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md)<`T`\>\> - -Bulk Updates multiple SavedObject at once - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `objects` | [`SavedObjectsBulkUpdateObject`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateObject.md)<`T`\>[] | -| `options?` | [`SavedObjectsBulkUpdateOptions`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsBulkUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:466 - -___ - -### checkConflicts - -▸ **checkConflicts**(`objects?`, `options?`): `Promise`<[`SavedObjectsCheckConflictsResponse`](../interfaces/client._internal_namespace.SavedObjectsCheckConflictsResponse.md)\> - -Check what conflicts will result when creating a given array of saved objects. This includes "unresolvable conflicts", which are -multi-namespace objects that exist in a different namespace; such conflicts cannot be resolved/overwritten. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `objects?` | [`SavedObjectsCheckConflictsObject`](../interfaces/client._internal_namespace.SavedObjectsCheckConflictsObject.md)[] | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsCheckConflictsResponse`](../interfaces/client._internal_namespace.SavedObjectsCheckConflictsResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:394 - -___ - -### closePointInTime - -▸ **closePointInTime**(`id`, `options?`): `Promise`<[`SavedObjectsClosePointInTimeResponse`](../interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md)\> - -Closes a Point In Time (PIT) by ID. This simply proxies the request to ES via the -Elasticsearch client, and is included in the Saved Objects Client as a convenience -for consumers who are using [SavedObjectsClient.openPointInTimeForType](client._internal_namespace.SavedObjectsClient.md#openpointintimefortype). - -Only use this API if you have an advanced use case that's not solved by the -[SavedObjectsClient.createPointInTimeFinder](client._internal_namespace.SavedObjectsClient.md#createpointintimefinder) method. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | `string` | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsClosePointInTimeResponse`](../interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:488 - -___ - -### collectMultiNamespaceReferences - -▸ **collectMultiNamespaceReferences**(`objects`, `options?`): `Promise`<[`SavedObjectsCollectMultiNamespaceReferencesResponse`](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md)\> - -Gets all references and transitive references of the listed objects. Ignores any object that is not a multi-namespace type. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `objects` | [`SavedObjectsCollectMultiNamespaceReferencesObject`](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesObject.md)[] | -| `options?` | [`SavedObjectsCollectMultiNamespaceReferencesOptions`](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsCollectMultiNamespaceReferencesResponse`](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:541 - -___ - -### create - -▸ **create**<`T`\>(`type`, `attributes`, `options?`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -Persists a SavedObject - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `attributes` | `T` | -| `options?` | [`SavedObjectsCreateOptions`](../interfaces/client._internal_namespace.SavedObjectsCreateOptions.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:379 - -___ - -### createPointInTimeFinder - -▸ **createPointInTimeFinder**<`T`, `A`\>(`findOptions`, `dependencies?`): [`ISavedObjectsPointInTimeFinder`](../interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md)<`T`, `A`\> - -Returns a [ISavedObjectsPointInTimeFinder](../interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md) to help page through -large sets of saved objects. We strongly recommend using this API for -any `find` queries that might return more than 1000 saved objects, -however this API is only intended for use in server-side "batch" -processing of objects where you are collecting all objects in memory -or streaming them back to the client. - -Do NOT use this API in a route handler to facilitate paging through -saved objects on the client-side unless you are streaming all of the -results back to the client at once. Because the returned generator is -stateful, you cannot rely on subsequent http requests retrieving new -pages from the same Kibana server in multi-instance deployments. - -The generator wraps calls to [SavedObjectsClient.find](client._internal_namespace.SavedObjectsClient.md#find) and iterates -over multiple pages of results using `_pit` and `search_after`. This will -open a new Point-In-Time (PIT), and continue paging until a set of -results is received that's smaller than the designated `perPage`. - -Once you have retrieved all of the results you need, it is recommended -to call `close()` to clean up the PIT and prevent Elasticsearch from -consuming resources unnecessarily. This is only required if you are -done iterating and have not yet paged through all of the results: the -PIT will automatically be closed for you once you reach the last page -of results, or if the underlying call to `find` fails for any reason. - -**`example`** -```ts -const findOptions: SavedObjectsCreatePointInTimeFinderOptions = { - type: 'visualization', - search: 'foo*', - perPage: 100, -}; - -const finder = savedObjectsClient.createPointInTimeFinder(findOptions); - -const responses: SavedObjectFindResponse[] = []; -for await (const response of finder.find()) { - responses.push(...response); - if (doneSearching) { - await finder.close(); - } -} -``` - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | -| `A` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `findOptions` | [`SavedObjectsCreatePointInTimeFinderOptions`](../modules/client._internal_namespace.md#savedobjectscreatepointintimefinderoptions) | -| `dependencies?` | [`SavedObjectsCreatePointInTimeFinderDependencies`](../interfaces/client._internal_namespace.SavedObjectsCreatePointInTimeFinderDependencies.md) | - -#### Returns - -[`ISavedObjectsPointInTimeFinder`](../interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md)<`T`, `A`\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:534 - -___ - -### delete - -▸ **delete**(`type`, `id`, `options?`): `Promise`<{}\> - -Deletes a SavedObject - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `options?` | [`SavedObjectsDeleteOptions`](../interfaces/client._internal_namespace.SavedObjectsDeleteOptions.md) | - -#### Returns - -`Promise`<{}\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:402 - -___ - -### find - -▸ **find**<`T`, `A`\>(`options`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<`T`, `A`\>\> - -Find all SavedObjects matching the search query - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | -| `A` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `options` | [`SavedObjectsFindOptions`](../interfaces/client._internal_namespace.SavedObjectsFindOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<`T`, `A`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:408 - -___ - -### get - -▸ **get**<`T`\>(`type`, `id`, `options?`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -Retrieves a single object - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `type` | `string` | The type of SavedObject to retrieve | -| `id` | `string` | The ID of the SavedObject to retrieve | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:428 - -___ - -### openPointInTimeForType - -▸ **openPointInTimeForType**(`type`, `options?`): `Promise`<[`SavedObjectsOpenPointInTimeResponse`](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md)\> - -Opens a Point In Time (PIT) against the indices for the specified Saved Object types. -The returned `id` can then be passed to [SavedObjectsClient.find](client._internal_namespace.SavedObjectsClient.md#find) to search -against that PIT. - -Only use this API if you have an advanced use case that's not solved by the -[SavedObjectsClient.createPointInTimeFinder](client._internal_namespace.SavedObjectsClient.md#createpointintimefinder) method. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` \| `string`[] | -| `options?` | [`SavedObjectsOpenPointInTimeOptions`](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsOpenPointInTimeResponse`](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:479 - -___ - -### removeReferencesTo - -▸ **removeReferencesTo**(`type`, `id`, `options?`): `Promise`<[`SavedObjectsRemoveReferencesToResponse`](../interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md)\> - -Updates all objects containing a reference to the given {type, id} tuple to remove the said reference. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `options?` | [`SavedObjectsRemoveReferencesToOptions`](../interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsRemoveReferencesToResponse`](../interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:470 - -___ - -### resolve - -▸ **resolve**<`T`\>(`type`, `id`, `options?`): `Promise`<[`SavedObjectsResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsResolveResponse.md)<`T`\>\> - -Resolves a single object, using any legacy URL alias if it exists - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `type` | `string` | The type of SavedObject to retrieve | -| `id` | `string` | The ID of the SavedObject to retrieve | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | | - -#### Returns - -`Promise`<[`SavedObjectsResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsResolveResponse.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:452 - -___ - -### update - -▸ **update**<`T`\>(`type`, `id`, `attributes`, `options?`): `Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<`T`\>\> - -Updates an SavedObject - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `attributes` | `Partial`<`T`\> | -| `options?` | [`SavedObjectsUpdateOptions`](../interfaces/client._internal_namespace.SavedObjectsUpdateOptions.md)<`T`\> | - -#### Returns - -`Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:460 - -___ - -### updateObjectsSpaces - -▸ **updateObjectsSpaces**(`objects`, `spacesToAdd`, `spacesToRemove`, `options?`): `Promise`<[`SavedObjectsUpdateObjectsSpacesResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md)\> - -Updates one or more objects to add and/or remove them from specified spaces. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `objects` | [`SavedObjectsUpdateObjectsSpacesObject`](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md)[] | -| `spacesToAdd` | `string`[] | -| `spacesToRemove` | `string`[] | -| `options?` | [`SavedObjectsUpdateObjectsSpacesOptions`](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsUpdateObjectsSpacesResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:550 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsErrorHelpers.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsErrorHelpers.md deleted file mode 100644 index c428ccb237f1b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsErrorHelpers.md +++ /dev/null @@ -1,665 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsErrorHelpers - -# Class: SavedObjectsErrorHelpers - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsErrorHelpers - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.SavedObjectsErrorHelpers.md#constructor) - -### Methods - -- [createBadRequestError](client._internal_namespace.SavedObjectsErrorHelpers.md#createbadrequesterror) -- [createConflictError](client._internal_namespace.SavedObjectsErrorHelpers.md#createconflicterror) -- [createGenericNotFoundError](client._internal_namespace.SavedObjectsErrorHelpers.md#creategenericnotfounderror) -- [createGenericNotFoundEsUnavailableError](client._internal_namespace.SavedObjectsErrorHelpers.md#creategenericnotfoundesunavailableerror) -- [createIndexAliasNotFoundError](client._internal_namespace.SavedObjectsErrorHelpers.md#createindexaliasnotfounderror) -- [createInvalidVersionError](client._internal_namespace.SavedObjectsErrorHelpers.md#createinvalidversionerror) -- [createTooManyRequestsError](client._internal_namespace.SavedObjectsErrorHelpers.md#createtoomanyrequestserror) -- [createUnsupportedTypeError](client._internal_namespace.SavedObjectsErrorHelpers.md#createunsupportedtypeerror) -- [decorateBadRequestError](client._internal_namespace.SavedObjectsErrorHelpers.md#decoratebadrequesterror) -- [decorateConflictError](client._internal_namespace.SavedObjectsErrorHelpers.md#decorateconflicterror) -- [decorateEsCannotExecuteScriptError](client._internal_namespace.SavedObjectsErrorHelpers.md#decorateescannotexecutescripterror) -- [decorateEsUnavailableError](client._internal_namespace.SavedObjectsErrorHelpers.md#decorateesunavailableerror) -- [decorateForbiddenError](client._internal_namespace.SavedObjectsErrorHelpers.md#decorateforbiddenerror) -- [decorateGeneralError](client._internal_namespace.SavedObjectsErrorHelpers.md#decorategeneralerror) -- [decorateIndexAliasNotFoundError](client._internal_namespace.SavedObjectsErrorHelpers.md#decorateindexaliasnotfounderror) -- [decorateNotAuthorizedError](client._internal_namespace.SavedObjectsErrorHelpers.md#decoratenotauthorizederror) -- [decorateRequestEntityTooLargeError](client._internal_namespace.SavedObjectsErrorHelpers.md#decoraterequestentitytoolargeerror) -- [decorateTooManyRequestsError](client._internal_namespace.SavedObjectsErrorHelpers.md#decoratetoomanyrequestserror) -- [isBadRequestError](client._internal_namespace.SavedObjectsErrorHelpers.md#isbadrequesterror) -- [isConflictError](client._internal_namespace.SavedObjectsErrorHelpers.md#isconflicterror) -- [isEsCannotExecuteScriptError](client._internal_namespace.SavedObjectsErrorHelpers.md#isescannotexecutescripterror) -- [isEsUnavailableError](client._internal_namespace.SavedObjectsErrorHelpers.md#isesunavailableerror) -- [isForbiddenError](client._internal_namespace.SavedObjectsErrorHelpers.md#isforbiddenerror) -- [isGeneralError](client._internal_namespace.SavedObjectsErrorHelpers.md#isgeneralerror) -- [isInvalidVersionError](client._internal_namespace.SavedObjectsErrorHelpers.md#isinvalidversionerror) -- [isNotAuthorizedError](client._internal_namespace.SavedObjectsErrorHelpers.md#isnotauthorizederror) -- [isNotFoundError](client._internal_namespace.SavedObjectsErrorHelpers.md#isnotfounderror) -- [isRequestEntityTooLargeError](client._internal_namespace.SavedObjectsErrorHelpers.md#isrequestentitytoolargeerror) -- [isSavedObjectsClientError](client._internal_namespace.SavedObjectsErrorHelpers.md#issavedobjectsclienterror) -- [isTooManyRequestsError](client._internal_namespace.SavedObjectsErrorHelpers.md#istoomanyrequestserror) - -## Constructors - -### constructor - -• **new SavedObjectsErrorHelpers**() - -## Methods - -### createBadRequestError - -▸ `Static` **createBadRequestError**(`reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:12 - -___ - -### createConflictError - -▸ `Static` **createConflictError**(`type`, `id`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:28 - -___ - -### createGenericNotFoundError - -▸ `Static` **createGenericNotFoundError**(`type?`, `id?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type?` | ``null`` \| `string` | -| `id?` | ``null`` \| `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:23 - -___ - -### createGenericNotFoundEsUnavailableError - -▸ `Static` **createGenericNotFoundEsUnavailableError**(`type?`, `id?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type?` | ``null`` \| `string` | -| `id?` | ``null`` \| `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:39 - -___ - -### createIndexAliasNotFoundError - -▸ `Static` **createIndexAliasNotFoundError**(`alias`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `alias` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:24 - -___ - -### createInvalidVersionError - -▸ `Static` **createInvalidVersionError**(`versionInput?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionInput?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:15 - -___ - -### createTooManyRequestsError - -▸ `Static` **createTooManyRequestsError**(`type`, `id`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:31 - -___ - -### createUnsupportedTypeError - -▸ `Static` **createUnsupportedTypeError**(`type`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:13 - -___ - -### decorateBadRequestError - -▸ `Static` **decorateBadRequestError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:11 - -___ - -### decorateConflictError - -▸ `Static` **decorateConflictError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:27 - -___ - -### decorateEsCannotExecuteScriptError - -▸ `Static` **decorateEsCannotExecuteScriptError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:33 - -___ - -### decorateEsUnavailableError - -▸ `Static` **decorateEsUnavailableError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:35 - -___ - -### decorateForbiddenError - -▸ `Static` **decorateForbiddenError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:19 - -___ - -### decorateGeneralError - -▸ `Static` **decorateGeneralError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:37 - -___ - -### decorateIndexAliasNotFoundError - -▸ `Static` **decorateIndexAliasNotFoundError**(`error`, `alias`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `alias` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:25 - -___ - -### decorateNotAuthorizedError - -▸ `Static` **decorateNotAuthorizedError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:17 - -___ - -### decorateRequestEntityTooLargeError - -▸ `Static` **decorateRequestEntityTooLargeError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:21 - -___ - -### decorateTooManyRequestsError - -▸ `Static` **decorateTooManyRequestsError**(`error`, `reason?`): [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `Error` | -| `reason?` | `string` | - -#### Returns - -[`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:30 - -___ - -### isBadRequestError - -▸ `Static` **isBadRequestError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:14 - -___ - -### isConflictError - -▸ `Static` **isConflictError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:29 - -___ - -### isEsCannotExecuteScriptError - -▸ `Static` **isEsCannotExecuteScriptError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:34 - -___ - -### isEsUnavailableError - -▸ `Static` **isEsUnavailableError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:36 - -___ - -### isForbiddenError - -▸ `Static` **isForbiddenError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:20 - -___ - -### isGeneralError - -▸ `Static` **isGeneralError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:38 - -___ - -### isInvalidVersionError - -▸ `Static` **isInvalidVersionError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:16 - -___ - -### isNotAuthorizedError - -▸ `Static` **isNotAuthorizedError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:18 - -___ - -### isNotFoundError - -▸ `Static` **isNotFoundError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:26 - -___ - -### isRequestEntityTooLargeError - -▸ `Static` **isRequestEntityTooLargeError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:22 - -___ - -### isSavedObjectsClientError - -▸ `Static` **isSavedObjectsClientError**(`error`): error is DecoratedError - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `any` | - -#### Returns - -error is DecoratedError - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:10 - -___ - -### isTooManyRequestsError - -▸ `Static` **isTooManyRequestsError**(`error`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | [`DecoratedError`](../interfaces/client._internal_namespace.DecoratedError.md) \| `Error` | - -#### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:32 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsRepository.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsRepository.md deleted file mode 100644 index 967fa67b35640..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SavedObjectsRepository.md +++ /dev/null @@ -1,1082 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsRepository - -# Class: SavedObjectsRepository - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsRepository - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.SavedObjectsRepository.md#constructor) - -### Properties - -- [\_allowedTypes](client._internal_namespace.SavedObjectsRepository.md#_allowedtypes) -- [\_index](client._internal_namespace.SavedObjectsRepository.md#_index) -- [\_logger](client._internal_namespace.SavedObjectsRepository.md#_logger) -- [\_mappings](client._internal_namespace.SavedObjectsRepository.md#_mappings) -- [\_migrator](client._internal_namespace.SavedObjectsRepository.md#_migrator) -- [\_rawToSavedObject](client._internal_namespace.SavedObjectsRepository.md#_rawtosavedobject) -- [\_registry](client._internal_namespace.SavedObjectsRepository.md#_registry) -- [\_serializer](client._internal_namespace.SavedObjectsRepository.md#_serializer) -- [client](client._internal_namespace.SavedObjectsRepository.md#client) -- [getIndexForType](client._internal_namespace.SavedObjectsRepository.md#getindexfortype) -- [getIndicesForTypes](client._internal_namespace.SavedObjectsRepository.md#getindicesfortypes) -- [incrementCounterInternal](client._internal_namespace.SavedObjectsRepository.md#incrementcounterinternal) -- [preflightCheckForUpsertAliasConflict](client._internal_namespace.SavedObjectsRepository.md#preflightcheckforupsertaliasconflict) -- [preflightCheckNamespaces](client._internal_namespace.SavedObjectsRepository.md#preflightchecknamespaces) -- [rawDocExistsInNamespace](client._internal_namespace.SavedObjectsRepository.md#rawdocexistsinnamespace) -- [rawDocExistsInNamespaces](client._internal_namespace.SavedObjectsRepository.md#rawdocexistsinnamespaces) -- [validateInitialNamespaces](client._internal_namespace.SavedObjectsRepository.md#validateinitialnamespaces) -- [validateObjectAttributes](client._internal_namespace.SavedObjectsRepository.md#validateobjectattributes) -- [validateObjectNamespaces](client._internal_namespace.SavedObjectsRepository.md#validateobjectnamespaces) - -### Methods - -- [bulkCreate](client._internal_namespace.SavedObjectsRepository.md#bulkcreate) -- [bulkGet](client._internal_namespace.SavedObjectsRepository.md#bulkget) -- [bulkResolve](client._internal_namespace.SavedObjectsRepository.md#bulkresolve) -- [bulkUpdate](client._internal_namespace.SavedObjectsRepository.md#bulkupdate) -- [checkConflicts](client._internal_namespace.SavedObjectsRepository.md#checkconflicts) -- [closePointInTime](client._internal_namespace.SavedObjectsRepository.md#closepointintime) -- [collectMultiNamespaceReferences](client._internal_namespace.SavedObjectsRepository.md#collectmultinamespacereferences) -- [create](client._internal_namespace.SavedObjectsRepository.md#create) -- [createPointInTimeFinder](client._internal_namespace.SavedObjectsRepository.md#createpointintimefinder) -- [delete](client._internal_namespace.SavedObjectsRepository.md#delete) -- [deleteByNamespace](client._internal_namespace.SavedObjectsRepository.md#deletebynamespace) -- [find](client._internal_namespace.SavedObjectsRepository.md#find) -- [get](client._internal_namespace.SavedObjectsRepository.md#get) -- [incrementCounter](client._internal_namespace.SavedObjectsRepository.md#incrementcounter) -- [openPointInTimeForType](client._internal_namespace.SavedObjectsRepository.md#openpointintimefortype) -- [removeReferencesTo](client._internal_namespace.SavedObjectsRepository.md#removereferencesto) -- [resolve](client._internal_namespace.SavedObjectsRepository.md#resolve) -- [update](client._internal_namespace.SavedObjectsRepository.md#update) -- [updateObjectsSpaces](client._internal_namespace.SavedObjectsRepository.md#updateobjectsspaces) -- [createRepository](client._internal_namespace.SavedObjectsRepository.md#createrepository) - -## Constructors - -### constructor - -• `Private` **new SavedObjectsRepository**() - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:88 - -## Properties - -### \_allowedTypes - -• `Private` **\_allowedTypes**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:75 - -___ - -### \_index - -• `Private` **\_index**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:72 - -___ - -### \_logger - -• `Private` **\_logger**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:78 - -___ - -### \_mappings - -• `Private` **\_mappings**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:73 - -___ - -### \_migrator - -• `Private` **\_migrator**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:71 - -___ - -### \_rawToSavedObject - -• `Private` **\_rawToSavedObject**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:445 - -___ - -### \_registry - -• `Private` **\_registry**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:74 - -___ - -### \_serializer - -• `Private` **\_serializer**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:77 - -___ - -### client - -• `Private` `Readonly` **client**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:76 - -___ - -### getIndexForType - -• `Private` **getIndexForType**: `any` - -Returns index specified by the given type or the default index - -**`param`** the type - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:436 - -___ - -### getIndicesForTypes - -• `Private` **getIndicesForTypes**: `any` - -Returns an array of indices as specified in `this._registry` for each of the -given `types`. If any of the types don't have an associated index, the -default index `this._index` will be included. - -**`param`** The types whose indices should be retrieved - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:444 - -___ - -### incrementCounterInternal - -• `Private` **incrementCounterInternal**: `any` - -**`internal`** incrementCounter function that is used internally and bypasses validation checks. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:305 - -___ - -### preflightCheckForUpsertAliasConflict - -• `Private` **preflightCheckForUpsertAliasConflict**: `any` - -Pre-flight check to ensure that an upsert which would create a new object does not result in an alias conflict. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:455 - -___ - -### preflightCheckNamespaces - -• `Private` **preflightCheckNamespaces**: `any` - -Pre-flight check to ensure that a multi-namespace object exists in the current namespace. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:451 - -___ - -### rawDocExistsInNamespace - -• `Private` **rawDocExistsInNamespace**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:447 - -___ - -### rawDocExistsInNamespaces - -• `Private` **rawDocExistsInNamespaces**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:446 - -___ - -### validateInitialNamespaces - -• `Private` **validateInitialNamespaces**: `any` - -The `initialNamespaces` field (create, bulkCreate) is used to create an object in an initial set of spaces. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:457 - -___ - -### validateObjectAttributes - -• `Private` **validateObjectAttributes**: `any` - -Validate a migrated doc against the registered saved object type's schema. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:461 - -___ - -### validateObjectNamespaces - -• `Private` **validateObjectNamespaces**: `any` - -The object-specific `namespaces` field (bulkGet) is used to check if an object exists in any of a given number of spaces. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:459 - -## Methods - -### bulkCreate - -▸ **bulkCreate**<`T`\>(`objects`, `options?`): `Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<`T`\>\> - -Creates multiple documents at once - -**`property`** {boolean} [options.overwrite=false] - overwrites existing documents - -**`property`** {string} [options.namespace] - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `objects` | [`SavedObjectsBulkCreateObject`](../interfaces/client._internal_namespace.SavedObjectsBulkCreateObject.md)<`T`\>[] | [{ type, id, attributes, references, migrationVersion }] | -| `options?` | [`SavedObjectsCreateOptions`](../interfaces/client._internal_namespace.SavedObjectsCreateOptions.md) | - | - -#### Returns - -`Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<`T`\>\> - -- {saved_objects: [[{ id, type, version, references, attributes, error: { message } }]} - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:112 - -___ - -### bulkGet - -▸ **bulkGet**<`T`\>(`objects?`, `options?`): `Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<`T`\>\> - -Returns an array of objects by id - -**`property`** {string} [options.namespace] - -**`example`** - -bulkGet([ - { id: 'one', type: 'config' }, - { id: 'foo', type: 'index-pattern' } -]) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `objects?` | [`SavedObjectsBulkGetObject`](../interfaces/client._internal_namespace.SavedObjectsBulkGetObject.md)[] | an array of objects containing id, type and optionally fields | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - | - -#### Returns - -`Promise`<[`SavedObjectsBulkResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md)<`T`\>\> - -- { saved_objects: [{ id, type, version, attributes }] } - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:169 - -___ - -### bulkResolve - -▸ **bulkResolve**<`T`\>(`objects`, `options?`): `Promise`<[`SavedObjectsBulkResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResolveResponse.md)<`T`\>\> - -Resolves an array of objects by id, using any legacy URL aliases if they exist - -**`property`** {string} [options.namespace] - -**`example`** - -bulkResolve([ - { id: 'one', type: 'config' }, - { id: 'foo', type: 'index-pattern' } -]) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `objects` | [`SavedObjectsBulkResolveObject`](../interfaces/client._internal_namespace.SavedObjectsBulkResolveObject.md)[] | an array of objects containing id, type | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - | - -#### Returns - -`Promise`<[`SavedObjectsBulkResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkResolveResponse.md)<`T`\>\> - -- { resolved_objects: [{ saved_object, outcome }] } - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:184 - -___ - -### bulkUpdate - -▸ **bulkUpdate**<`T`\>(`objects`, `options?`): `Promise`<[`SavedObjectsBulkUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md)<`T`\>\> - -Updates multiple objects in bulk - -**`property`** {string} options.version - ensures version matches that of persisted object - -**`property`** {string} [options.namespace] - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `objects` | [`SavedObjectsBulkUpdateObject`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateObject.md)<`T`\>[] | [{ type, id, attributes, options: { version, namespace } references }] | -| `options?` | [`SavedObjectsBulkUpdateOptions`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateOptions.md) | - | - -#### Returns - -`Promise`<[`SavedObjectsBulkUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md)<`T`\>\> - -- {saved_objects: [[{ id, type, version, references, attributes, error: { message } }]} - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:241 - -___ - -### checkConflicts - -▸ **checkConflicts**(`objects?`, `options?`): `Promise`<[`SavedObjectsCheckConflictsResponse`](../interfaces/client._internal_namespace.SavedObjectsCheckConflictsResponse.md)\> - -Check what conflicts will result when creating a given array of saved objects. This includes "unresolvable conflicts", which are -multi-namespace objects that exist in a different namespace; such conflicts cannot be resolved/overwritten. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `objects?` | [`SavedObjectsCheckConflictsObject`](../interfaces/client._internal_namespace.SavedObjectsCheckConflictsObject.md)[] | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsCheckConflictsResponse`](../interfaces/client._internal_namespace.SavedObjectsCheckConflictsResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:117 - -___ - -### closePointInTime - -▸ **closePointInTime**(`id`, `options?`): `Promise`<[`SavedObjectsClosePointInTimeResponse`](../interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md)\> - -Closes a Point In Time (PIT) by ID. This simply proxies the request to ES -via the Elasticsearch client, and is included in the Saved Objects Client -as a convenience for consumers who are using `openPointInTimeForType`. - -Only use this API if you have an advanced use case that's not solved by the -[SavedObjectsRepository.createPointInTimeFinder](client._internal_namespace.SavedObjectsRepository.md#createpointintimefinder) method. - -**`remarks`** -While the `keepAlive` that is provided will cause a PIT to automatically close, -it is highly recommended to explicitly close a PIT when you are done with it -in order to avoid consuming unneeded resources in Elasticsearch. - -**`example`** -```ts -const repository = coreStart.savedObjects.createInternalRepository(); - -const { id } = await repository.openPointInTimeForType( - type: 'index-pattern', - { keepAlive: '2m' }, -); - -const response = await repository.find({ - type: 'index-pattern', - search: 'foo*', - sortField: 'name', - sortOrder: 'desc', - pit: { - id: 'abc123', - keepAlive: '2m', - }, - searchAfter: [1234, 'abcd'], -}); - -await repository.closePointInTime(response.pit_id); -``` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | `string` | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsClosePointInTimeResponse`](../interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md)\> - -- [SavedObjectsClosePointInTimeResponse](../interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:384 - -___ - -### collectMultiNamespaceReferences - -▸ **collectMultiNamespaceReferences**(`objects`, `options?`): `Promise`<[`SavedObjectsCollectMultiNamespaceReferencesResponse`](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md)\> - -Gets all references and transitive references of the given objects. Ignores any object and/or reference that is not a multi-namespace -type. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `objects` | [`SavedObjectsCollectMultiNamespaceReferencesObject`](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesObject.md)[] | The objects to get the references for. | -| `options?` | [`SavedObjectsCollectMultiNamespaceReferencesOptions`](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md) | - | - -#### Returns - -`Promise`<[`SavedObjectsCollectMultiNamespaceReferencesResponse`](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:223 - -___ - -### create - -▸ **create**<`T`\>(`type`, `attributes`, `options?`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -Persists an object - -**`property`** {string} [options.id] - force id on creation, not recommended - -**`property`** {boolean} [options.overwrite=false] - -**`property`** {object} [options.migrationVersion=undefined] - -**`property`** {string} [options.namespace] - -**`property`** {array} [options.references=[]] - [{ name, type, id }] - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `attributes` | `T` | -| `options?` | [`SavedObjectsCreateOptions`](../interfaces/client._internal_namespace.SavedObjectsCreateOptions.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -- { id, type, version, attributes } - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:102 - -___ - -### createPointInTimeFinder - -▸ **createPointInTimeFinder**<`T`, `A`\>(`findOptions`, `dependencies?`): [`ISavedObjectsPointInTimeFinder`](../interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md)<`T`, `A`\> - -Returns a [ISavedObjectsPointInTimeFinder](../interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md) to help page through -large sets of saved objects. We strongly recommend using this API for -any `find` queries that might return more than 1000 saved objects, -however this API is only intended for use in server-side "batch" -processing of objects where you are collecting all objects in memory -or streaming them back to the client. - -Do NOT use this API in a route handler to facilitate paging through -saved objects on the client-side unless you are streaming all of the -results back to the client at once. Because the returned generator is -stateful, you cannot rely on subsequent http requests retrieving new -pages from the same Kibana server in multi-instance deployments. - -This generator wraps calls to [SavedObjectsRepository.find](client._internal_namespace.SavedObjectsRepository.md#find) and -iterates over multiple pages of results using `_pit` and `search_after`. -This will open a new Point-In-Time (PIT), and continue paging until a -set of results is received that's smaller than the designated `perPage`. - -Once you have retrieved all of the results you need, it is recommended -to call `close()` to clean up the PIT and prevent Elasticsearch from -consuming resources unnecessarily. This is only required if you are -done iterating and have not yet paged through all of the results: the -PIT will automatically be closed for you once you reach the last page -of results, or if the underlying call to `find` fails for any reason. - -**`example`** -```ts -const findOptions: SavedObjectsCreatePointInTimeFinderOptions = { - type: 'visualization', - search: 'foo*', - perPage: 100, -}; - -const finder = savedObjectsClient.createPointInTimeFinder(findOptions); - -const responses: SavedObjectFindResponse[] = []; -for await (const response of finder.find()) { - responses.push(...response); - if (doneSearching) { - await finder.close(); - } -} -``` - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | -| `A` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `findOptions` | [`SavedObjectsCreatePointInTimeFinderOptions`](../modules/client._internal_namespace.md#savedobjectscreatepointintimefinderoptions) | -| `dependencies?` | [`SavedObjectsCreatePointInTimeFinderDependencies`](../interfaces/client._internal_namespace.SavedObjectsCreatePointInTimeFinderDependencies.md) | - -#### Returns - -[`ISavedObjectsPointInTimeFinder`](../interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md)<`T`, `A`\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:430 - -___ - -### delete - -▸ **delete**(`type`, `id`, `options?`): `Promise`<{}\> - -Deletes an object - -**`property`** {string} [options.namespace] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `options?` | [`SavedObjectsDeleteOptions`](../interfaces/client._internal_namespace.SavedObjectsDeleteOptions.md) | - -#### Returns - -`Promise`<{}\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:127 - -___ - -### deleteByNamespace - -▸ **deleteByNamespace**(`namespace`, `options?`): `Promise`<`any`\> - -Deletes all objects from the provided namespace. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `namespace` | `string` | -| `options?` | [`SavedObjectsDeleteByNamespaceOptions`](../interfaces/client._internal_namespace.SavedObjectsDeleteByNamespaceOptions.md) | - -#### Returns - -`Promise`<`any`\> - -- { took, timed_out, total, deleted, batches, version_conflicts, noops, retries, failures } - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:134 - -___ - -### find - -▸ **find**<`T`, `A`\>(`options`): `Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<`T`, `A`\>\> - -**`property`** {(string|Array)} [options.type] - -**`property`** {string} [options.search] - -**`property`** {string} [options.defaultSearchOperator] - -**`property`** {Array} [options.searchFields] - see Elasticsearch Simple Query String - Query field argument for more information - -**`property`** {integer} [options.page=1] - -**`property`** {integer} [options.perPage=20] - -**`property`** {Array} [options.searchAfter] - -**`property`** {string} [options.sortField] - -**`property`** {string} [options.sortOrder] - -**`property`** {Array} [options.fields] - -**`property`** {string} [options.namespace] - -**`property`** {object} [options.hasReference] - { type, id } - -**`property`** {string} [options.pit] - -**`property`** {string} [options.preference] - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | -| `A` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `options` | [`SavedObjectsFindOptions`](../interfaces/client._internal_namespace.SavedObjectsFindOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsFindResponse`](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md)<`T`, `A`\>\> - -- { saved_objects: [{ id, type, version, attributes }], total, per_page, page } - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:154 - -___ - -### get - -▸ **get**<`T`\>(`type`, `id`, `options?`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -Gets a single object - -**`property`** {string} [options.namespace] - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -- { id, type, version, attributes } - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:194 - -___ - -### incrementCounter - -▸ **incrementCounter**<`T`\>(`type`, `id`, `counterFields`, `options?`): `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -Increments all the specified counter fields (by one by default). Creates the document -if one doesn't exist for the given id. - -**`remarks`** -When supplying a field name like `stats.api.counter` the field name will -be used as-is to create a document like: - `{attributes: {'stats.api.counter': 1}}` -It will not create a nested structure like: - `{attributes: {stats: {api: {counter: 1}}}}` - -When using incrementCounter for collecting usage data, you need to ensure -that usage collection happens on a best-effort basis and doesn't -negatively affect your plugin or users. See https://github.com/elastic/kibana/blob/main/src/plugins/usage_collection/README.mdx#tracking-interactions-with-incrementcounter) - -**`example`** -```ts -const repository = coreStart.savedObjects.createInternalRepository(); - -// Initialize all fields to 0 -repository - .incrementCounter('dashboard_counter_type', 'counter_id', [ - 'stats.apiCalls', - 'stats.sampleDataInstalled', - ], {initialize: true}); - -// Increment the apiCalls field counter -repository - .incrementCounter('dashboard_counter_type', 'counter_id', [ - 'stats.apiCalls', - ]) - -// Increment the apiCalls field counter by 4 -repository - .incrementCounter('dashboard_counter_type', 'counter_id', [ - { fieldName: 'stats.apiCalls' incrementBy: 4 }, - ]) - -// Initialize the document with arbitrary fields if not present -repository.incrementCounter<{ appId: string }>( - 'dashboard_counter_type', - 'counter_id', - [ 'stats.apiCalls'], - { upsertAttributes: { appId: 'myId' } } -) -``` - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `type` | `string` | The type of saved object whose fields should be incremented | -| `id` | `string` | The id of the document whose fields should be incremented | -| `counterFields` | (`string` \| [`SavedObjectsIncrementCounterField`](../interfaces/client._internal_namespace.SavedObjectsIncrementCounterField.md))[] | An array of field names to increment or an array of [SavedObjectsIncrementCounterField](../interfaces/client._internal_namespace.SavedObjectsIncrementCounterField.md) | -| `options?` | [`SavedObjectsIncrementCounterOptions`](../interfaces/client._internal_namespace.SavedObjectsIncrementCounterOptions.md)<`T`\> | [SavedObjectsIncrementCounterOptions](../interfaces/client._internal_namespace.SavedObjectsIncrementCounterOptions.md) | - -#### Returns - -`Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>\> - -The saved object after the specified fields were incremented - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:303 - -___ - -### openPointInTimeForType - -▸ **openPointInTimeForType**(`type`, `[options]?`): `Promise`<[`SavedObjectsOpenPointInTimeResponse`](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md)\> - -Opens a Point In Time (PIT) against the indices for the specified Saved Object types. -The returned `id` can then be passed to `SavedObjects.find` to search against that PIT. - -Only use this API if you have an advanced use case that's not solved by the -[SavedObjectsRepository.createPointInTimeFinder](client._internal_namespace.SavedObjectsRepository.md#createpointintimefinder) method. - -**`example`** -```ts -const { id } = await savedObjectsClient.openPointInTimeForType( - type: 'visualization', - { keepAlive: '5m' }, -); -const page1 = await savedObjectsClient.find({ - type: 'visualization', - sortField: 'updated_at', - sortOrder: 'asc', - pit: { id, keepAlive: '2m' }, -}); -const lastHit = page1.saved_objects[page1.saved_objects.length - 1]; -const page2 = await savedObjectsClient.find({ - type: 'visualization', - sortField: 'updated_at', - sortOrder: 'asc', - pit: { id: page1.pit_id }, - searchAfter: lastHit.sort, -}); -await savedObjectsClient.closePointInTime(page2.pit_id); -``` - -**`property`** {string} [options.keepAlive] - -**`property`** {string} [options.preference] - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `type` | `string` \| `string`[] | | -| `[options]?` | [`SavedObjectsOpenPointInTimeOptions`](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md) | [SavedObjectsOpenPointInTimeOptions](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsOpenPointInTimeResponse`](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md)\> - -- { id: string } - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:342 - -___ - -### removeReferencesTo - -▸ **removeReferencesTo**(`type`, `id`, `options?`): `Promise`<[`SavedObjectsRemoveReferencesToResponse`](../interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md)\> - -Updates all objects containing a reference to the given {type, id} tuple to remove the said reference. - -**`remarks`** Will throw a conflict error if the `update_by_query` operation returns any failure. In that case - some references might have been removed, and some were not. It is the caller's responsibility - to handle and fix this situation if it was to happen. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `options?` | [`SavedObjectsRemoveReferencesToOptions`](../interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsRemoveReferencesToResponse`](../interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:249 - -___ - -### resolve - -▸ **resolve**<`T`\>(`type`, `id`, `options?`): `Promise`<[`SavedObjectsResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsResolveResponse.md)<`T`\>\> - -Resolves a single object, using any legacy URL alias if it exists - -**`property`** {string} [options.namespace] - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `options?` | [`SavedObjectsBaseOptions`](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsResolveResponse`](../interfaces/client._internal_namespace.SavedObjectsResolveResponse.md)<`T`\>\> - -- { saved_object, outcome } - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:204 - -___ - -### update - -▸ **update**<`T`\>(`type`, `id`, `attributes`, `options?`): `Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<`T`\>\> - -Updates an object - -**`property`** {string} options.version - ensures version matches that of persisted object - -**`property`** {string} [options.namespace] - -**`property`** {array} [options.references] - [{ name, type, id }] - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `attributes` | `Partial`<`T`\> | -| `options?` | [`SavedObjectsUpdateOptions`](../interfaces/client._internal_namespace.SavedObjectsUpdateOptions.md)<`T`\> | - -#### Returns - -`Promise`<[`SavedObjectsUpdateResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md)<`T`\>\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:216 - -___ - -### updateObjectsSpaces - -▸ **updateObjectsSpaces**(`objects`, `spacesToAdd`, `spacesToRemove`, `options?`): `Promise`<[`SavedObjectsUpdateObjectsSpacesResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md)\> - -Updates one or more objects to add and/or remove them from specified spaces. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `objects` | [`SavedObjectsUpdateObjectsSpacesObject`](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md)[] | -| `spacesToAdd` | `string`[] | -| `spacesToRemove` | `string`[] | -| `options?` | [`SavedObjectsUpdateObjectsSpacesOptions`](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md) | - -#### Returns - -`Promise`<[`SavedObjectsUpdateObjectsSpacesResponse`](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:232 - -___ - -### createRepository - -▸ `Static` **createRepository**(`migrator`, `typeRegistry`, `indexName`, `client`, `logger`, `includedHiddenTypes?`, `injectedConstructor?`): [`ISavedObjectsRepository`](../modules/client._internal_namespace.md#isavedobjectsrepository) - -A factory function for creating SavedObjectRepository instances. - -**`internalremarks`** -Tests are located in ./repository_create_repository.test.ts - -**`internal`** - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `migrator` | [`IKibanaMigrator`](../modules/client._internal_namespace.md#ikibanamigrator) | -| `typeRegistry` | [`ISavedObjectTypeRegistry`](../modules/client._internal_namespace.md#isavedobjecttyperegistry) | -| `indexName` | `string` | -| `client` | [`ElasticsearchClient`](../modules/client._internal_namespace.md#elasticsearchclient) | -| `logger` | `Logger` | -| `includedHiddenTypes?` | `string`[] | -| `injectedConstructor?` | `any` | - -#### Returns - -[`ISavedObjectsRepository`](../modules/client._internal_namespace.md#isavedobjectsrepository) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:87 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SpaceActions.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SpaceActions.md deleted file mode 100644 index b39329e27b8ba..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SpaceActions.md +++ /dev/null @@ -1,59 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SpaceActions - -# Class: SpaceActions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SpaceActions - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.SpaceActions.md#constructor) - -### Properties - -- [prefix](client._internal_namespace.SpaceActions.md#prefix) - -### Accessors - -- [manage](client._internal_namespace.SpaceActions.md#manage) - -## Constructors - -### constructor - -• **new SpaceActions**(`versionNumber`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionNumber` | `string` | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/space.d.ts:3 - -## Properties - -### prefix - -• `Private` `Readonly` **prefix**: `any` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/space.d.ts:2 - -## Accessors - -### manage - -• `get` **manage**(): `string` - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/space.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SubFeature.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SubFeature.md deleted file mode 100644 index 4e300b2231285..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.SubFeature.md +++ /dev/null @@ -1,97 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SubFeature - -# Class: SubFeature - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SubFeature - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.SubFeature.md#constructor) - -### Properties - -- [config](client._internal_namespace.SubFeature.md#config) - -### Accessors - -- [name](client._internal_namespace.SubFeature.md#name) -- [privilegeGroups](client._internal_namespace.SubFeature.md#privilegegroups) - -### Methods - -- [toRaw](client._internal_namespace.SubFeature.md#toraw) - -## Constructors - -### constructor - -• **new SubFeature**(`config`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `config` | `Readonly`<{ `name`: `string` ; `privilegeGroups`: readonly `Readonly`<{ groupType: SubFeaturePrivilegeGroupType; privileges: readonly Readonly<{ id: string; name: string; includeIn: "all" \| "none" \| "read"; minimumLicense?: "basic" \| "standard" \| ... 4 more ... \| undefined; ... 9 more ...; ui: readonly string[]; }\>[]; }\>[] }\> | - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:66 - -## Properties - -### config - -• `Protected` `Readonly` **config**: `Readonly`<{ `name`: `string` ; `privilegeGroups`: readonly `Readonly`<{ groupType: SubFeaturePrivilegeGroupType; privileges: readonly Readonly<{ id: string; name: string; includeIn: "all" \| "none" \| "read"; minimumLicense?: "basic" \| "standard" \| ... 4 more ... \| undefined; ... 9 more ...; ui: readonly string[]; }\>[]; }\>[] }\> - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:65 - -## Accessors - -### name - -• `get` **name**(): `string` - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:67 - -___ - -### privilegeGroups - -• `get` **privilegeGroups**(): readonly `Readonly`<{ `groupType`: [`SubFeaturePrivilegeGroupType`](../modules/client._internal_namespace.md#subfeatureprivilegegrouptype) ; `privileges`: readonly Readonly<{ id: string; name: string; includeIn: "all" \| "none" \| "read"; minimumLicense?: "basic" \| "standard" \| "gold" \| "platinum" \| "enterprise" \| "trial" \| undefined; management?: Readonly<{ [x: string]: readonly string[]; }\> \| undefined; ... 8 more ...; savedObject: Readonly<...\>; }\>[] }\>[] - -#### Returns - -readonly `Readonly`<{ `groupType`: [`SubFeaturePrivilegeGroupType`](../modules/client._internal_namespace.md#subfeatureprivilegegrouptype) ; `privileges`: readonly Readonly<{ id: string; name: string; includeIn: "all" \| "none" \| "read"; minimumLicense?: "basic" \| "standard" \| "gold" \| "platinum" \| "enterprise" \| "trial" \| undefined; management?: Readonly<{ [x: string]: readonly string[]; }\> \| undefined; ... 8 more ...; savedObject: Readonly<...\>; }\>[] }\>[] - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:68 - -## Methods - -### toRaw - -▸ **toRaw**(): `Object` - -#### Returns - -`Object` - -| Name | Type | -| :------ | :------ | -| `name` | `string` | -| `privilegeGroups` | readonly `Readonly`<{ `groupType`: [`SubFeaturePrivilegeGroupType`](../modules/client._internal_namespace.md#subfeatureprivilegegrouptype) ; `privileges`: readonly Readonly<{ id: string; name: string; includeIn: "all" \| "none" \| "read"; minimumLicense?: "basic" \| "standard" \| "gold" \| "platinum" \| "enterprise" \| "trial" \| undefined; management?: Readonly<{ [x: string]: readonly string[]; }\> \| undefined; ... 8 more ...; savedObject: Readonly<...\>; }\>[] }\>[] | - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:104 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.TaskRunnerFactory.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.TaskRunnerFactory.md deleted file mode 100644 index 7aed74f96c698..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.TaskRunnerFactory.md +++ /dev/null @@ -1,114 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / TaskRunnerFactory - -# Class: TaskRunnerFactory - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).TaskRunnerFactory - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.TaskRunnerFactory.md#constructor) - -### Properties - -- [actionExecutor](client._internal_namespace.TaskRunnerFactory.md#actionexecutor) -- [isInitialized](client._internal_namespace.TaskRunnerFactory.md#isinitialized) -- [taskRunnerContext](client._internal_namespace.TaskRunnerFactory.md#taskrunnercontext) - -### Methods - -- [create](client._internal_namespace.TaskRunnerFactory.md#create) -- [initialize](client._internal_namespace.TaskRunnerFactory.md#initialize) - -## Constructors - -### constructor - -• **new TaskRunnerFactory**(`actionExecutor`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionExecutor` | [`ActionExecutorContract`](../modules/client._internal_namespace.md#actionexecutorcontract) | - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:18 - -## Properties - -### actionExecutor - -• `Private` `Readonly` **actionExecutor**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:17 - -___ - -### isInitialized - -• `Private` **isInitialized**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:15 - -___ - -### taskRunnerContext - -• `Private` `Optional` **taskRunnerContext**: `any` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:16 - -## Methods - -### create - -▸ **create**(`__namedParameters`, `maxAttempts?`): `Object` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`RunContext`](../interfaces/client._internal_namespace.RunContext.md) | -| `maxAttempts?` | `number` | - -#### Returns - -`Object` - -| Name | Type | -| :------ | :------ | -| `cancel` | () => `Promise`<{ `state`: {} }\> | -| `run` | () => `Promise`<`void`\> | - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:20 - -___ - -### initialize - -▸ **initialize**(`taskRunnerContext`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `taskRunnerContext` | [`TaskRunnerContext`](../interfaces/client._internal_namespace.TaskRunnerContext.md) | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:19 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.UIActions.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.UIActions.md deleted file mode 100644 index 8f74b5fff8806..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.UIActions.md +++ /dev/null @@ -1,66 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / UIActions - -# Class: UIActions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).UIActions - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.UIActions.md#constructor) - -### Properties - -- [prefix](client._internal_namespace.UIActions.md#prefix) - -### Methods - -- [get](client._internal_namespace.UIActions.md#get) - -## Constructors - -### constructor - -• **new UIActions**(`versionNumber`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `versionNumber` | `string` | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/ui.d.ts:4 - -## Properties - -### prefix - -• `Private` `Readonly` **prefix**: `any` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/ui.d.ts:3 - -## Methods - -### get - -▸ **get**(`featureId`, ...`uiCapabilityParts`): `string` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `featureId` | keyof [`Capabilities`](../interfaces/client._internal_namespace.Capabilities.md) | -| `...uiCapabilityParts` | `string`[] | - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/actions/ui.d.ts:5 diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.UserActionBuilder.md b/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.UserActionBuilder.md deleted file mode 100644 index 361d5e50fd923..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client._internal_namespace.UserActionBuilder.md +++ /dev/null @@ -1,251 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / UserActionBuilder - -# Class: UserActionBuilder - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).UserActionBuilder - -## Table of contents - -### Constructors - -- [constructor](client._internal_namespace.UserActionBuilder.md#constructor) - -### Methods - -- [build](client._internal_namespace.UserActionBuilder.md#build) -- [buildCommonUserAction](client._internal_namespace.UserActionBuilder.md#buildcommonuseraction) -- [createActionReference](client._internal_namespace.UserActionBuilder.md#createactionreference) -- [createCaseReferences](client._internal_namespace.UserActionBuilder.md#createcasereferences) -- [createCommentReferences](client._internal_namespace.UserActionBuilder.md#createcommentreferences) -- [createConnectorPushReference](client._internal_namespace.UserActionBuilder.md#createconnectorpushreference) -- [createConnectorReference](client._internal_namespace.UserActionBuilder.md#createconnectorreference) -- [extractConnectorId](client._internal_namespace.UserActionBuilder.md#extractconnectorid) -- [extractConnectorIdFromExternalService](client._internal_namespace.UserActionBuilder.md#extractconnectoridfromexternalservice) -- [getCommonUserActionAttributes](client._internal_namespace.UserActionBuilder.md#getcommonuseractionattributes) - -## Constructors - -### constructor - -• **new UserActionBuilder**() - -## Methods - -### build - -▸ `Abstract` **build**<`T`\>(`args`): [`BuilderReturnValue`](../interfaces/client._internal_namespace.BuilderReturnValue.md) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | extends keyof [`BuilderParameters`](../interfaces/client._internal_namespace.BuilderParameters.md) | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `args` | [`UserActionParameters`](../modules/client._internal_namespace.md#useractionparameters)<`T`\> | - -#### Returns - -[`BuilderReturnValue`](../interfaces/client._internal_namespace.BuilderReturnValue.md) - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:119](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L119) - -___ - -### buildCommonUserAction - -▸ `Protected` **buildCommonUserAction**(`__namedParameters`): [`BuilderReturnValue`](../interfaces/client._internal_namespace.BuilderReturnValue.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CommonBuilderArguments`](../modules/client._internal_namespace.md#commonbuilderarguments) | - -#### Returns - -[`BuilderReturnValue`](../interfaces/client._internal_namespace.BuilderReturnValue.md) - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:88](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L88) - -___ - -### createActionReference - -▸ `Protected` **createActionReference**(`id`, `name`): [`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | ``null`` \| `string` | -| `name` | `string` | - -#### Returns - -[`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:55](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L55) - -___ - -### createCaseReferences - -▸ `Protected` **createCaseReferences**(`caseId`): [`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `caseId` | `string` | - -#### Returns - -[`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:45](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L45) - -___ - -### createCommentReferences - -▸ `Protected` **createCommentReferences**(`id`): [`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | ``null`` \| `string` | - -#### Returns - -[`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:61](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L61) - -___ - -### createConnectorPushReference - -▸ `Protected` **createConnectorPushReference**(`id`): [`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | ``null`` \| `string` | - -#### Returns - -[`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:77](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L77) - -___ - -### createConnectorReference - -▸ `Protected` **createConnectorReference**(`id`): [`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `id` | ``null`` \| `string` | - -#### Returns - -[`SavedObjectReference`](../interfaces/client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:73](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L73) - -___ - -### extractConnectorId - -▸ `Protected` **extractConnectorId**(`connector`): `Omit`<{ `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string }, ``"id"``\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `connector` | { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } | - -#### Returns - -`Omit`<{ `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string }, ``"id"``\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:40](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L40) - -___ - -### extractConnectorIdFromExternalService - -▸ `Protected` **extractConnectorIdFromExternalService**(`externalService`): `Omit`<{ `connector_id`: `string` = rt.string } & { `connector_name`: `string` = rt.string; `external_id`: `string` = rt.string; `external_title`: `string` = rt.string; `external_url`: `string` = rt.string; `pushed_at`: `string` = rt.string; `pushed_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT }, ``"connector_id"``\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `externalService` | { `connector_id`: `string` = rt.string } & { `connector_name`: `string` = rt.string; `external_id`: `string` = rt.string; `external_title`: `string` = rt.string; `external_url`: `string` = rt.string; `pushed_at`: `string` = rt.string; `pushed_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT } | - -#### Returns - -`Omit`<{ `connector_id`: `string` = rt.string } & { `connector_name`: `string` = rt.string; `external_id`: `string` = rt.string; `external_title`: `string` = rt.string; `external_url`: `string` = rt.string; `pushed_at`: `string` = rt.string; `pushed_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT }, ``"connector_id"``\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:81](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L81) - -___ - -### getCommonUserActionAttributes - -▸ `Protected` **getCommonUserActionAttributes**(`__namedParameters`): `Object` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.owner` | `string` | -| `__namedParameters.user` | `Object` | -| `__namedParameters.user.email` | `undefined` \| ``null`` \| `string` | -| `__namedParameters.user.full_name` | `undefined` \| ``null`` \| `string` | -| `__namedParameters.user.username` | `undefined` \| ``null`` \| `string` | - -#### Returns - -`Object` - -| Name | Type | -| :------ | :------ | -| `created_at` | `string` | -| `created_by` | `Object` | -| `created_by.email` | `undefined` \| ``null`` \| `string` | -| `created_by.full_name` | `undefined` \| ``null`` \| `string` | -| `created_by.username` | `undefined` \| ``null`` \| `string` | -| `owner` | `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts:32](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/abstract_builder.ts#L32) diff --git a/x-pack/plugins/cases/docs/cases_client/classes/client.casesclient.md b/x-pack/plugins/cases/docs/cases_client/classes/client.casesclient.md deleted file mode 100644 index d00f9f0edcd88..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/classes/client.casesclient.md +++ /dev/null @@ -1,214 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / CasesClient - -# Class: CasesClient - -[client](../modules/client.md).CasesClient - -Client wrapper that contains accessor methods for individual entities within the cases system. - -## Table of contents - -### Constructors - -- [constructor](client.CasesClient.md#constructor) - -### Properties - -- [\_attachments](client.CasesClient.md#_attachments) -- [\_cases](client.CasesClient.md#_cases) -- [\_casesClientInternal](client.CasesClient.md#_casesclientinternal) -- [\_configure](client.CasesClient.md#_configure) -- [\_metrics](client.CasesClient.md#_metrics) -- [\_stats](client.CasesClient.md#_stats) -- [\_userActions](client.CasesClient.md#_useractions) - -### Accessors - -- [attachments](client.CasesClient.md#attachments) -- [cases](client.CasesClient.md#cases) -- [configure](client.CasesClient.md#configure) -- [metrics](client.CasesClient.md#metrics) -- [stats](client.CasesClient.md#stats) -- [userActions](client.CasesClient.md#useractions) - -## Constructors - -### constructor - -• **new CasesClient**(`args`) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `args` | [`CasesClientArgs`](../interfaces/client._internal_namespace.CasesClientArgs.md) | - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:29](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L29) - -## Properties - -### \_attachments - -• `Private` `Readonly` **\_attachments**: [`AttachmentsSubClient`](../interfaces/attachments_client.AttachmentsSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:23](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L23) - -___ - -### \_cases - -• `Private` `Readonly` **\_cases**: [`CasesSubClient`](../interfaces/cases_client.CasesSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:22](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L22) - -___ - -### \_casesClientInternal - -• `Private` `Readonly` **\_casesClientInternal**: [`CasesClientInternal`](client._internal_namespace.CasesClientInternal.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:21](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L21) - -___ - -### \_configure - -• `Private` `Readonly` **\_configure**: [`ConfigureSubClient`](../interfaces/configure_client.ConfigureSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:25](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L25) - -___ - -### \_metrics - -• `Private` `Readonly` **\_metrics**: [`MetricsSubClient`](../interfaces/metrics_client.MetricsSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:27](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L27) - -___ - -### \_stats - -• `Private` `Readonly` **\_stats**: [`StatsSubClient`](../interfaces/stats_client.StatsSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:26](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L26) - -___ - -### \_userActions - -• `Private` `Readonly` **\_userActions**: [`UserActionsSubClient`](../interfaces/user_actions_client.UserActionsSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:24](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L24) - -## Accessors - -### attachments - -• `get` **attachments**(): [`AttachmentsSubClient`](../interfaces/attachments_client.AttachmentsSubClient.md) - -Retrieves an interface for interacting with attachments (comments) entities. - -#### Returns - -[`AttachmentsSubClient`](../interfaces/attachments_client.AttachmentsSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:49](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L49) - -___ - -### cases - -• `get` **cases**(): [`CasesSubClient`](../interfaces/cases_client.CasesSubClient.md) - -Retrieves an interface for interacting with cases entities. - -#### Returns - -[`CasesSubClient`](../interfaces/cases_client.CasesSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:42](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L42) - -___ - -### configure - -• `get` **configure**(): [`ConfigureSubClient`](../interfaces/configure_client.ConfigureSubClient.md) - -Retrieves an interface for interacting with the configuration of external connectors for the plugin entities. - -#### Returns - -[`ConfigureSubClient`](../interfaces/configure_client.ConfigureSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:63](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L63) - -___ - -### metrics - -• `get` **metrics**(): [`MetricsSubClient`](../interfaces/metrics_client.MetricsSubClient.md) - -Retrieves an interface for retrieving metrics related to the cases entities. - -#### Returns - -[`MetricsSubClient`](../interfaces/metrics_client.MetricsSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:77](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L77) - -___ - -### stats - -• `get` **stats**(): [`StatsSubClient`](../interfaces/stats_client.StatsSubClient.md) - -Retrieves an interface for retrieving statistics related to the cases entities. - -#### Returns - -[`StatsSubClient`](../interfaces/stats_client.StatsSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:70](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L70) - -___ - -### userActions - -• `get` **userActions**(): [`UserActionsSubClient`](../interfaces/user_actions_client.UserActionsSubClient.md) - -Retrieves an interface for interacting with the user actions associated with the plugin entities. - -#### Returns - -[`UserActionsSubClient`](../interfaces/user_actions_client.UserActionsSubClient.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/client.ts:56](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/client.ts#L56) diff --git a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.ActionExecutionSourceType.md b/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.ActionExecutionSourceType.md deleted file mode 100644 index 9d4fbc639a26c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.ActionExecutionSourceType.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionExecutionSourceType - -# Enumeration: ActionExecutionSourceType - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionExecutionSourceType - -## Table of contents - -### Enumeration members - -- [HTTP\_REQUEST](client._internal_namespace.ActionExecutionSourceType.md#http_request) -- [SAVED\_OBJECT](client._internal_namespace.ActionExecutionSourceType.md#saved_object) - -## Enumeration members - -### HTTP\_REQUEST - -• **HTTP\_REQUEST** = `"HTTP_REQUEST"` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_execution_source.d.ts:4 - -___ - -### SAVED\_OBJECT - -• **SAVED\_OBJECT** = `"SAVED_OBJECT"` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_execution_source.d.ts:3 diff --git a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.AuthorizationMode.md b/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.AuthorizationMode.md deleted file mode 100644 index f1dc071f463d6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.AuthorizationMode.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuthorizationMode - -# Enumeration: AuthorizationMode - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuthorizationMode - -## Table of contents - -### Enumeration members - -- [Legacy](client._internal_namespace.AuthorizationMode.md#legacy) -- [RBAC](client._internal_namespace.AuthorizationMode.md#rbac) - -## Enumeration members - -### Legacy - -• **Legacy** = `0` - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/get_authorization_mode_by_source.d.ts:4 - -___ - -### RBAC - -• **RBAC** = `1` - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/get_authorization_mode_by_source.d.ts:5 diff --git a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.CaseStatuses.md b/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.CaseStatuses.md deleted file mode 100644 index 48d5689a52400..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.CaseStatuses.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CaseStatuses - -# Enumeration: CaseStatuses - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CaseStatuses - -## Table of contents - -### Enumeration members - -- [closed](client._internal_namespace.CaseStatuses.md#closed) -- [in-progress](client._internal_namespace.CaseStatuses.md#in-progress) -- [open](client._internal_namespace.CaseStatuses.md#open) - -## Enumeration members - -### closed - -• **closed** = `"closed"` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/status.ts:13](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/status.ts#L13) - -___ - -### in-progress - -• **in-progress** = `"in-progress"` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/status.ts:12](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/status.ts#L12) - -___ - -### open - -• **open** = `"open"` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/status.ts:11](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/status.ts#L11) diff --git a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.TaskStatus.md b/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.TaskStatus.md deleted file mode 100644 index a92a96681e137..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.TaskStatus.md +++ /dev/null @@ -1,65 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / TaskStatus - -# Enumeration: TaskStatus - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).TaskStatus - -## Table of contents - -### Enumeration members - -- [Claiming](client._internal_namespace.TaskStatus.md#claiming) -- [Failed](client._internal_namespace.TaskStatus.md#failed) -- [Idle](client._internal_namespace.TaskStatus.md#idle) -- [Running](client._internal_namespace.TaskStatus.md#running) -- [Unrecognized](client._internal_namespace.TaskStatus.md#unrecognized) - -## Enumeration members - -### Claiming - -• **Claiming** = `"claiming"` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:124 - -___ - -### Failed - -• **Failed** = `"failed"` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:126 - -___ - -### Idle - -• **Idle** = `"idle"` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:123 - -___ - -### Running - -• **Running** = `"running"` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:125 - -___ - -### Unrecognized - -• **Unrecognized** = `"unrecognized"` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:127 diff --git a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.ViewMode.md b/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.ViewMode.md deleted file mode 100644 index c00d063ffc864..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/enums/client._internal_namespace.ViewMode.md +++ /dev/null @@ -1,54 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ViewMode - -# Enumeration: ViewMode - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ViewMode - -## Table of contents - -### Enumeration members - -- [EDIT](client._internal_namespace.ViewMode.md#edit) -- [PREVIEW](client._internal_namespace.ViewMode.md#preview) -- [PRINT](client._internal_namespace.ViewMode.md#print) -- [VIEW](client._internal_namespace.ViewMode.md#view) - -## Enumeration members - -### EDIT - -• **EDIT** = `"edit"` - -#### Defined in - -src/plugins/embeddable/target/types/common/types.d.ts:5 - -___ - -### PREVIEW - -• **PREVIEW** = `"preview"` - -#### Defined in - -src/plugins/embeddable/target/types/common/types.d.ts:6 - -___ - -### PRINT - -• **PRINT** = `"print"` - -#### Defined in - -src/plugins/embeddable/target/types/common/types.d.ts:7 - -___ - -### VIEW - -• **VIEW** = `"view"` - -#### Defined in - -src/plugins/embeddable/target/types/common/types.d.ts:8 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.AddArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.AddArgs.md deleted file mode 100644 index b1a96017c439b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.AddArgs.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / [\_internal\_namespace](../modules/attachments_client._internal_namespace.md) / AddArgs - -# Interface: AddArgs - -[attachments/client](../modules/attachments_client.md).[_internal_namespace](../modules/attachments_client._internal_namespace.md).AddArgs - -The arguments needed for creating a new attachment to a case. - -## Table of contents - -### Properties - -- [caseId](attachments_client._internal_namespace.AddArgs.md#caseid) -- [comment](attachments_client._internal_namespace.AddArgs.md#comment) - -## Properties - -### caseId - -• **caseId**: `string` - -The case ID that this attachment will be associated with - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/add.ts:77](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/add.ts#L77) - -___ - -### comment - -• **comment**: { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } - -The attachment values. - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/add.ts:81](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/add.ts#L81) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.DeleteAllArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.DeleteAllArgs.md deleted file mode 100644 index d2f34ab040eb3..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.DeleteAllArgs.md +++ /dev/null @@ -1,25 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / [\_internal\_namespace](../modules/attachments_client._internal_namespace.md) / DeleteAllArgs - -# Interface: DeleteAllArgs - -[attachments/client](../modules/attachments_client.md).[_internal_namespace](../modules/attachments_client._internal_namespace.md).DeleteAllArgs - -Parameters for deleting all comments of a case. - -## Table of contents - -### Properties - -- [caseID](attachments_client._internal_namespace.DeleteAllArgs.md#caseid) - -## Properties - -### caseID - -• **caseID**: `string` - -The case ID to delete all attachments for - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/delete.ts:25](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/delete.ts#L25) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.DeleteArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.DeleteArgs.md deleted file mode 100644 index 0bee9af6c4f24..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.DeleteArgs.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / [\_internal\_namespace](../modules/attachments_client._internal_namespace.md) / DeleteArgs - -# Interface: DeleteArgs - -[attachments/client](../modules/attachments_client.md).[_internal_namespace](../modules/attachments_client._internal_namespace.md).DeleteArgs - -Parameters for deleting a single attachment of a case. - -## Table of contents - -### Properties - -- [attachmentID](attachments_client._internal_namespace.DeleteArgs.md#attachmentid) -- [caseID](attachments_client._internal_namespace.DeleteArgs.md#caseid) - -## Properties - -### attachmentID - -• **attachmentID**: `string` - -The attachment ID to delete - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/delete.ts:39](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/delete.ts#L39) - -___ - -### caseID - -• **caseID**: `string` - -The case ID to delete an attachment from - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/delete.ts:35](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/delete.ts#L35) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.FindArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.FindArgs.md deleted file mode 100644 index 2fd5a356bc6f5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.FindArgs.md +++ /dev/null @@ -1,54 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / [\_internal\_namespace](../modules/attachments_client._internal_namespace.md) / FindArgs - -# Interface: FindArgs - -[attachments/client](../modules/attachments_client.md).[_internal_namespace](../modules/attachments_client._internal_namespace.md).FindArgs - -Parameters for finding attachments of a case - -## Table of contents - -### Properties - -- [caseID](attachments_client._internal_namespace.FindArgs.md#caseid) -- [queryParams](attachments_client._internal_namespace.FindArgs.md#queryparams) - -## Properties - -### caseID - -• **caseID**: `string` - -The case ID for finding associated attachments - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/get.ts:42](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/get.ts#L42) - -___ - -### queryParams - -• `Optional` **queryParams**: `Object` - -Optional parameters for filtering the returned attachments - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `defaultSearchOperator` | `undefined` \| ``"AND"`` \| ``"OR"`` | -| `fields` | `undefined` \| `string`[] | -| `filter` | `undefined` \| `string` | -| `hasReference` | `undefined` \| { `id`: `string` = rt.string; `type`: `string` = rt.string } \| { `id`: `string` = rt.string; `type`: `string` = rt.string }[] | -| `hasReferenceOperator` | `undefined` \| ``"AND"`` \| ``"OR"`` | -| `page` | `undefined` \| `number` | -| `perPage` | `undefined` \| `number` | -| `search` | `undefined` \| `string` | -| `searchFields` | `undefined` \| `string`[] | -| `sortField` | `undefined` \| `string` | -| `sortOrder` | `undefined` \| ``"desc"`` \| ``"asc"`` | - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/get.ts:46](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/get.ts#L46) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetAllAlertsAttachToCase.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetAllAlertsAttachToCase.md deleted file mode 100644 index d45019010a3d6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetAllAlertsAttachToCase.md +++ /dev/null @@ -1,23 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / [\_internal\_namespace](../modules/attachments_client._internal_namespace.md) / GetAllAlertsAttachToCase - -# Interface: GetAllAlertsAttachToCase - -[attachments/client](../modules/attachments_client.md).[_internal_namespace](../modules/attachments_client._internal_namespace.md).GetAllAlertsAttachToCase - -## Table of contents - -### Properties - -- [caseId](attachments_client._internal_namespace.GetAllAlertsAttachToCase.md#caseid) - -## Properties - -### caseId - -• **caseId**: `string` - -The ID of the case to retrieve the alerts from - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/get.ts:74](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/get.ts#L74) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetAllArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetAllArgs.md deleted file mode 100644 index f5ebbd40a2d08..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetAllArgs.md +++ /dev/null @@ -1,25 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / [\_internal\_namespace](../modules/attachments_client._internal_namespace.md) / GetAllArgs - -# Interface: GetAllArgs - -[attachments/client](../modules/attachments_client.md).[_internal_namespace](../modules/attachments_client._internal_namespace.md).GetAllArgs - -Parameters for retrieving all attachments of a case - -## Table of contents - -### Properties - -- [caseID](attachments_client._internal_namespace.GetAllArgs.md#caseid) - -## Properties - -### caseID - -• **caseID**: `string` - -The case ID to retrieve all attachments for - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/get.ts:56](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/get.ts#L56) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetArgs.md deleted file mode 100644 index 8c36ea3ab2f12..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.GetArgs.md +++ /dev/null @@ -1,36 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / [\_internal\_namespace](../modules/attachments_client._internal_namespace.md) / GetArgs - -# Interface: GetArgs - -[attachments/client](../modules/attachments_client.md).[_internal_namespace](../modules/attachments_client._internal_namespace.md).GetArgs - -## Table of contents - -### Properties - -- [attachmentID](attachments_client._internal_namespace.GetArgs.md#attachmentid) -- [caseID](attachments_client._internal_namespace.GetArgs.md#caseid) - -## Properties - -### attachmentID - -• **attachmentID**: `string` - -The ID of the attachment to retrieve - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/get.ts:67](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/get.ts#L67) - -___ - -### caseID - -• **caseID**: `string` - -The ID of the case to retrieve an attachment from - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/get.ts:63](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/get.ts#L63) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.UpdateArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.UpdateArgs.md deleted file mode 100644 index 75650928ba124..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client._internal_namespace.UpdateArgs.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / [\_internal\_namespace](../modules/attachments_client._internal_namespace.md) / UpdateArgs - -# Interface: UpdateArgs - -[attachments/client](../modules/attachments_client.md).[_internal_namespace](../modules/attachments_client._internal_namespace.md).UpdateArgs - -Parameters for updating a single attachment - -## Table of contents - -### Properties - -- [caseID](attachments_client._internal_namespace.UpdateArgs.md#caseid) -- [updateRequest](attachments_client._internal_namespace.UpdateArgs.md#updaterequest) - -## Properties - -### caseID - -• **caseID**: `string` - -The ID of the case that is associated with this attachment - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/update.ts:28](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/update.ts#L28) - -___ - -### updateRequest - -• **updateRequest**: { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `id`: `string` = rt.string; `version`: `string` = rt.string } - -The full attachment request with the fields updated with appropriate values - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/update.ts:32](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/update.ts#L32) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client.attachmentssubclient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client.attachmentssubclient.md deleted file mode 100644 index 04b77c2141ed8..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/attachments_client.attachmentssubclient.md +++ /dev/null @@ -1,198 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](../modules/attachments_client.md) / AttachmentsSubClient - -# Interface: AttachmentsSubClient - -[attachments/client](../modules/attachments_client.md).AttachmentsSubClient - -API for interacting with the attachments to a case. - -## Table of contents - -### Methods - -- [add](attachments_client.AttachmentsSubClient.md#add) -- [delete](attachments_client.AttachmentsSubClient.md#delete) -- [deleteAll](attachments_client.AttachmentsSubClient.md#deleteall) -- [find](attachments_client.AttachmentsSubClient.md#find) -- [get](attachments_client.AttachmentsSubClient.md#get) -- [getAll](attachments_client.AttachmentsSubClient.md#getall) -- [getAllAlertsAttachToCase](attachments_client.AttachmentsSubClient.md#getallalertsattachtocase) -- [update](attachments_client.AttachmentsSubClient.md#update) - -## Methods - -### add - -▸ **add**(`params`): `Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -Adds an attachment to a case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`AddArgs`](attachments_client._internal_namespace.AddArgs.md) | - -#### Returns - -`Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/client.ts:35](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/client.ts#L35) - -___ - -### delete - -▸ **delete**(`deleteArgs`): `Promise`<`void`\> - -Deletes a single attachment for a specific case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `deleteArgs` | [`DeleteArgs`](attachments_client._internal_namespace.DeleteArgs.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/client.ts:43](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/client.ts#L43) - -___ - -### deleteAll - -▸ **deleteAll**(`deleteAllArgs`): `Promise`<`void`\> - -Deletes all attachments associated with a single case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `deleteAllArgs` | [`DeleteAllArgs`](attachments_client._internal_namespace.DeleteAllArgs.md) | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/client.ts:39](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/client.ts#L39) - -___ - -### find - -▸ **find**(`findArgs`): `Promise`<[`ICommentsResponse`](typedoc_interfaces.ICommentsResponse.md)\> - -Retrieves all comments matching the search criteria. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `findArgs` | [`FindArgs`](attachments_client._internal_namespace.FindArgs.md) | - -#### Returns - -`Promise`<[`ICommentsResponse`](typedoc_interfaces.ICommentsResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/client.ts:47](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/client.ts#L47) - -___ - -### get - -▸ **get**(`getArgs`): `Promise`<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string }\> - -Retrieves a single attachment for a case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `getArgs` | [`GetArgs`](attachments_client._internal_namespace.GetArgs.md) | - -#### Returns - -`Promise`<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string }\> - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/client.ts:59](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/client.ts#L59) - -___ - -### getAll - -▸ **getAll**(`getAllArgs`): `Promise`<[`IAllCommentsResponse`](typedoc_interfaces.IAllCommentsResponse.md)\> - -Gets all attachments for a single case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `getAllArgs` | [`GetAllArgs`](attachments_client._internal_namespace.GetAllArgs.md) | - -#### Returns - -`Promise`<[`IAllCommentsResponse`](typedoc_interfaces.IAllCommentsResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/client.ts:55](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/client.ts#L55) - -___ - -### getAllAlertsAttachToCase - -▸ **getAllAlertsAttachToCase**(`params`): `Promise`<{ `attached_at`: `string` = rt.string; `id`: `string` = rt.string; `index`: `string` = rt.string }[]\> - -Retrieves all alerts attach to a case given a single case ID - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`GetAllAlertsAttachToCase`](attachments_client._internal_namespace.GetAllAlertsAttachToCase.md) | - -#### Returns - -`Promise`<{ `attached_at`: `string` = rt.string; `id`: `string` = rt.string; `index`: `string` = rt.string }[]\> - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/client.ts:51](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/client.ts#L51) - -___ - -### update - -▸ **update**(`updateArgs`): `Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -Updates a specific attachment. - -The request must include all fields for the attachment. Even the fields that are not changing. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `updateArgs` | [`UpdateArgs`](attachments_client._internal_namespace.UpdateArgs.md) | - -#### Returns - -`Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/attachments/client.ts:65](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/attachments/client.ts#L65) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/cases_client.casessubclient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/cases_client.casessubclient.md deleted file mode 100644 index df4d1bdf7966f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/cases_client.casessubclient.md +++ /dev/null @@ -1,249 +0,0 @@ -[Cases Client API Interface](../README.md) / [cases/client](../modules/cases_client.md) / CasesSubClient - -# Interface: CasesSubClient - -[cases/client](../modules/cases_client.md).CasesSubClient - -API for interacting with the cases entities. - -## Table of contents - -### Methods - -- [create](cases_client.CasesSubClient.md#create) -- [delete](cases_client.CasesSubClient.md#delete) -- [find](cases_client.CasesSubClient.md#find) -- [get](cases_client.CasesSubClient.md#get) -- [getCasesByAlertID](cases_client.CasesSubClient.md#getcasesbyalertid) -- [getReporters](cases_client.CasesSubClient.md#getreporters) -- [getTags](cases_client.CasesSubClient.md#gettags) -- [push](cases_client.CasesSubClient.md#push) -- [resolve](cases_client.CasesSubClient.md#resolve) -- [update](cases_client.CasesSubClient.md#update) - -## Methods - -### create - -▸ **create**(`data`): `Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -Creates a case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | [`ICasePostRequest`](typedoc_interfaces.ICasePostRequest.md) | - -#### Returns - -`Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:51](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L51) - -___ - -### delete - -▸ **delete**(`ids`): `Promise`<`void`\> - -Delete a case and all its comments. - -**`params`** ids an array of case IDs to delete - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `ids` | `string`[] | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:80](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L80) - -___ - -### find - -▸ **find**(`params`): `Promise`<[`ICasesFindResponse`](typedoc_interfaces.ICasesFindResponse.md)\> - -Returns cases that match the search criteria. - -If the `owner` field is left empty then all the cases that the user has access to will be returned. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`ICasesFindRequest`](typedoc_interfaces.ICasesFindRequest.md) | - -#### Returns - -`Promise`<[`ICasesFindResponse`](typedoc_interfaces.ICasesFindResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:57](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L57) - -___ - -### get - -▸ **get**(`params`): `Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -Retrieves a single case with the specified ID. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`GetParams`](cases_get.GetParams.md) | - -#### Returns - -`Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:61](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L61) - -___ - -### getCasesByAlertID - -▸ **getCasesByAlertID**(`params`): `Promise`<{ `id`: `string` = rt.string; `title`: `string` = rt.string }[]\> - -Retrieves the cases ID and title that have the requested alert attached to them - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`CasesByAlertIDParams`](cases_get.CasesByAlertIDParams.md) | - -#### Returns - -`Promise`<{ `id`: `string` = rt.string; `title`: `string` = rt.string }[]\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:92](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L92) - -___ - -### getReporters - -▸ **getReporters**(`params`): `Promise`<{ `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` }[]\> - -Retrieves all the reporters across all accessible cases. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `Object` | -| `params.owner` | `undefined` \| `string` \| `string`[] | - -#### Returns - -`Promise`<{ `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` }[]\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:88](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L88) - -___ - -### getTags - -▸ **getTags**(`params`): `Promise`<`string`[]\> - -Retrieves all the tags across all cases the user making the request has access to. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `Object` | -| `params.owner` | `undefined` \| `string` \| `string`[] | - -#### Returns - -`Promise`<`string`[]\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:84](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L84) - -___ - -### push - -▸ **push**(`args`): `Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -Pushes a specific case to an external system. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `args` | [`PushParams`](cases_push.PushParams.md) | - -#### Returns - -`Promise`<[`ICaseResponse`](typedoc_interfaces.ICaseResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:70](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L70) - -___ - -### resolve - -▸ **resolve**(`params`): `Promise`<[`ICaseResolveResponse`](typedoc_interfaces.ICaseResolveResponse.md)\> - -**`experimental`** -Retrieves a single case resolving the specified ID. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`GetParams`](cases_get.GetParams.md) | - -#### Returns - -`Promise`<[`ICaseResolveResponse`](typedoc_interfaces.ICaseResolveResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:66](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L66) - -___ - -### update - -▸ **update**(`cases`): `Promise`<[`ICasesResponse`](typedoc_interfaces.ICasesResponse.md)\> - -Update the specified cases with the passed in values. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `cases` | [`ICasesPatchRequest`](typedoc_interfaces.ICasesPatchRequest.md) | - -#### Returns - -`Promise`<[`ICasesResponse`](typedoc_interfaces.ICasesResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/client.ts:74](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/client.ts#L74) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/cases_get.casesbyalertidparams.md b/x-pack/plugins/cases/docs/cases_client/interfaces/cases_get.casesbyalertidparams.md deleted file mode 100644 index 2e0cf957be8e3..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/cases_get.casesbyalertidparams.md +++ /dev/null @@ -1,44 +0,0 @@ -[Cases Client API Interface](../README.md) / [cases/get](../modules/cases_get.md) / CasesByAlertIDParams - -# Interface: CasesByAlertIDParams - -[cases/get](../modules/cases_get.md).CasesByAlertIDParams - -Parameters for finding cases IDs using an alert ID - -## Table of contents - -### Properties - -- [alertID](cases_get.CasesByAlertIDParams.md#alertid) -- [options](cases_get.CasesByAlertIDParams.md#options) - -## Properties - -### alertID - -• **alertID**: `string` - -The alert ID to search for - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/get.ts:45](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/get.ts#L45) - -___ - -### options - -• **options**: `Object` - -The filtering options when searching for associated cases. - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `owner` | `undefined` \| `string` \| `string`[] | - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/get.ts:49](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/get.ts#L49) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/cases_get.getparams.md b/x-pack/plugins/cases/docs/cases_client/interfaces/cases_get.getparams.md deleted file mode 100644 index ccd09fd4db48c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/cases_get.getparams.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [cases/get](../modules/cases_get.md) / GetParams - -# Interface: GetParams - -[cases/get](../modules/cases_get.md).GetParams - -The parameters for retrieving a case - -## Table of contents - -### Properties - -- [id](cases_get.GetParams.md#id) -- [includeComments](cases_get.GetParams.md#includecomments) - -## Properties - -### id - -• **id**: `string` - -Case ID - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/get.ts:144](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/get.ts#L144) - -___ - -### includeComments - -• `Optional` **includeComments**: `boolean` - -Whether to include the attachments for a case in the response - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/get.ts:148](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/get.ts#L148) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/cases_push.pushparams.md b/x-pack/plugins/cases/docs/cases_client/interfaces/cases_push.pushparams.md deleted file mode 100644 index 436850a7b64fd..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/cases_push.pushparams.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [cases/push](../modules/cases_push.md) / PushParams - -# Interface: PushParams - -[cases/push](../modules/cases_push.md).PushParams - -Parameters for pushing a case to an external system - -## Table of contents - -### Properties - -- [caseId](cases_push.PushParams.md#caseid) -- [connectorId](cases_push.PushParams.md#connectorid) - -## Properties - -### caseId - -• **caseId**: `string` - -The ID of a case - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/push.ts:48](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/push.ts#L48) - -___ - -### connectorId - -• **connectorId**: `string` - -The ID of an external system to push to - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/push.ts:52](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/push.ts#L52) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Action.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Action.md deleted file mode 100644 index 7f8e04653acf6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Action.md +++ /dev/null @@ -1,72 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Action - -# Interface: Action - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Action - -## Hierarchy - -- [`ActionUpdate`](client._internal_namespace.ActionUpdate.md) - - ↳ **`Action`** - -## Table of contents - -### Properties - -- [actionTypeId](client._internal_namespace.Action.md#actiontypeid) -- [config](client._internal_namespace.Action.md#config) -- [name](client._internal_namespace.Action.md#name) -- [secrets](client._internal_namespace.Action.md#secrets) - -## Properties - -### actionTypeId - -• **actionTypeId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:19 - -___ - -### config - -• **config**: [`SavedObjectAttributes`](client._internal_namespace.SavedObjectAttributes.md) - -#### Inherited from - -[ActionUpdate](client._internal_namespace.ActionUpdate.md).[config](client._internal_namespace.ActionUpdate.md#config) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:15 - -___ - -### name - -• **name**: `string` - -#### Inherited from - -[ActionUpdate](client._internal_namespace.ActionUpdate.md).[name](client._internal_namespace.ActionUpdate.md#name) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:14 - -___ - -### secrets - -• **secrets**: [`SavedObjectAttributes`](client._internal_namespace.SavedObjectAttributes.md) - -#### Inherited from - -[ActionUpdate](client._internal_namespace.ActionUpdate.md).[secrets](client._internal_namespace.ActionUpdate.md#secrets) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:16 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionExecutionSource.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionExecutionSource.md deleted file mode 100644 index 1b7033f5805c8..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionExecutionSource.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionExecutionSource - -# Interface: ActionExecutionSource - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionExecutionSource - -## Type parameters - -| Name | -| :------ | -| `T` | - -## Table of contents - -### Properties - -- [source](client._internal_namespace.ActionExecutionSource.md#source) -- [type](client._internal_namespace.ActionExecutionSource.md#type) - -## Properties - -### source - -• **source**: `T` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_execution_source.d.ts:8 - -___ - -### type - -• **type**: [`ActionExecutionSourceType`](../enums/client._internal_namespace.ActionExecutionSourceType.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_execution_source.d.ts:7 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionExecutorContext.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionExecutorContext.md deleted file mode 100644 index 093b2933ddfac..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionExecutorContext.md +++ /dev/null @@ -1,112 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionExecutorContext - -# Interface: ActionExecutorContext - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionExecutorContext - -## Table of contents - -### Properties - -- [actionTypeRegistry](client._internal_namespace.ActionExecutorContext.md#actiontyperegistry) -- [encryptedSavedObjectsClient](client._internal_namespace.ActionExecutorContext.md#encryptedsavedobjectsclient) -- [eventLogger](client._internal_namespace.ActionExecutorContext.md#eventlogger) -- [getServices](client._internal_namespace.ActionExecutorContext.md#getservices) -- [logger](client._internal_namespace.ActionExecutorContext.md#logger) -- [preconfiguredActions](client._internal_namespace.ActionExecutorContext.md#preconfiguredactions) -- [spaces](client._internal_namespace.ActionExecutorContext.md#spaces) - -### Methods - -- [getActionsClientWithRequest](client._internal_namespace.ActionExecutorContext.md#getactionsclientwithrequest) - -## Properties - -### actionTypeRegistry - -• **actionTypeRegistry**: [`ActionTypeRegistryContract`](../modules/client._internal_namespace.md#actiontyperegistrycontract) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:16 - -___ - -### encryptedSavedObjectsClient - -• **encryptedSavedObjectsClient**: [`EncryptedSavedObjectsClient`](client._internal_namespace.EncryptedSavedObjectsClient.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:15 - -___ - -### eventLogger - -• **eventLogger**: [`IEventLogger`](client._internal_namespace.IEventLogger.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:17 - -___ - -### getServices - -• **getServices**: [`GetServicesFunction`](../modules/client._internal_namespace.md#getservicesfunction) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:13 - -___ - -### logger - -• **logger**: `Logger` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:11 - -___ - -### preconfiguredActions - -• **preconfiguredActions**: [`PreConfiguredAction`](client._internal_namespace.PreConfiguredAction.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig), [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets)\>[] - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:18 - -___ - -### spaces - -• `Optional` **spaces**: [`SpacesServiceStart`](client._internal_namespace.SpacesServiceStart.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:12 - -## Methods - -### getActionsClientWithRequest - -▸ **getActionsClientWithRequest**(`request`, `authorizationContext?`): `Promise`<`PublicMethodsOf`<[`ActionsClient`](../classes/client._internal_namespace.ActionsClient.md)\>\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | -| `authorizationContext?` | [`ActionExecutionSource`](client._internal_namespace.ActionExecutionSource.md)<`unknown`\> | - -#### Returns - -`Promise`<`PublicMethodsOf`<[`ActionsClient`](../classes/client._internal_namespace.ActionsClient.md)\>\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:14 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionResult.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionResult.md deleted file mode 100644 index 7a303e0216b3a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionResult.md +++ /dev/null @@ -1,90 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionResult - -# Interface: ActionResult - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionResult - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Config` | extends [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) = [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) | - -## Hierarchy - -- **`ActionResult`** - - ↳ [`FindActionResult`](client._internal_namespace.FindActionResult.md) - - ↳ [`PreConfiguredAction`](client._internal_namespace.PreConfiguredAction.md) - -## Table of contents - -### Properties - -- [actionTypeId](client._internal_namespace.ActionResult.md#actiontypeid) -- [config](client._internal_namespace.ActionResult.md#config) -- [id](client._internal_namespace.ActionResult.md#id) -- [isMissingSecrets](client._internal_namespace.ActionResult.md#ismissingsecrets) -- [isPreconfigured](client._internal_namespace.ActionResult.md#ispreconfigured) -- [name](client._internal_namespace.ActionResult.md#name) - -## Properties - -### actionTypeId - -• **actionTypeId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:50 - -___ - -### config - -• `Optional` **config**: `Config` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:53 - -___ - -### id - -• **id**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:49 - -___ - -### isMissingSecrets - -• `Optional` **isMissingSecrets**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:52 - -___ - -### isPreconfigured - -• **isPreconfigured**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:54 - -___ - -### name - -• **name**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:51 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionType-1.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionType-1.md deleted file mode 100644 index ac0b15f74c84d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionType-1.md +++ /dev/null @@ -1,120 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionType - -# Interface: ActionType - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionType - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Config` | extends [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) = [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) | -| `Secrets` | extends [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets) = [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets) | -| `Params` | extends [`ActionTypeParams`](../modules/client._internal_namespace.md#actiontypeparams) = [`ActionTypeParams`](../modules/client._internal_namespace.md#actiontypeparams) | -| `ExecutorResultData` | `void` | - -## Table of contents - -### Properties - -- [executor](client._internal_namespace.ActionType-1.md#executor) -- [id](client._internal_namespace.ActionType-1.md#id) -- [maxAttempts](client._internal_namespace.ActionType-1.md#maxattempts) -- [minimumLicenseRequired](client._internal_namespace.ActionType-1.md#minimumlicenserequired) -- [name](client._internal_namespace.ActionType-1.md#name) -- [validate](client._internal_namespace.ActionType-1.md#validate) - -### Methods - -- [renderParameterTemplates](client._internal_namespace.ActionType-1.md#renderparametertemplates) - -## Properties - -### executor - -• **executor**: [`ExecutorType`](../modules/client._internal_namespace.md#executortype)<`Config`, `Secrets`, `Params`, `ExecutorResultData`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:82 - -___ - -### id - -• **id**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:71 - -___ - -### maxAttempts - -• `Optional` **maxAttempts**: `number` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:73 - -___ - -### minimumLicenseRequired - -• **minimumLicenseRequired**: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:74 - -___ - -### name - -• **name**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:72 - -___ - -### validate - -• `Optional` **validate**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `config?` | [`ValidatorType`](client._internal_namespace.ValidatorType.md)<`Config`\> | -| `params?` | [`ValidatorType`](client._internal_namespace.ValidatorType.md)<`Params`\> | -| `secrets?` | [`ValidatorType`](client._internal_namespace.ValidatorType.md)<`Secrets`\> | -| `connector?` | (`config`: `Config`, `secrets`: `Secrets`) => ``null`` \| `string` | - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:75 - -## Methods - -### renderParameterTemplates - -▸ `Optional` **renderParameterTemplates**(`params`, `variables`, `actionId?`): `Params` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `Params` | -| `variables` | `Record`<`string`, `unknown`\> | -| `actionId?` | `string` | - -#### Returns - -`Params` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:81 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionType.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionType.md deleted file mode 100644 index 286e699d5c2f7..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionType.md +++ /dev/null @@ -1,76 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionType - -# Interface: ActionType - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionType - -## Table of contents - -### Properties - -- [enabled](client._internal_namespace.ActionType.md#enabled) -- [enabledInConfig](client._internal_namespace.ActionType.md#enabledinconfig) -- [enabledInLicense](client._internal_namespace.ActionType.md#enabledinlicense) -- [id](client._internal_namespace.ActionType.md#id) -- [minimumLicenseRequired](client._internal_namespace.ActionType.md#minimumlicenserequired) -- [name](client._internal_namespace.ActionType.md#name) - -## Properties - -### enabled - -• **enabled**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:5 - -___ - -### enabledInConfig - -• **enabledInConfig**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:6 - -___ - -### enabledInLicense - -• **enabledInLicense**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:7 - -___ - -### id - -• **id**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:3 - -___ - -### minimumLicenseRequired - -• **minimumLicenseRequired**: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:8 - -___ - -### name - -• **name**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeExecutorOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeExecutorOptions.md deleted file mode 100644 index 9c06e78c9c199..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeExecutorOptions.md +++ /dev/null @@ -1,95 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionTypeExecutorOptions - -# Interface: ActionTypeExecutorOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionTypeExecutorOptions - -## Type parameters - -| Name | -| :------ | -| `Config` | -| `Secrets` | -| `Params` | - -## Table of contents - -### Properties - -- [actionId](client._internal_namespace.ActionTypeExecutorOptions.md#actionid) -- [config](client._internal_namespace.ActionTypeExecutorOptions.md#config) -- [isEphemeral](client._internal_namespace.ActionTypeExecutorOptions.md#isephemeral) -- [params](client._internal_namespace.ActionTypeExecutorOptions.md#params) -- [secrets](client._internal_namespace.ActionTypeExecutorOptions.md#secrets) -- [services](client._internal_namespace.ActionTypeExecutorOptions.md#services) -- [taskInfo](client._internal_namespace.ActionTypeExecutorOptions.md#taskinfo) - -## Properties - -### actionId - -• **actionId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:40 - -___ - -### config - -• **config**: `Config` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:42 - -___ - -### isEphemeral - -• `Optional` **isEphemeral**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:45 - -___ - -### params - -• **params**: `Params` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:44 - -___ - -### secrets - -• **secrets**: `Secrets` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:43 - -___ - -### services - -• **services**: [`Services`](client._internal_namespace.Services.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:41 - -___ - -### taskInfo - -• `Optional` **taskInfo**: [`TaskInfo`](client._internal_namespace.TaskInfo.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:46 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeExecutorResult.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeExecutorResult.md deleted file mode 100644 index 039de06431a7c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeExecutorResult.md +++ /dev/null @@ -1,82 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionTypeExecutorResult - -# Interface: ActionTypeExecutorResult - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionTypeExecutorResult - -## Type parameters - -| Name | -| :------ | -| `Data` | - -## Table of contents - -### Properties - -- [actionId](client._internal_namespace.ActionTypeExecutorResult.md#actionid) -- [data](client._internal_namespace.ActionTypeExecutorResult.md#data) -- [message](client._internal_namespace.ActionTypeExecutorResult.md#message) -- [retry](client._internal_namespace.ActionTypeExecutorResult.md#retry) -- [serviceMessage](client._internal_namespace.ActionTypeExecutorResult.md#servicemessage) -- [status](client._internal_namespace.ActionTypeExecutorResult.md#status) - -## Properties - -### actionId - -• **actionId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:20 - -___ - -### data - -• `Optional` **data**: `Data` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:24 - -___ - -### message - -• `Optional` **message**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:22 - -___ - -### retry - -• `Optional` **retry**: ``null`` \| `boolean` \| `Date` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:25 - -___ - -### serviceMessage - -• `Optional` **serviceMessage**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:23 - -___ - -### status - -• **status**: ``"error"`` \| ``"ok"`` - -#### Defined in - -x-pack/plugins/actions/target/types/common/types.d.ts:21 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeRegistryOpts.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeRegistryOpts.md deleted file mode 100644 index 2f83edd5720f0..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionTypeRegistryOpts.md +++ /dev/null @@ -1,76 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionTypeRegistryOpts - -# Interface: ActionTypeRegistryOpts - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionTypeRegistryOpts - -## Table of contents - -### Properties - -- [actionsConfigUtils](client._internal_namespace.ActionTypeRegistryOpts.md#actionsconfigutils) -- [licenseState](client._internal_namespace.ActionTypeRegistryOpts.md#licensestate) -- [licensing](client._internal_namespace.ActionTypeRegistryOpts.md#licensing) -- [preconfiguredActions](client._internal_namespace.ActionTypeRegistryOpts.md#preconfiguredactions) -- [taskManager](client._internal_namespace.ActionTypeRegistryOpts.md#taskmanager) -- [taskRunnerFactory](client._internal_namespace.ActionTypeRegistryOpts.md#taskrunnerfactory) - -## Properties - -### actionsConfigUtils - -• **actionsConfigUtils**: [`ActionsConfigurationUtilities`](client._internal_namespace.ActionsConfigurationUtilities.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:11 - -___ - -### licenseState - -• **licenseState**: [`ILicenseState`](../modules/client._internal_namespace.md#ilicensestate) - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:12 - -___ - -### licensing - -• **licensing**: [`LicensingPluginSetup`](client._internal_namespace.LicensingPluginSetup.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:8 - -___ - -### preconfiguredActions - -• **preconfiguredActions**: [`PreConfiguredAction`](client._internal_namespace.PreConfiguredAction.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig), [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets)\>[] - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:13 - -___ - -### taskManager - -• **taskManager**: [`TaskManagerSetupContract`](client._internal_namespace.TaskManagerSetupContract.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:9 - -___ - -### taskRunnerFactory - -• **taskRunnerFactory**: [`TaskRunnerFactory`](../classes/client._internal_namespace.TaskRunnerFactory.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/action_type_registry.d.ts:10 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionUpdate.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionUpdate.md deleted file mode 100644 index 1326f4f3b3361..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionUpdate.md +++ /dev/null @@ -1,51 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionUpdate - -# Interface: ActionUpdate - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionUpdate - -## Hierarchy - -- [`SavedObjectAttributes`](client._internal_namespace.SavedObjectAttributes.md) - - ↳ **`ActionUpdate`** - - ↳↳ [`Action`](client._internal_namespace.Action.md) - -## Table of contents - -### Properties - -- [config](client._internal_namespace.ActionUpdate.md#config) -- [name](client._internal_namespace.ActionUpdate.md#name) -- [secrets](client._internal_namespace.ActionUpdate.md#secrets) - -## Properties - -### config - -• **config**: [`SavedObjectAttributes`](client._internal_namespace.SavedObjectAttributes.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:15 - -___ - -### name - -• **name**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:14 - -___ - -### secrets - -• **secrets**: [`SavedObjectAttributes`](client._internal_namespace.SavedObjectAttributes.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:16 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionsConfigurationUtilities.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionsConfigurationUtilities.md deleted file mode 100644 index f2562a697f255..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionsConfigurationUtilities.md +++ /dev/null @@ -1,217 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionsConfigurationUtilities - -# Interface: ActionsConfigurationUtilities - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionsConfigurationUtilities - -## Table of contents - -### Methods - -- [ensureActionTypeEnabled](client._internal_namespace.ActionsConfigurationUtilities.md#ensureactiontypeenabled) -- [ensureHostnameAllowed](client._internal_namespace.ActionsConfigurationUtilities.md#ensurehostnameallowed) -- [ensureUriAllowed](client._internal_namespace.ActionsConfigurationUtilities.md#ensureuriallowed) -- [getCustomHostSettings](client._internal_namespace.ActionsConfigurationUtilities.md#getcustomhostsettings) -- [getMicrosoftGraphApiUrl](client._internal_namespace.ActionsConfigurationUtilities.md#getmicrosoftgraphapiurl) -- [getProxySettings](client._internal_namespace.ActionsConfigurationUtilities.md#getproxysettings) -- [getResponseSettings](client._internal_namespace.ActionsConfigurationUtilities.md#getresponsesettings) -- [getSSLSettings](client._internal_namespace.ActionsConfigurationUtilities.md#getsslsettings) -- [isActionTypeEnabled](client._internal_namespace.ActionsConfigurationUtilities.md#isactiontypeenabled) -- [isHostnameAllowed](client._internal_namespace.ActionsConfigurationUtilities.md#ishostnameallowed) -- [isUriAllowed](client._internal_namespace.ActionsConfigurationUtilities.md#isuriallowed) - -## Methods - -### ensureActionTypeEnabled - -▸ **ensureActionTypeEnabled**(`actionType`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionType` | `string` | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:10 - -___ - -### ensureHostnameAllowed - -▸ **ensureHostnameAllowed**(`hostname`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hostname` | `string` | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:8 - -___ - -### ensureUriAllowed - -▸ **ensureUriAllowed**(`uri`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `uri` | `string` | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:9 - -___ - -### getCustomHostSettings - -▸ **getCustomHostSettings**(`targetUrl`): `undefined` \| `Readonly`<{ `smtp?`: `Readonly`<{ `ignoreTLS?`: `boolean` ; `requireTLS?`: `boolean` }\> ; `ssl?`: `Readonly`<{ `certificateAuthoritiesData?`: `string` ; `certificateAuthoritiesFiles?`: `string` \| `string`[] ; `rejectUnauthorized?`: `boolean` ; `verificationMode?`: ``"none"`` \| ``"certificate"`` \| ``"full"`` }\> } & { `url`: `string` }\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `targetUrl` | `string` | - -#### Returns - -`undefined` \| `Readonly`<{ `smtp?`: `Readonly`<{ `ignoreTLS?`: `boolean` ; `requireTLS?`: `boolean` }\> ; `ssl?`: `Readonly`<{ `certificateAuthoritiesData?`: `string` ; `certificateAuthoritiesFiles?`: `string` \| `string`[] ; `rejectUnauthorized?`: `boolean` ; `verificationMode?`: ``"none"`` \| ``"certificate"`` \| ``"full"`` }\> } & { `url`: `string` }\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:14 - -___ - -### getMicrosoftGraphApiUrl - -▸ **getMicrosoftGraphApiUrl**(): `undefined` \| `string` - -#### Returns - -`undefined` \| `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:15 - -___ - -### getProxySettings - -▸ **getProxySettings**(): `undefined` \| [`ProxySettings`](client._internal_namespace.ProxySettings.md) - -#### Returns - -`undefined` \| [`ProxySettings`](client._internal_namespace.ProxySettings.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:12 - -___ - -### getResponseSettings - -▸ **getResponseSettings**(): [`ResponseSettings`](client._internal_namespace.ResponseSettings.md) - -#### Returns - -[`ResponseSettings`](client._internal_namespace.ResponseSettings.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:13 - -___ - -### getSSLSettings - -▸ **getSSLSettings**(): [`SSLSettings`](client._internal_namespace.SSLSettings.md) - -#### Returns - -[`SSLSettings`](client._internal_namespace.SSLSettings.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:11 - -___ - -### isActionTypeEnabled - -▸ **isActionTypeEnabled**(`actionType`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `actionType` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:7 - -___ - -### isHostnameAllowed - -▸ **isHostnameAllowed**(`hostname`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hostname` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:5 - -___ - -### isUriAllowed - -▸ **isUriAllowed**(`uri`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `uri` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_config.d.ts:6 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionsLicenseInformation.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionsLicenseInformation.md deleted file mode 100644 index c7ab568b57c35..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ActionsLicenseInformation.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ActionsLicenseInformation - -# Interface: ActionsLicenseInformation - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ActionsLicenseInformation - -## Table of contents - -### Properties - -- [enableAppLink](client._internal_namespace.ActionsLicenseInformation.md#enableapplink) -- [message](client._internal_namespace.ActionsLicenseInformation.md#message) -- [showAppLink](client._internal_namespace.ActionsLicenseInformation.md#showapplink) - -## Properties - -### enableAppLink - -• **enableAppLink**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:9 - -___ - -### message - -• **message**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:10 - -___ - -### showAppLink - -• **showAppLink**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:8 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AggregationBuilder.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AggregationBuilder.md deleted file mode 100644 index 9790711e77193..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AggregationBuilder.md +++ /dev/null @@ -1,68 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AggregationBuilder - -# Interface: AggregationBuilder - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AggregationBuilder - -## Table of contents - -### Methods - -- [build](client._internal_namespace.AggregationBuilder.md#build) -- [formatResponse](client._internal_namespace.AggregationBuilder.md#formatresponse) -- [getName](client._internal_namespace.AggregationBuilder.md#getname) - -## Methods - -### build - -▸ **build**(): `Record`<`string`, `AggregationsAggregationContainer`\> - -#### Returns - -`Record`<`string`, `AggregationsAggregationContainer`\> - -#### Defined in - -[x-pack/plugins/cases/server/client/metrics/types.ts:20](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/metrics/types.ts#L20) - -___ - -### formatResponse - -▸ **formatResponse**(`aggregations`): `Object` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `aggregations` | [`AggregationResponse`](../modules/client._internal_namespace.md#aggregationresponse) | - -#### Returns - -`Object` - -| Name | Type | -| :------ | :------ | -| `actions` | `undefined` \| { isolateHost?: { isolate: { total: number; }; unisolate: { total: number; }; } \| undefined; } | -| `alerts` | `undefined` \| { count?: number \| undefined; hosts?: { total: number; values: { name: string \| undefined; id: string; count: number; }[]; } \| undefined; users?: { total: number; values: { name: string; count: number; }[]; } \| undefined; } | -| `connectors` | `undefined` \| { `total`: `number` = rt.number } | -| `lifespan` | `undefined` \| { `closeDate`: ``null`` \| `string` ; `creationDate`: `string` = rt.string; `statusInfo`: { openDuration: number; inProgressDuration: number; reopenDates: string[]; } = StatusInfoRt } | - -#### Defined in - -[x-pack/plugins/cases/server/client/metrics/types.ts:21](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/metrics/types.ts#L21) - -___ - -### getName - -▸ **getName**(): `string` - -#### Returns - -`string` - -#### Defined in - -[x-pack/plugins/cases/server/client/metrics/types.ts:22](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/metrics/types.ts#L22) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Alert.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Alert.md deleted file mode 100644 index 71ae71dd5cfaf..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Alert.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Alert - -# Interface: Alert - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Alert - -## Table of contents - -### Properties - -- [\_id](client._internal_namespace.Alert.md#_id) -- [\_index](client._internal_namespace.Alert.md#_index) -- [\_source](client._internal_namespace.Alert.md#_source) - -## Properties - -### \_id - -• **\_id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:233](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L233) - -___ - -### \_index - -• **\_index**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:234](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L234) - -___ - -### \_source - -• **\_source**: `Record`<`string`, `unknown`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:235](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L235) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertIdIndex.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertIdIndex.md deleted file mode 100644 index b9a09536ed21c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertIdIndex.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AlertIdIndex - -# Interface: AlertIdIndex - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AlertIdIndex - -## Table of contents - -### Properties - -- [id](client._internal_namespace.AlertIdIndex.md#id) -- [index](client._internal_namespace.AlertIdIndex.md#index) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:243](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L243) - -___ - -### index - -• **index**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:244](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L244) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertInfo.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertInfo.md deleted file mode 100644 index acf8e3b09b74f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertInfo.md +++ /dev/null @@ -1,34 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AlertInfo - -# Interface: AlertInfo - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AlertInfo - -This structure holds the alert ID and index from an alert comment - -## Table of contents - -### Properties - -- [id](client._internal_namespace.AlertInfo.md#id) -- [index](client._internal_namespace.AlertInfo.md#index) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/common/types.ts:15](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/common/types.ts#L15) - -___ - -### index - -• **index**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/common/types.ts:16](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/common/types.ts#L16) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertsResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertsResponse.md deleted file mode 100644 index aae855d5d0d4a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AlertsResponse.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AlertsResponse - -# Interface: AlertsResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AlertsResponse - -## Table of contents - -### Properties - -- [docs](client._internal_namespace.AlertsResponse.md#docs) - -## Properties - -### docs - -• **docs**: [`Alert`](client._internal_namespace.Alert.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:239](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L239) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AppCategory.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AppCategory.md deleted file mode 100644 index 7ab9c4c95ff66..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AppCategory.md +++ /dev/null @@ -1,83 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AppCategory - -# Interface: AppCategory - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AppCategory - -A category definition for nav links to know where to sort them in the left hand nav - -## Table of contents - -### Properties - -- [ariaLabel](client._internal_namespace.AppCategory.md#arialabel) -- [euiIconType](client._internal_namespace.AppCategory.md#euiicontype) -- [id](client._internal_namespace.AppCategory.md#id) -- [label](client._internal_namespace.AppCategory.md#label) -- [order](client._internal_namespace.AppCategory.md#order) - -## Properties - -### ariaLabel - -• `Optional` **ariaLabel**: `string` - -If the visual label isn't appropriate for screen readers, -can override it here - -#### Defined in - -src/core/target/types/types/app_category.d.ts:20 - -___ - -### euiIconType - -• `Optional` **euiIconType**: `string` - -Define an icon to be used for the category -If the category is only 1 item, and no icon is defined, will default to the product icon -Defaults to initials if no icon is defined - -#### Defined in - -src/core/target/types/types/app_category.d.ts:32 - -___ - -### id - -• **id**: `string` - -Unique identifier for the categories - -#### Defined in - -src/core/target/types/types/app_category.d.ts:10 - -___ - -### label - -• **label**: `string` - -Label used for category name. -Also used as aria-label if one isn't set. - -#### Defined in - -src/core/target/types/types/app_category.d.ts:15 - -___ - -### order - -• `Optional` **order**: `number` - -The order that categories will be sorted in -Prefer large steps between categories to allow for further editing -(Default categories are in steps of 1000) - -#### Defined in - -src/core/target/types/types/app_category.d.ts:26 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AttachedToCaseArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AttachedToCaseArgs.md deleted file mode 100644 index 86ea1605c1374..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AttachedToCaseArgs.md +++ /dev/null @@ -1,55 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AttachedToCaseArgs - -# Interface: AttachedToCaseArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AttachedToCaseArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`AttachedToCaseArgs`** - - ↳↳ [`CountActionsAttachedToCaseArgs`](client._internal_namespace.CountActionsAttachedToCaseArgs.md) - -## Table of contents - -### Properties - -- [caseId](client._internal_namespace.AttachedToCaseArgs.md#caseid) -- [filter](client._internal_namespace.AttachedToCaseArgs.md#filter) -- [unsecuredSavedObjectsClient](client._internal_namespace.AttachedToCaseArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### caseId - -• **caseId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:33](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L33) - -___ - -### filter - -• `Optional` **filter**: `KueryNode` - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:34](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L34) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Attributes.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Attributes.md deleted file mode 100644 index fd8a32f7afb6b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Attributes.md +++ /dev/null @@ -1,84 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Attributes - -# Interface: Attributes - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Attributes - -## Table of contents - -### Properties - -- [action](client._internal_namespace.Attributes.md#action) -- [created\_at](client._internal_namespace.Attributes.md#created_at) -- [created\_by](client._internal_namespace.Attributes.md#created_by) -- [owner](client._internal_namespace.Attributes.md#owner) -- [payload](client._internal_namespace.Attributes.md#payload) -- [type](client._internal_namespace.Attributes.md#type) - -## Properties - -### action - -• **action**: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:84](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L84) - -___ - -### created\_at - -• **created\_at**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:85](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L85) - -___ - -### created\_by - -• **created\_by**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:86](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L86) - -___ - -### owner - -• **owner**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:87](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L87) - -___ - -### payload - -• **payload**: `Record`<`string`, `unknown`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:89](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L89) - -___ - -### type - -• **type**: ``"description"`` \| ``"tags"`` \| ``"title"`` \| ``"connector"`` \| ``"settings"`` \| ``"status"`` \| ``"comment"`` \| ``"pushed"`` \| ``"create_case"`` \| ``"delete_case"`` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:88](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L88) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuditEvent.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuditEvent.md deleted file mode 100644 index d0bbaabfc416b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuditEvent.md +++ /dev/null @@ -1,59 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuditEvent - -# Interface: AuditEvent - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuditEvent - -Audit event schema using ECS format: https://www.elastic.co/guide/en/ecs/1.12/index.html - -If you add additional fields to the schema ensure you update the Kibana Filebeat module: -https://github.com/elastic/beats/tree/master/filebeat/module/kibana - -## Hierarchy - -- `LogMeta` - - ↳ **`AuditEvent`** - -## Table of contents - -### Properties - -- [kibana](client._internal_namespace.AuditEvent.md#kibana) -- [message](client._internal_namespace.AuditEvent.md#message) - -## Properties - -### kibana - -• `Optional` **kibana**: `Object` - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `add_to_spaces?` | readonly `string`[] | Set of space IDs that a saved object was shared to. | -| `authentication_provider?` | `string` | Name of authentication provider associated with a login event. | -| `authentication_realm?` | `string` | Name of Elasticsearch realm that has authenticated the user. | -| `authentication_type?` | `string` | Type of authentication provider associated with a login event. | -| `delete_from_spaces?` | readonly `string`[] | Set of space IDs that a saved object was removed from. | -| `lookup_realm?` | `string` | Name of Elasticsearch realm where the user details were retrieved from. | -| `saved_object?` | `Object` | Saved object that was created, changed, deleted or accessed as part of this event. | -| `saved_object.id` | `string` | - | -| `saved_object.type` | `string` | - | -| `session_id?` | `string` | The ID of the user session associated with this event. Each login attempt results in a unique session id. | -| `space_id?` | `string` | The ID of the space associated with this event. | - -#### Defined in - -x-pack/plugins/security/target/types/server/audit/audit_events.d.ts:14 - -___ - -### message - -• **message**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/server/audit/audit_events.d.ts:13 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuditLogger.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuditLogger.md deleted file mode 100644 index c4caafd67c08d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuditLogger.md +++ /dev/null @@ -1,52 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuditLogger - -# Interface: AuditLogger - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuditLogger - -## Table of contents - -### Methods - -- [log](client._internal_namespace.AuditLogger.md#log) - -## Methods - -### log - -▸ **log**(`event`): `void` - -Logs an [AuditEvent](client._internal_namespace.AuditEvent.md) and automatically adds meta data about the -current user, space and correlation id. - -Guidelines around what events should be logged and how they should be -structured can be found in: `/x-pack/plugins/security/README.md` - -**`example`** -```typescript -const auditLogger = securitySetup.audit.asScoped(request); -auditLogger.log({ - message: 'User is updating dashboard [id=123]', - event: { - action: 'saved_object_update', - outcome: 'unknown' - }, - kibana: { - saved_object: { type: 'dashboard', id: '123' } - }, -}); -``` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `event` | `undefined` \| [`AuditEvent`](client._internal_namespace.AuditEvent.md) | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/security/target/types/server/audit/audit_service.d.ts:32 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthFilterHelpers.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthFilterHelpers.md deleted file mode 100644 index c4117202317cc..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthFilterHelpers.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuthFilterHelpers - -# Interface: AuthFilterHelpers - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuthFilterHelpers - -Defines the helper methods and necessary information for authorizing the find API's request. - -## Table of contents - -### Properties - -- [ensureSavedObjectsAreAuthorized](client._internal_namespace.AuthFilterHelpers.md#ensuresavedobjectsareauthorized) -- [filter](client._internal_namespace.AuthFilterHelpers.md#filter) - -## Properties - -### ensureSavedObjectsAreAuthorized - -• **ensureSavedObjectsAreAuthorized**: [`EnsureSOAuthCallback`](../modules/client._internal_namespace.md#ensuresoauthcallback) - -Utility function for checking that the returned entities are in fact authorized for the user making the request - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:123](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L123) - -___ - -### filter - -• `Optional` **filter**: `KueryNode` - -The owner filter to pass to the saved object client's find operation that is scoped to the authorized owners - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:119](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L119) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthenticatedUser.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthenticatedUser.md deleted file mode 100644 index 69dc207747edf..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthenticatedUser.md +++ /dev/null @@ -1,170 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuthenticatedUser - -# Interface: AuthenticatedUser - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuthenticatedUser - -Represents the currently authenticated user. - -## Hierarchy - -- [`User`](client._internal_namespace.User.md) - - ↳ **`AuthenticatedUser`** - -## Table of contents - -### Properties - -- [authentication\_provider](client._internal_namespace.AuthenticatedUser.md#authentication_provider) -- [authentication\_realm](client._internal_namespace.AuthenticatedUser.md#authentication_realm) -- [authentication\_type](client._internal_namespace.AuthenticatedUser.md#authentication_type) -- [email](client._internal_namespace.AuthenticatedUser.md#email) -- [enabled](client._internal_namespace.AuthenticatedUser.md#enabled) -- [full\_name](client._internal_namespace.AuthenticatedUser.md#full_name) -- [lookup\_realm](client._internal_namespace.AuthenticatedUser.md#lookup_realm) -- [metadata](client._internal_namespace.AuthenticatedUser.md#metadata) -- [roles](client._internal_namespace.AuthenticatedUser.md#roles) -- [username](client._internal_namespace.AuthenticatedUser.md#username) - -## Properties - -### authentication\_provider - -• **authentication\_provider**: [`AuthenticationProvider`](client._internal_namespace.AuthenticationProvider.md) - -The authentication provider that used to authenticate user. - -#### Defined in - -x-pack/plugins/security/target/types/common/model/authenticated_user.d.ts:22 - -___ - -### authentication\_realm - -• **authentication\_realm**: [`UserRealm`](client._internal_namespace.UserRealm.md) - -The name and type of the Realm that has authenticated the user. - -#### Defined in - -x-pack/plugins/security/target/types/common/model/authenticated_user.d.ts:14 - -___ - -### authentication\_type - -• **authentication\_type**: `string` - -The AuthenticationType used by ES to authenticate the user. - -**`example`** "realm" | "api_key" | "token" | "anonymous" | "internal" - -#### Defined in - -x-pack/plugins/security/target/types/common/model/authenticated_user.d.ts:28 - -___ - -### email - -• `Optional` **email**: `string` - -#### Inherited from - -[User](client._internal_namespace.User.md).[email](client._internal_namespace.User.md#email) - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:3 - -___ - -### enabled - -• **enabled**: `boolean` - -#### Inherited from - -[User](client._internal_namespace.User.md).[enabled](client._internal_namespace.User.md#enabled) - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:6 - -___ - -### full\_name - -• `Optional` **full\_name**: `string` - -#### Inherited from - -[User](client._internal_namespace.User.md).[full_name](client._internal_namespace.User.md#full_name) - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:4 - -___ - -### lookup\_realm - -• **lookup\_realm**: [`UserRealm`](client._internal_namespace.UserRealm.md) - -The name and type of the Realm where the user information were retrieved from. - -#### Defined in - -x-pack/plugins/security/target/types/common/model/authenticated_user.d.ts:18 - -___ - -### metadata - -• `Optional` **metadata**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `_deprecated?` | `boolean` | -| `_deprecated_reason?` | `string` | -| `_reserved` | `boolean` | - -#### Inherited from - -[User](client._internal_namespace.User.md).[metadata](client._internal_namespace.User.md#metadata) - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:7 - -___ - -### roles - -• **roles**: readonly `string`[] - -#### Inherited from - -[User](client._internal_namespace.User.md).[roles](client._internal_namespace.User.md#roles) - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:5 - -___ - -### username - -• **username**: `string` - -#### Inherited from - -[User](client._internal_namespace.User.md).[username](client._internal_namespace.User.md#username) - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:2 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthenticationProvider.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthenticationProvider.md deleted file mode 100644 index a10edc042b528..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthenticationProvider.md +++ /dev/null @@ -1,34 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuthenticationProvider - -# Interface: AuthenticationProvider - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuthenticationProvider - -Type and name tuple to identify provider used to authenticate user. - -## Table of contents - -### Properties - -- [name](client._internal_namespace.AuthenticationProvider.md#name) -- [type](client._internal_namespace.AuthenticationProvider.md#type) - -## Properties - -### name - -• **name**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/common/model/authentication_provider.d.ts:6 - -___ - -### type - -• **type**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/common/model/authentication_provider.d.ts:5 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthorizationMode-1.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthorizationMode-1.md deleted file mode 100644 index ff75cd19e524c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthorizationMode-1.md +++ /dev/null @@ -1,31 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuthorizationMode - -# Interface: AuthorizationMode - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuthorizationMode - -## Table of contents - -### Methods - -- [useRbacForRequest](client._internal_namespace.AuthorizationMode-1.md#userbacforrequest) - -## Methods - -### useRbacForRequest - -▸ **useRbacForRequest**(`request`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/mode.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthorizationServiceSetup.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthorizationServiceSetup.md deleted file mode 100644 index 5011fe972f36e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.AuthorizationServiceSetup.md +++ /dev/null @@ -1,71 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / AuthorizationServiceSetup - -# Interface: AuthorizationServiceSetup - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).AuthorizationServiceSetup - -Authorization services available on the setup contract of the security plugin. - -## Table of contents - -### Properties - -- [actions](client._internal_namespace.AuthorizationServiceSetup.md#actions) -- [checkPrivilegesDynamicallyWithRequest](client._internal_namespace.AuthorizationServiceSetup.md#checkprivilegesdynamicallywithrequest) -- [checkPrivilegesWithRequest](client._internal_namespace.AuthorizationServiceSetup.md#checkprivilegeswithrequest) -- [checkSavedObjectsPrivilegesWithRequest](client._internal_namespace.AuthorizationServiceSetup.md#checksavedobjectsprivilegeswithrequest) -- [mode](client._internal_namespace.AuthorizationServiceSetup.md#mode) - -## Properties - -### actions - -• **actions**: [`Actions`](../classes/client._internal_namespace.Actions.md) - -Actions are used to create the "actions" that are associated with Elasticsearch's -application privileges, and are used to perform the authorization checks implemented -by the various `checkPrivilegesWithRequest` derivatives. - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/authorization_service.d.ts:52 - -___ - -### checkPrivilegesDynamicallyWithRequest - -• **checkPrivilegesDynamicallyWithRequest**: [`CheckPrivilegesDynamicallyWithRequest`](../modules/client._internal_namespace.md#checkprivilegesdynamicallywithrequest) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/authorization_service.d.ts:54 - -___ - -### checkPrivilegesWithRequest - -• **checkPrivilegesWithRequest**: [`CheckPrivilegesWithRequest`](../modules/client._internal_namespace.md#checkprivilegeswithrequest) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/authorization_service.d.ts:53 - -___ - -### checkSavedObjectsPrivilegesWithRequest - -• **checkSavedObjectsPrivilegesWithRequest**: [`CheckSavedObjectsPrivilegesWithRequest`](../modules/client._internal_namespace.md#checksavedobjectsprivilegeswithrequest) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/authorization_service.d.ts:55 - -___ - -### mode - -• **mode**: [`AuthorizationMode`](client._internal_namespace.AuthorizationMode-1.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/authorization_service.d.ts:56 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BeforeSaveContext.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BeforeSaveContext.md deleted file mode 100644 index 6e52bf637eada..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BeforeSaveContext.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BeforeSaveContext - -# Interface: BeforeSaveContext - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BeforeSaveContext - -## Table of contents - -### Properties - -- [taskInstance](client._internal_namespace.BeforeSaveContext.md#taskinstance) - -## Properties - -### taskInstance - -• **taskInstance**: [`TaskInstance`](client._internal_namespace.TaskInstance.md) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/lib/middleware.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BuilderParameters.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BuilderParameters.md deleted file mode 100644 index c91716f5b2248..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BuilderParameters.md +++ /dev/null @@ -1,205 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BuilderParameters - -# Interface: BuilderParameters - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BuilderParameters - -## Table of contents - -### Properties - -- [comment](client._internal_namespace.BuilderParameters.md#comment) -- [connector](client._internal_namespace.BuilderParameters.md#connector) -- [create\_case](client._internal_namespace.BuilderParameters.md#create_case) -- [delete\_case](client._internal_namespace.BuilderParameters.md#delete_case) -- [description](client._internal_namespace.BuilderParameters.md#description) -- [pushed](client._internal_namespace.BuilderParameters.md#pushed) -- [settings](client._internal_namespace.BuilderParameters.md#settings) -- [status](client._internal_namespace.BuilderParameters.md#status) -- [tags](client._internal_namespace.BuilderParameters.md#tags) -- [title](client._internal_namespace.BuilderParameters.md#title) - -## Properties - -### comment - -• **comment**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.attachment` | { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:44](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L44) - -___ - -### connector - -• **connector**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.connector` | { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:49](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L49) - -___ - -### create\_case - -• **create\_case**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.connector` | { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } | -| `parameters.payload.description` | `string` | -| `parameters.payload.owner` | `string` | -| `parameters.payload.settings` | { syncAlerts: boolean; } | -| `parameters.payload.tags` | `string`[] | -| `parameters.payload.title` | `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:56](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L56) - -___ - -### delete\_case - -• **delete\_case**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:61](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L61) - -___ - -### description - -• **description**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.description` | `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:25](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L25) - -___ - -### pushed - -• **pushed**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.externalService` | { `connector_id`: `string` = rt.string } & { `connector_name`: `string` = rt.string; `external_id`: `string` = rt.string; `external_title`: `string` = rt.string; `external_url`: `string` = rt.string; `pushed_at`: `string` = rt.string; `pushed_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT } | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:34](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L34) - -___ - -### settings - -• **settings**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.settings` | `Object` | -| `parameters.payload.settings.syncAlerts` | `boolean` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:41](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L41) - -___ - -### status - -• **status**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.status` | [`CaseStatuses`](../enums/client._internal_namespace.CaseStatuses.md) | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:28](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L28) - -___ - -### tags - -• **tags**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.tags` | `string`[] | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:31](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L31) - -___ - -### title - -• **title**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `parameters` | `Object` | -| `parameters.payload` | `Object` | -| `parameters.payload.title` | `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:22](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L22) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BuilderReturnValue.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BuilderReturnValue.md deleted file mode 100644 index ab7e6bdade21e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BuilderReturnValue.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BuilderReturnValue - -# Interface: BuilderReturnValue - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BuilderReturnValue - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.BuilderReturnValue.md#attributes) -- [references](client._internal_namespace.BuilderReturnValue.md#references) - -## Properties - -### attributes - -• **attributes**: [`Attributes`](client._internal_namespace.Attributes.md) - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:93](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L93) - -___ - -### references - -• **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:94](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L94) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md deleted file mode 100644 index ac16ce838e615..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md +++ /dev/null @@ -1,125 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BulkCreateAttachmentDeletionUserAction - -# Interface: BulkCreateAttachmentDeletionUserAction - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BulkCreateAttachmentDeletionUserAction - -## Hierarchy - -- `Omit`<[`CommonUserActionArgs`](../modules/client._internal_namespace.md#commonuseractionargs), ``"owner"``\> - - ↳ **`BulkCreateAttachmentDeletionUserAction`** - -## Table of contents - -### Properties - -- [action](client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md#action) -- [attachmentId](client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md#attachmentid) -- [attachments](client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md#attachments) -- [caseId](client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md#caseid) -- [connectorId](client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md#connectorid) -- [unsecuredSavedObjectsClient](client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md#unsecuredsavedobjectsclient) -- [user](client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md#user) - -## Properties - -### action - -• `Optional` **action**: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` - -#### Inherited from - -Omit.action - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:80](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L80) - -___ - -### attachmentId - -• `Optional` **attachmentId**: `string` - -#### Inherited from - -Omit.attachmentId - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:78](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L78) - -___ - -### attachments - -• **attachments**: { `attachment`: { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } ; `id`: `string` ; `owner`: `string` }[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:95](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L95) - -___ - -### caseId - -• **caseId**: `string` - -#### Inherited from - -Omit.caseId - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:76](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L76) - -___ - -### connectorId - -• `Optional` **connectorId**: `string` - -#### Inherited from - -Omit.connectorId - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:79](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L79) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -Omit.unsecuredSavedObjectsClient - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) - -___ - -### user - -• **user**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Inherited from - -Omit.user - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:75](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L75) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md deleted file mode 100644 index 5acc559d72638..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md +++ /dev/null @@ -1,72 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BulkCreateBulkUpdateCaseUserActions - -# Interface: BulkCreateBulkUpdateCaseUserActions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BulkCreateBulkUpdateCaseUserActions - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`BulkCreateBulkUpdateCaseUserActions`** - -## Table of contents - -### Properties - -- [originalCases](client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md#originalcases) -- [unsecuredSavedObjectsClient](client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md#unsecuredsavedobjectsclient) -- [updatedCases](client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md#updatedcases) -- [user](client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md#user) - -## Properties - -### originalCases - -• **originalCases**: [`SavedObject`](client._internal_namespace.SavedObject.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:89](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L89) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) - -___ - -### updatedCases - -• **updatedCases**: [`SavedObjectsUpdateResponse`](client._internal_namespace.SavedObjectsUpdateResponse.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\>[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:90](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L90) - -___ - -### user - -• **user**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:91](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L91) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateCaseDeletionUserAction.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateCaseDeletionUserAction.md deleted file mode 100644 index d925395547e55..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkCreateCaseDeletionUserAction.md +++ /dev/null @@ -1,61 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BulkCreateCaseDeletionUserAction - -# Interface: BulkCreateCaseDeletionUserAction - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BulkCreateCaseDeletionUserAction - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`BulkCreateCaseDeletionUserAction`** - -## Table of contents - -### Properties - -- [cases](client._internal_namespace.BulkCreateCaseDeletionUserAction.md#cases) -- [unsecuredSavedObjectsClient](client._internal_namespace.BulkCreateCaseDeletionUserAction.md#unsecuredsavedobjectsclient) -- [user](client._internal_namespace.BulkCreateCaseDeletionUserAction.md#user) - -## Properties - -### cases - -• **cases**: { `connectorId`: `string` ; `id`: `string` ; `owner`: `string` }[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:78](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L78) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) - -___ - -### user - -• **user**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:79](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L79) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkUpdateAttachmentArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkUpdateAttachmentArgs.md deleted file mode 100644 index ecaf5f4b535f7..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.BulkUpdateAttachmentArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / BulkUpdateAttachmentArgs - -# Interface: BulkUpdateAttachmentArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).BulkUpdateAttachmentArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`BulkUpdateAttachmentArgs`** - -## Table of contents - -### Properties - -- [comments](client._internal_namespace.BulkUpdateAttachmentArgs.md#comments) -- [unsecuredSavedObjectsClient](client._internal_namespace.BulkUpdateAttachmentArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### comments - -• **comments**: [`UpdateArgs`](client._internal_namespace.UpdateArgs.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:62](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L62) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CancellableTask.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CancellableTask.md deleted file mode 100644 index f7a6457695400..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CancellableTask.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CancellableTask - -# Interface: CancellableTask - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CancellableTask - -## Table of contents - -### Properties - -- [cancel](client._internal_namespace.CancellableTask.md#cancel) -- [run](client._internal_namespace.CancellableTask.md#run) - -## Properties - -### cancel - -• `Optional` **cancel**: [`CancelFunction`](../modules/client._internal_namespace.md#cancelfunction) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:68 - -___ - -### run - -• **run**: [`RunFunction`](../modules/client._internal_namespace.md#runfunction) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:67 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Capabilities.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Capabilities.md deleted file mode 100644 index b9cddb8df9faf..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Capabilities.md +++ /dev/null @@ -1,63 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Capabilities - -# Interface: Capabilities - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Capabilities - -The read-only set of capabilities available for the current UI session. -Capabilities are simple key-value pairs of (string, boolean), where the string denotes the capability ID, -and the boolean is a flag indicating if the capability is enabled or disabled. - -## Indexable - -▪ [key: `string`]: `Record`<`string`, `boolean` \| `Record`<`string`, `boolean`\>\> - -Custom capabilities, registered by plugins. - -## Table of contents - -### Properties - -- [catalogue](client._internal_namespace.Capabilities.md#catalogue) -- [management](client._internal_namespace.Capabilities.md#management) -- [navLinks](client._internal_namespace.Capabilities.md#navlinks) - -## Properties - -### catalogue - -• **catalogue**: `Record`<`string`, `boolean`\> - -Catalogue capabilities. Catalogue entries drive the visibility of the Kibana homepage options. - -#### Defined in - -src/core/target/types/types/capabilities.d.ts:16 - -___ - -### management - -• **management**: `Object` - -Management section capabilities. - -#### Index signature - -▪ [sectionId: `string`]: `Record`<`string`, `boolean`\> - -#### Defined in - -src/core/target/types/types/capabilities.d.ts:12 - -___ - -### navLinks - -• **navLinks**: `Record`<`string`, `boolean`\> - -Navigation link capabilities. - -#### Defined in - -src/core/target/types/types/capabilities.d.ts:10 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CaseCommentStats.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CaseCommentStats.md deleted file mode 100644 index e4596ea3eacc1..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CaseCommentStats.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CaseCommentStats - -# Interface: CaseCommentStats - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CaseCommentStats - -## Table of contents - -### Properties - -- [alertTotals](client._internal_namespace.CaseCommentStats.md#alerttotals) -- [commentTotals](client._internal_namespace.CaseCommentStats.md#commenttotals) - -## Properties - -### alertTotals - -• **alertTotals**: `Map`<`string`, `number`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:115](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L115) - -___ - -### commentTotals - -• **commentTotals**: `Map`<`string`, `number`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:114](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L114) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CasesClientArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CasesClientArgs.md deleted file mode 100644 index 9ec38679b26d0..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CasesClientArgs.md +++ /dev/null @@ -1,160 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CasesClientArgs - -# Interface: CasesClientArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CasesClientArgs - -Parameters for initializing a cases client - -## Table of contents - -### Properties - -- [actionsClient](client._internal_namespace.CasesClientArgs.md#actionsclient) -- [alertsService](client._internal_namespace.CasesClientArgs.md#alertsservice) -- [attachmentService](client._internal_namespace.CasesClientArgs.md#attachmentservice) -- [authorization](client._internal_namespace.CasesClientArgs.md#authorization) -- [caseConfigureService](client._internal_namespace.CasesClientArgs.md#caseconfigureservice) -- [caseService](client._internal_namespace.CasesClientArgs.md#caseservice) -- [connectorMappingsService](client._internal_namespace.CasesClientArgs.md#connectormappingsservice) -- [lensEmbeddableFactory](client._internal_namespace.CasesClientArgs.md#lensembeddablefactory) -- [logger](client._internal_namespace.CasesClientArgs.md#logger) -- [unsecuredSavedObjectsClient](client._internal_namespace.CasesClientArgs.md#unsecuredsavedobjectsclient) -- [user](client._internal_namespace.CasesClientArgs.md#user) -- [userActionService](client._internal_namespace.CasesClientArgs.md#useractionservice) - -## Properties - -### actionsClient - -• `Readonly` **actionsClient**: `PublicMethodsOf`<[`ActionsClient`](../modules/client._internal_namespace.md#actionsclient)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:38](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L38) - -___ - -### alertsService - -• `Readonly` **alertsService**: [`AlertService`](../classes/client._internal_namespace.AlertService.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:33](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L33) - -___ - -### attachmentService - -• `Readonly` **attachmentService**: [`AttachmentService`](../classes/client._internal_namespace.AttachmentService.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:34](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L34) - -___ - -### authorization - -• `Readonly` **authorization**: `PublicMethodsOf`<[`Authorization`](../classes/client._internal_namespace.Authorization.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:37](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L37) - -___ - -### caseConfigureService - -• `Readonly` **caseConfigureService**: [`CaseConfigureService`](../classes/client._internal_namespace.CaseConfigureService.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:27](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L27) - -___ - -### caseService - -• `Readonly` **caseService**: [`CasesService`](../classes/client._internal_namespace.CasesService.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:28](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L28) - -___ - -### connectorMappingsService - -• `Readonly` **connectorMappingsService**: [`ConnectorMappingsService`](../classes/client._internal_namespace.ConnectorMappingsService.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:29](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L29) - -___ - -### lensEmbeddableFactory - -• `Readonly` **lensEmbeddableFactory**: () => [`EmbeddableRegistryDefinition`](client._internal_namespace.EmbeddableRegistryDefinition.md)<[`EmbeddableStateWithType`](../modules/client._internal_namespace.md#embeddablestatewithtype)\> - -#### Type declaration - -▸ (): [`EmbeddableRegistryDefinition`](client._internal_namespace.EmbeddableRegistryDefinition.md)<[`EmbeddableStateWithType`](../modules/client._internal_namespace.md#embeddablestatewithtype)\> - -##### Returns - -[`EmbeddableRegistryDefinition`](client._internal_namespace.EmbeddableRegistryDefinition.md)<[`EmbeddableStateWithType`](../modules/client._internal_namespace.md#embeddablestatewithtype)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:36](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L36) - -___ - -### logger - -• `Readonly` **logger**: `Logger` - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:35](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L35) - -___ - -### unsecuredSavedObjectsClient - -• `Readonly` **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:31](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L31) - -___ - -### user - -• `Readonly` **user**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:30](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L30) - -___ - -### userActionService - -• `Readonly` **userActionService**: [`CaseUserActionService`](../classes/client._internal_namespace.CaseUserActionService.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/types.ts:32](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/types.ts#L32) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CasesMapWithPageInfo.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CasesMapWithPageInfo.md deleted file mode 100644 index a39f560b084af..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CasesMapWithPageInfo.md +++ /dev/null @@ -1,54 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CasesMapWithPageInfo - -# Interface: CasesMapWithPageInfo - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CasesMapWithPageInfo - -## Table of contents - -### Properties - -- [casesMap](client._internal_namespace.CasesMapWithPageInfo.md#casesmap) -- [page](client._internal_namespace.CasesMapWithPageInfo.md#page) -- [perPage](client._internal_namespace.CasesMapWithPageInfo.md#perpage) -- [total](client._internal_namespace.CasesMapWithPageInfo.md#total) - -## Properties - -### casesMap - -• **casesMap**: `Map`<`string`, { `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `totalAlerts`: `number` = rt.number; `totalComment`: `number` = rt.number; `version`: `string` = rt.string } & { `comments`: `undefined` \| { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string }[] }\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:119](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L119) - -___ - -### page - -• **page**: `number` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:120](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L120) - -___ - -### perPage - -• **perPage**: `number` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:121](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L121) - -___ - -### total - -• **total**: `number` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:122](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L122) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivileges.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivileges.md deleted file mode 100644 index 6cf7583198177..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivileges.md +++ /dev/null @@ -1,78 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CheckPrivileges - -# Interface: CheckPrivileges - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CheckPrivileges - -## Table of contents - -### Methods - -- [atSpace](client._internal_namespace.CheckPrivileges.md#atspace) -- [atSpaces](client._internal_namespace.CheckPrivileges.md#atspaces) -- [globally](client._internal_namespace.CheckPrivileges.md#globally) - -## Methods - -### atSpace - -▸ **atSpace**(`spaceId`, `privileges`, `options?`): `Promise`<[`CheckPrivilegesResponse`](client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `spaceId` | `string` | -| `privileges` | [`CheckPrivilegesPayload`](client._internal_namespace.CheckPrivilegesPayload.md) | -| `options?` | [`CheckPrivilegesOptions`](client._internal_namespace.CheckPrivilegesOptions.md) | - -#### Returns - -`Promise`<[`CheckPrivilegesResponse`](client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:61 - -___ - -### atSpaces - -▸ **atSpaces**(`spaceIds`, `privileges`, `options?`): `Promise`<[`CheckPrivilegesResponse`](client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `spaceIds` | `string`[] | -| `privileges` | [`CheckPrivilegesPayload`](client._internal_namespace.CheckPrivilegesPayload.md) | -| `options?` | [`CheckPrivilegesOptions`](client._internal_namespace.CheckPrivilegesOptions.md) | - -#### Returns - -`Promise`<[`CheckPrivilegesResponse`](client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:62 - -___ - -### globally - -▸ **globally**(`privileges`, `options?`): `Promise`<[`CheckPrivilegesResponse`](client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `privileges` | [`CheckPrivilegesPayload`](client._internal_namespace.CheckPrivilegesPayload.md) | -| `options?` | [`CheckPrivilegesOptions`](client._internal_namespace.CheckPrivilegesOptions.md) | - -#### Returns - -`Promise`<[`CheckPrivilegesResponse`](client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:63 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesOptions.md deleted file mode 100644 index 85caefaa3b490..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesOptions.md +++ /dev/null @@ -1,27 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CheckPrivilegesOptions - -# Interface: CheckPrivilegesOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CheckPrivilegesOptions - -Options to influce the privilege checks. - -## Table of contents - -### Properties - -- [requireLoginAction](client._internal_namespace.CheckPrivilegesOptions.md#requireloginaction) - -## Properties - -### requireLoginAction - -• `Optional` **requireLoginAction**: `boolean` - -Whether or not the `login` action should be required (default: true). -Setting this to false is not advised except for special circumstances, when you do not require -the request to belong to a user capable of logging into Kibana. - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:31 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesPayload.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesPayload.md deleted file mode 100644 index 29242fb43dbab..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesPayload.md +++ /dev/null @@ -1,39 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CheckPrivilegesPayload - -# Interface: CheckPrivilegesPayload - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CheckPrivilegesPayload - -## Table of contents - -### Properties - -- [elasticsearch](client._internal_namespace.CheckPrivilegesPayload.md#elasticsearch) -- [kibana](client._internal_namespace.CheckPrivilegesPayload.md#kibana) - -## Properties - -### elasticsearch - -• `Optional` **elasticsearch**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `cluster` | `string`[] | -| `index` | `Record`<`string`, `string`[]\> | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:67 - -___ - -### kibana - -• `Optional` **kibana**: `string` \| `string`[] - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:66 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesResponse.md deleted file mode 100644 index 8e4ce4ae9c815..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CheckPrivilegesResponse.md +++ /dev/null @@ -1,52 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CheckPrivilegesResponse - -# Interface: CheckPrivilegesResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CheckPrivilegesResponse - -## Table of contents - -### Properties - -- [hasAllRequested](client._internal_namespace.CheckPrivilegesResponse.md#hasallrequested) -- [privileges](client._internal_namespace.CheckPrivilegesResponse.md#privileges) -- [username](client._internal_namespace.CheckPrivilegesResponse.md#username) - -## Properties - -### hasAllRequested - -• **hasAllRequested**: `boolean` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:34 - -___ - -### privileges - -• **privileges**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `elasticsearch` | `Object` | -| `elasticsearch.cluster` | { `authorized`: `boolean` ; `privilege`: `string` }[] | -| `elasticsearch.index` | `Object` | -| `kibana` | { `authorized`: `boolean` ; `privilege`: `string` ; `resource?`: `string` }[] | - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:36 - -___ - -### username - -• **username**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:35 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs-1.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs-1.md deleted file mode 100644 index ded25fa2ce105..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs-1.md +++ /dev/null @@ -1,55 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ClientArgs - -# Interface: ClientArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ClientArgs - -## Hierarchy - -- **`ClientArgs`** - - ↳ [`GetCaseIdsByAlertIdArgs`](client._internal_namespace.GetCaseIdsByAlertIdArgs.md) - - ↳ [`GetCaseArgs`](client._internal_namespace.GetCaseArgs.md) - - ↳ [`GetCasesArgs`](client._internal_namespace.GetCasesArgs.md) - - ↳ [`FindCasesArgs`](client._internal_namespace.FindCasesArgs.md) - - ↳ [`PostCaseArgs`](client._internal_namespace.PostCaseArgs.md) - - ↳ [`PatchCasesArgs`](client._internal_namespace.PatchCasesArgs.md) - - ↳ [`BulkCreateCaseDeletionUserAction`](client._internal_namespace.BulkCreateCaseDeletionUserAction.md) - - ↳ [`BulkCreateBulkUpdateCaseUserActions`](client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md) - - ↳ [`GetCaseUserActionArgs`](client._internal_namespace.GetCaseUserActionArgs.md) - - ↳ [`CreateUserActionES`](client._internal_namespace.CreateUserActionES.md) - - ↳ [`PostCaseUserActionArgs`](client._internal_namespace.PostCaseUserActionArgs.md) - - ↳ [`AttachedToCaseArgs`](client._internal_namespace.AttachedToCaseArgs.md) - - ↳ [`GetAttachmentArgs`](client._internal_namespace.GetAttachmentArgs.md) - - ↳ [`CreateAttachmentArgs`](client._internal_namespace.CreateAttachmentArgs.md) - - ↳ [`BulkUpdateAttachmentArgs`](client._internal_namespace.BulkUpdateAttachmentArgs.md) - -## Table of contents - -### Properties - -- [unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -## Properties - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs-2.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs-2.md deleted file mode 100644 index 78bc19f876c89..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs-2.md +++ /dev/null @@ -1,31 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ClientArgs - -# Interface: ClientArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ClientArgs - -## Hierarchy - -- **`ClientArgs`** - - ↳ [`FindConnectorMappingsArgs`](client._internal_namespace.FindConnectorMappingsArgs.md) - - ↳ [`PostConnectorMappingsArgs`](client._internal_namespace.PostConnectorMappingsArgs.md) - - ↳ [`UpdateConnectorMappingsArgs`](client._internal_namespace.UpdateConnectorMappingsArgs.md) - -## Table of contents - -### Properties - -- [unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-2.md#unsecuredsavedobjectsclient) - -## Properties - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:15](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L15) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs.md deleted file mode 100644 index 9e5709a8b99ba..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ClientArgs.md +++ /dev/null @@ -1,33 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ClientArgs - -# Interface: ClientArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ClientArgs - -## Hierarchy - -- **`ClientArgs`** - - ↳ [`GetCaseConfigureArgs`](client._internal_namespace.GetCaseConfigureArgs.md) - - ↳ [`FindCaseConfigureArgs`](client._internal_namespace.FindCaseConfigureArgs.md) - - ↳ [`PostCaseConfigureArgs`](client._internal_namespace.PostCaseConfigureArgs.md) - - ↳ [`PatchCaseConfigureArgs`](client._internal_namespace.PatchCaseConfigureArgs.md) - -## Table of contents - -### Properties - -- [unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:30](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L30) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CommonArguments.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CommonArguments.md deleted file mode 100644 index ed1bb0d81f42a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CommonArguments.md +++ /dev/null @@ -1,84 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CommonArguments - -# Interface: CommonArguments - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CommonArguments - -## Table of contents - -### Properties - -- [action](client._internal_namespace.CommonArguments.md#action) -- [attachmentId](client._internal_namespace.CommonArguments.md#attachmentid) -- [caseId](client._internal_namespace.CommonArguments.md#caseid) -- [connectorId](client._internal_namespace.CommonArguments.md#connectorid) -- [owner](client._internal_namespace.CommonArguments.md#owner) -- [user](client._internal_namespace.CommonArguments.md#user) - -## Properties - -### action - -• `Optional` **action**: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:80](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L80) - -___ - -### attachmentId - -• `Optional` **attachmentId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:78](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L78) - -___ - -### caseId - -• **caseId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:76](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L76) - -___ - -### connectorId - -• `Optional` **connectorId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:79](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L79) - -___ - -### owner - -• **owner**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:77](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L77) - -___ - -### user - -• **user**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:75](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L75) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConcreteTaskInstance.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConcreteTaskInstance.md deleted file mode 100644 index db3d362c3dbc3..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConcreteTaskInstance.md +++ /dev/null @@ -1,291 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ConcreteTaskInstance - -# Interface: ConcreteTaskInstance - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ConcreteTaskInstance - -A task instance that has an id and is ready for storage. - -## Hierarchy - -- [`TaskInstance`](client._internal_namespace.TaskInstance.md) - - ↳ **`ConcreteTaskInstance`** - -## Table of contents - -### Properties - -- [attempts](client._internal_namespace.ConcreteTaskInstance.md#attempts) -- [id](client._internal_namespace.ConcreteTaskInstance.md#id) -- [ownerId](client._internal_namespace.ConcreteTaskInstance.md#ownerid) -- [params](client._internal_namespace.ConcreteTaskInstance.md#params) -- [retryAt](client._internal_namespace.ConcreteTaskInstance.md#retryat) -- [runAt](client._internal_namespace.ConcreteTaskInstance.md#runat) -- [schedule](client._internal_namespace.ConcreteTaskInstance.md#schedule) -- [scheduledAt](client._internal_namespace.ConcreteTaskInstance.md#scheduledat) -- [scope](client._internal_namespace.ConcreteTaskInstance.md#scope) -- [startedAt](client._internal_namespace.ConcreteTaskInstance.md#startedat) -- [state](client._internal_namespace.ConcreteTaskInstance.md#state) -- [status](client._internal_namespace.ConcreteTaskInstance.md#status) -- [taskType](client._internal_namespace.ConcreteTaskInstance.md#tasktype) -- [traceparent](client._internal_namespace.ConcreteTaskInstance.md#traceparent) -- [user](client._internal_namespace.ConcreteTaskInstance.md#user) -- [version](client._internal_namespace.ConcreteTaskInstance.md#version) - -## Properties - -### attempts - -• **attempts**: `number` - -The number of unsuccessful attempts since the last successful run. This -will be zeroed out after a successful run. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:244 - -___ - -### id - -• **id**: `string` - -The id of the Elastic document that stores this instance's data. This can -be passed by the caller when scheduling the task. - -#### Overrides - -[TaskInstance](client._internal_namespace.TaskInstance.md).[id](client._internal_namespace.TaskInstance.md#id) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:230 - -___ - -### ownerId - -• **ownerId**: ``null`` \| `string` - -The random uuid of the Kibana instance which claimed ownership of the task last - -#### Overrides - -[TaskInstance](client._internal_namespace.TaskInstance.md).[ownerId](client._internal_namespace.TaskInstance.md#ownerid) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:274 - -___ - -### params - -• **params**: `Record`<`string`, `any`\> - -A task-specific set of parameters, used by the task's run function to tailor -its work. This is generally user-input, such as { sms: '333-444-2222' }. - -#### Inherited from - -[TaskInstance](client._internal_namespace.TaskInstance.md).[params](client._internal_namespace.TaskInstance.md#params) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:182 - -___ - -### retryAt - -• **retryAt**: ``null`` \| `Date` - -The date and time that this task should re-execute if stuck in "running" / timeout -status. This value is only set when status is set to "running". - -#### Overrides - -[TaskInstance](client._internal_namespace.TaskInstance.md).[retryAt](client._internal_namespace.TaskInstance.md#retryat) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:264 - -___ - -### runAt - -• **runAt**: `Date` - -The date and time that this task is scheduled to be run. It is not guaranteed -to run at this time, but it is guaranteed not to run earlier than this. - -#### Overrides - -[TaskInstance](client._internal_namespace.TaskInstance.md).[runAt](client._internal_namespace.TaskInstance.md#runat) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:253 - -___ - -### schedule - -• `Optional` **schedule**: [`IntervalSchedule`](client._internal_namespace.IntervalSchedule.md) - -A TaskSchedule string, which specifies this as a recurring task. - -Currently, this supports a single format: an interval in minutes or seconds (e.g. '5m', '30s'). - -#### Inherited from - -[TaskInstance](client._internal_namespace.TaskInstance.md).[schedule](client._internal_namespace.TaskInstance.md#schedule) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:177 - -___ - -### scheduledAt - -• **scheduledAt**: `Date` - -The date and time that this task was originally scheduled. This is used -for convenience to task run functions, and for troubleshooting. - -#### Overrides - -[TaskInstance](client._internal_namespace.TaskInstance.md).[scheduledAt](client._internal_namespace.TaskInstance.md#scheduledat) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:239 - -___ - -### scope - -• `Optional` **scope**: `string`[] - -Used to group tasks for querying. So, reporting might schedule tasks with a scope of 'reporting', -and then query such tasks to provide a glimpse at only reporting tasks, rather than at all tasks. - -#### Inherited from - -[TaskInstance](client._internal_namespace.TaskInstance.md).[scope](client._internal_namespace.TaskInstance.md#scope) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:201 - -___ - -### startedAt - -• **startedAt**: ``null`` \| `Date` - -The date and time that this task started execution. This is used to determine -the "real" runAt that ended up running the task. This value is only set -when status is set to "running". - -#### Overrides - -[TaskInstance](client._internal_namespace.TaskInstance.md).[startedAt](client._internal_namespace.TaskInstance.md#startedat) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:259 - -___ - -### state - -• **state**: `Record`<`string`, `any`\> - -The state passed into the task's run function, and returned by the previous -run. If there was no previous run, or if the previous run did not return -any state, this will be the empy object: {} - -#### Overrides - -[TaskInstance](client._internal_namespace.TaskInstance.md).[state](client._internal_namespace.TaskInstance.md#state) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:270 - -___ - -### status - -• **status**: [`TaskStatus`](../enums/client._internal_namespace.TaskStatus.md) - -Indicates whether or not the task is currently running. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:248 - -___ - -### taskType - -• **taskType**: `string` - -The task definition type whose run function will execute this instance. - -#### Inherited from - -[TaskInstance](client._internal_namespace.TaskInstance.md).[taskType](client._internal_namespace.TaskInstance.md#tasktype) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:149 - -___ - -### traceparent - -• `Optional` **traceparent**: `string` - -The serialized traceparent string of the current APM transaction or span. - -#### Inherited from - -[TaskInstance](client._internal_namespace.TaskInstance.md).[traceparent](client._internal_namespace.TaskInstance.md#traceparent) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:192 - -___ - -### user - -• `Optional` **user**: `string` - -The id of the user who scheduled this task. - -#### Inherited from - -[TaskInstance](client._internal_namespace.TaskInstance.md).[user](client._internal_namespace.TaskInstance.md#user) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:196 - -___ - -### version - -• `Optional` **version**: `string` - -The saved object version from the Elaticsearch document. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:234 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConnectorToken.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConnectorToken.md deleted file mode 100644 index c60e9bca79a7f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConnectorToken.md +++ /dev/null @@ -1,82 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ConnectorToken - -# Interface: ConnectorToken - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ConnectorToken - -## Hierarchy - -- [`SavedObjectAttributes`](client._internal_namespace.SavedObjectAttributes.md) - - ↳ **`ConnectorToken`** - -## Table of contents - -### Properties - -- [connectorId](client._internal_namespace.ConnectorToken.md#connectorid) -- [createdAt](client._internal_namespace.ConnectorToken.md#createdat) -- [expiresAt](client._internal_namespace.ConnectorToken.md#expiresat) -- [token](client._internal_namespace.ConnectorToken.md#token) -- [tokenType](client._internal_namespace.ConnectorToken.md#tokentype) -- [updatedAt](client._internal_namespace.ConnectorToken.md#updatedat) - -## Properties - -### connectorId - -• **connectorId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:123 - -___ - -### createdAt - -• **createdAt**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:127 - -___ - -### expiresAt - -• **expiresAt**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:126 - -___ - -### token - -• **token**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:125 - -___ - -### tokenType - -• **tokenType**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:124 - -___ - -### updatedAt - -• `Optional` **updatedAt**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:128 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions-1.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions-1.md deleted file mode 100644 index 1f7901ac983f1..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions-1.md +++ /dev/null @@ -1,60 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ConstructorOptions - -# Interface: ConstructorOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ConstructorOptions - -## Table of contents - -### Properties - -- [authentication](client._internal_namespace.ConstructorOptions-1.md#authentication) -- [authorization](client._internal_namespace.ConstructorOptions-1.md#authorization) -- [authorizationMode](client._internal_namespace.ConstructorOptions-1.md#authorizationmode) -- [request](client._internal_namespace.ConstructorOptions-1.md#request) - -## Properties - -### authentication - -• `Optional` **authentication**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `getCurrentUser` | (`request`: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\>) => ``null`` \| [`AuthenticatedUser`](client._internal_namespace.AuthenticatedUser.md) | - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:7 - -___ - -### authorization - -• `Optional` **authorization**: [`AuthorizationServiceSetup`](client._internal_namespace.AuthorizationServiceSetup.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:6 - -___ - -### authorizationMode - -• `Optional` **authorizationMode**: [`AuthorizationMode`](../enums/client._internal_namespace.AuthorizationMode.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:8 - -___ - -### request - -• **request**: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/authorization/actions_authorization.d.ts:5 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions-2.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions-2.md deleted file mode 100644 index fed308c053049..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions-2.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ConstructorOptions - -# Interface: ConstructorOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ConstructorOptions - -## Table of contents - -### Properties - -- [encryptedSavedObjectsClient](client._internal_namespace.ConstructorOptions-2.md#encryptedsavedobjectsclient) -- [logger](client._internal_namespace.ConstructorOptions-2.md#logger) -- [unsecuredSavedObjectsClient](client._internal_namespace.ConstructorOptions-2.md#unsecuredsavedobjectsclient) - -## Properties - -### encryptedSavedObjectsClient - -• **encryptedSavedObjectsClient**: [`EncryptedSavedObjectsClient`](client._internal_namespace.EncryptedSavedObjectsClient.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:6 - -___ - -### logger - -• **logger**: `Logger` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:8 - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:7 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions.md deleted file mode 100644 index 67923b89864f8..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ConstructorOptions.md +++ /dev/null @@ -1,153 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ConstructorOptions - -# Interface: ConstructorOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ConstructorOptions - -## Table of contents - -### Properties - -- [actionExecutor](client._internal_namespace.ConstructorOptions.md#actionexecutor) -- [actionTypeRegistry](client._internal_namespace.ConstructorOptions.md#actiontyperegistry) -- [auditLogger](client._internal_namespace.ConstructorOptions.md#auditlogger) -- [authorization](client._internal_namespace.ConstructorOptions.md#authorization) -- [connectorTokenClient](client._internal_namespace.ConstructorOptions.md#connectortokenclient) -- [defaultKibanaIndex](client._internal_namespace.ConstructorOptions.md#defaultkibanaindex) -- [ephemeralExecutionEnqueuer](client._internal_namespace.ConstructorOptions.md#ephemeralexecutionenqueuer) -- [executionEnqueuer](client._internal_namespace.ConstructorOptions.md#executionenqueuer) -- [preconfiguredActions](client._internal_namespace.ConstructorOptions.md#preconfiguredactions) -- [request](client._internal_namespace.ConstructorOptions.md#request) -- [scopedClusterClient](client._internal_namespace.ConstructorOptions.md#scopedclusterclient) -- [unsecuredSavedObjectsClient](client._internal_namespace.ConstructorOptions.md#unsecuredsavedobjectsclient) -- [usageCounter](client._internal_namespace.ConstructorOptions.md#usagecounter) - -## Properties - -### actionExecutor - -• **actionExecutor**: [`ActionExecutorContract`](../modules/client._internal_namespace.md#actionexecutorcontract) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:30 - -___ - -### actionTypeRegistry - -• **actionTypeRegistry**: [`ActionTypeRegistry`](../classes/client._internal_namespace.ActionTypeRegistry.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:27 - -___ - -### auditLogger - -• `Optional` **auditLogger**: [`AuditLogger`](client._internal_namespace.AuditLogger.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:35 - -___ - -### authorization - -• **authorization**: [`ActionsAuthorization`](../classes/client._internal_namespace.ActionsAuthorization.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:34 - -___ - -### connectorTokenClient - -• **connectorTokenClient**: [`ConnectorTokenClientContract`](../modules/client._internal_namespace.md#connectortokenclientcontract) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:37 - -___ - -### defaultKibanaIndex - -• **defaultKibanaIndex**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:25 - -___ - -### ephemeralExecutionEnqueuer - -• **ephemeralExecutionEnqueuer**: [`ExecutionEnqueuer`](../modules/client._internal_namespace.md#executionenqueuer)<[`RunNowResult`](client._internal_namespace.RunNowResult.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:32 - -___ - -### executionEnqueuer - -• **executionEnqueuer**: [`ExecutionEnqueuer`](../modules/client._internal_namespace.md#executionenqueuer)<`void`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:31 - -___ - -### preconfiguredActions - -• **preconfiguredActions**: [`PreConfiguredAction`](client._internal_namespace.PreConfiguredAction.md)<[`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig), [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets)\>[] - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:29 - -___ - -### request - -• **request**: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:33 - -___ - -### scopedClusterClient - -• **scopedClusterClient**: [`IScopedClusterClient`](client._internal_namespace.IScopedClusterClient.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:26 - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:28 - -___ - -### usageCounter - -• `Optional` **usageCounter**: [`IUsageCounter`](client._internal_namespace.IUsageCounter.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:36 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CountActionsAttachedToCaseArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CountActionsAttachedToCaseArgs.md deleted file mode 100644 index a71324b5543ff..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CountActionsAttachedToCaseArgs.md +++ /dev/null @@ -1,72 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CountActionsAttachedToCaseArgs - -# Interface: CountActionsAttachedToCaseArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CountActionsAttachedToCaseArgs - -## Hierarchy - -- [`AttachedToCaseArgs`](client._internal_namespace.AttachedToCaseArgs.md) - - ↳ **`CountActionsAttachedToCaseArgs`** - -## Table of contents - -### Properties - -- [aggregations](client._internal_namespace.CountActionsAttachedToCaseArgs.md#aggregations) -- [caseId](client._internal_namespace.CountActionsAttachedToCaseArgs.md#caseid) -- [filter](client._internal_namespace.CountActionsAttachedToCaseArgs.md#filter) -- [unsecuredSavedObjectsClient](client._internal_namespace.CountActionsAttachedToCaseArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### aggregations - -• **aggregations**: `Record`<`string`, `AggregationsAggregationContainer`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:40](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L40) - -___ - -### caseId - -• **caseId**: `string` - -#### Inherited from - -[AttachedToCaseArgs](client._internal_namespace.AttachedToCaseArgs.md).[caseId](client._internal_namespace.AttachedToCaseArgs.md#caseid) - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:33](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L33) - -___ - -### filter - -• `Optional` **filter**: `KueryNode` - -#### Inherited from - -[AttachedToCaseArgs](client._internal_namespace.AttachedToCaseArgs.md).[filter](client._internal_namespace.AttachedToCaseArgs.md#filter) - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:34](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L34) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[AttachedToCaseArgs](client._internal_namespace.AttachedToCaseArgs.md).[unsecuredSavedObjectsClient](client._internal_namespace.AttachedToCaseArgs.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateAttachmentArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateAttachmentArgs.md deleted file mode 100644 index 50030284f8fb6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateAttachmentArgs.md +++ /dev/null @@ -1,64 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CreateAttachmentArgs - -# Interface: CreateAttachmentArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CreateAttachmentArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`CreateAttachmentArgs`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.CreateAttachmentArgs.md#attributes) -- [id](client._internal_namespace.CreateAttachmentArgs.md#id) -- [references](client._internal_namespace.CreateAttachmentArgs.md#references) -- [unsecuredSavedObjectsClient](client._internal_namespace.CreateAttachmentArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### attributes - -• **attributes**: { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:48](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L48) - -___ - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:50](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L50) - -___ - -### references - -• **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:49](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L49) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateAuditMsgParams.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateAuditMsgParams.md deleted file mode 100644 index 30c4ab0076bf0..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateAuditMsgParams.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CreateAuditMsgParams - -# Interface: CreateAuditMsgParams - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CreateAuditMsgParams - -## Table of contents - -### Properties - -- [entity](client._internal_namespace.CreateAuditMsgParams.md#entity) -- [error](client._internal_namespace.CreateAuditMsgParams.md#error) -- [operation](client._internal_namespace.CreateAuditMsgParams.md#operation) - -## Properties - -### entity - -• `Optional` **entity**: [`OwnerEntity`](client._internal_namespace.OwnerEntity.md) - -#### Defined in - -[x-pack/plugins/cases/server/authorization/audit_logger.ts:15](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/audit_logger.ts#L15) - -___ - -### error - -• `Optional` **error**: `Error` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/audit_logger.ts:16](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/audit_logger.ts#L16) - -___ - -### operation - -• **operation**: [`OperationDetails`](client._internal_namespace.OperationDetails.md) - -#### Defined in - -[x-pack/plugins/cases/server/authorization/audit_logger.ts:14](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/audit_logger.ts#L14) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateOptions-1.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateOptions-1.md deleted file mode 100644 index 77e84843801b5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateOptions-1.md +++ /dev/null @@ -1,54 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CreateOptions - -# Interface: CreateOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CreateOptions - -## Table of contents - -### Properties - -- [connectorId](client._internal_namespace.CreateOptions-1.md#connectorid) -- [expiresAtMillis](client._internal_namespace.CreateOptions-1.md#expiresatmillis) -- [token](client._internal_namespace.CreateOptions-1.md#token) -- [tokenType](client._internal_namespace.CreateOptions-1.md#tokentype) - -## Properties - -### connectorId - -• **connectorId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:11 - -___ - -### expiresAtMillis - -• **expiresAtMillis**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:13 - -___ - -### token - -• **token**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:12 - -___ - -### tokenType - -• `Optional` **tokenType**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:14 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateOptions.md deleted file mode 100644 index 1070beb2f0304..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateOptions.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CreateOptions - -# Interface: CreateOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CreateOptions - -## Table of contents - -### Properties - -- [action](client._internal_namespace.CreateOptions.md#action) - -## Properties - -### action - -• **action**: [`Action`](client._internal_namespace.Action.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:22 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateUserAction.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateUserAction.md deleted file mode 100644 index 5211a50019cae..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateUserAction.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CreateUserAction - -# Interface: CreateUserAction - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CreateUserAction - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | extends keyof [`BuilderParameters`](client._internal_namespace.BuilderParameters.md) | - -## Table of contents - -### Properties - -- [payload](client._internal_namespace.CreateUserAction.md#payload) -- [type](client._internal_namespace.CreateUserAction.md#type) - -## Properties - -### payload - -• **payload**: [`BuilderParameters`](client._internal_namespace.BuilderParameters.md)[`T`][``"parameters"``][``"payload"``] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:68](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L68) - -___ - -### type - -• **type**: `T` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:67](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L67) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateUserActionES.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateUserActionES.md deleted file mode 100644 index efc0b67c18a3e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.CreateUserActionES.md +++ /dev/null @@ -1,59 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / CreateUserActionES - -# Interface: CreateUserActionES - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).CreateUserActionES - -## Type parameters - -| Name | -| :------ | -| `T` | - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`CreateUserActionES`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.CreateUserActionES.md#attributes) -- [references](client._internal_namespace.CreateUserActionES.md#references) -- [unsecuredSavedObjectsClient](client._internal_namespace.CreateUserActionES.md#unsecuredsavedobjectsclient) - -## Properties - -### attributes - -• **attributes**: `T` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:71](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L71) - -___ - -### references - -• **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:72](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L72) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.DecoratedError.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.DecoratedError.md deleted file mode 100644 index 77ef99caaf16a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.DecoratedError.md +++ /dev/null @@ -1,27 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / DecoratedError - -# Interface: DecoratedError - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).DecoratedError - -## Hierarchy - -- `Boom` - - ↳ **`DecoratedError`** - -## Table of contents - -### Properties - -- [[code]](client._internal_namespace.DecoratedError.md#[code]) - -## Properties - -### [code] - -• `Optional` **[code]**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/errors.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ElasticsearchFeatureConfig.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ElasticsearchFeatureConfig.md deleted file mode 100644 index 373ba63e5c659..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ElasticsearchFeatureConfig.md +++ /dev/null @@ -1,94 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ElasticsearchFeatureConfig - -# Interface: ElasticsearchFeatureConfig - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ElasticsearchFeatureConfig - -Interface for registering an Elasticsearch feature. -Feature registration allows plugins to hide their applications based -on configured cluster or index privileges. - -## Table of contents - -### Properties - -- [catalogue](client._internal_namespace.ElasticsearchFeatureConfig.md#catalogue) -- [id](client._internal_namespace.ElasticsearchFeatureConfig.md#id) -- [management](client._internal_namespace.ElasticsearchFeatureConfig.md#management) -- [privileges](client._internal_namespace.ElasticsearchFeatureConfig.md#privileges) - -## Properties - -### catalogue - -• `Optional` **catalogue**: `string`[] - -If this feature includes a catalogue entry, you can specify them here to control visibility based on the current space. - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:34 - -___ - -### id - -• **id**: `string` - -Unique identifier for this feature. -This identifier is also used when generating UI Capabilities. - -**`see`** UICapabilities - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:15 - -___ - -### management - -• `Optional` **management**: `Object` - -Management sections associated with this feature. - -**`example`** -```ts - // Enables access to the "Advanced Settings" management page within the Kibana section - management: { - kibana: ['settings'] - } -``` - -#### Index signature - -▪ [sectionId: `string`]: `string`[] - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:27 - -___ - -### privileges - -• **privileges**: [`FeatureElasticsearchPrivileges`](client._internal_namespace.FeatureElasticsearchPrivileges.md)[] - -Feature privilege definition. Specify one or more privileges which grant access to this feature. -Users must satisfy all privileges in at least one of the defined sets of privileges in order to be granted access. - -**`example`** -```ts - [{ - requiredClusterPrivileges: ['monitor'], - requiredIndexPrivileges: { - ['metricbeat-*']: ['read', 'view_index_metadata'] - } - }] -``` - -**`see`** FeatureElasticsearchPrivileges - -#### Defined in - -x-pack/plugins/features/target/types/common/elasticsearch_feature.d.ts:50 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.EmbeddableRegistryDefinition.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.EmbeddableRegistryDefinition.md deleted file mode 100644 index 6a4eba88cc91d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.EmbeddableRegistryDefinition.md +++ /dev/null @@ -1,157 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / EmbeddableRegistryDefinition - -# Interface: EmbeddableRegistryDefinition - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).EmbeddableRegistryDefinition - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `P` | extends [`EmbeddableStateWithType`](../modules/client._internal_namespace.md#embeddablestatewithtype) = [`EmbeddableStateWithType`](../modules/client._internal_namespace.md#embeddablestatewithtype) | - -## Hierarchy - -- [`PersistableStateDefinition`](../modules/client._internal_namespace.md#persistablestatedefinition)<`P`\> - - ↳ **`EmbeddableRegistryDefinition`** - -## Table of contents - -### Properties - -- [id](client._internal_namespace.EmbeddableRegistryDefinition.md#id) -- [migrations](client._internal_namespace.EmbeddableRegistryDefinition.md#migrations) - -### Methods - -- [extract](client._internal_namespace.EmbeddableRegistryDefinition.md#extract) -- [inject](client._internal_namespace.EmbeddableRegistryDefinition.md#inject) -- [telemetry](client._internal_namespace.EmbeddableRegistryDefinition.md#telemetry) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -src/plugins/embeddable/target/types/server/types.d.ts:13 - -___ - -### migrations - -• `Optional` **migrations**: [`MigrateFunctionsObject`](../modules/client._internal_namespace.md#migratefunctionsobject) \| [`GetMigrationFunctionObjectFn`](../modules/client._internal_namespace.md#getmigrationfunctionobjectfn) - -A list of migration functions, which migrate the persistable state -serializable object to the next version. Migration functions should are -keyed by the Kibana version using semver, where the version indicates to -which version the state will be migrated to. - -#### Inherited from - -PersistableStateDefinition.migrations - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:75 - -## Methods - -### extract - -▸ `Optional` **extract**(`state`): `Object` - -A function which receives state and should return the state with references -extracted and an array of the extracted references. The default case could -simply return the same state with an empty array of references. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `state` | `P` | The persistable state serializable state object. | - -#### Returns - -`Object` - -Persistable state object with references extracted and a list of - references. - -| Name | Type | -| :------ | :------ | -| `references` | [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] | -| `state` | `P` | - -#### Inherited from - -PersistableStateDefinition.extract - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:65 - -___ - -### inject - -▸ `Optional` **inject**(`state`, `references`): `P` - -A function which receives state and a list of references and should return -back the state with references injected. The default is an identity -function. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `state` | `P` | The persistable state serializable state object. | -| `references` | [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] | List of saved object references. | - -#### Returns - -`P` - -Persistable state object with references injected. - -#### Inherited from - -PersistableStateDefinition.inject - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:55 - -___ - -### telemetry - -▸ `Optional` **telemetry**(`state`, `stats`): `Record`<`string`, `any`\> - -Function which reports telemetry information. This function is essentially -a "reducer" - it receives the existing "stats" object and returns an -updated version of the "stats" object. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `state` | `P` | The persistable state serializable state object. | -| `stats` | `Record`<`string`, `any`\> | Stats object containing the stats which were already collected. This `stats` object shall not be mutated in-line. | - -#### Returns - -`Record`<`string`, `any`\> - -A new stats object augmented with new telemetry information. - -#### Inherited from - -PersistableStateDefinition.telemetry - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:45 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.EncryptedSavedObjectsClient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.EncryptedSavedObjectsClient.md deleted file mode 100644 index fff1cd9a9e369..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.EncryptedSavedObjectsClient.md +++ /dev/null @@ -1,39 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / EncryptedSavedObjectsClient - -# Interface: EncryptedSavedObjectsClient - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).EncryptedSavedObjectsClient - -## Table of contents - -### Methods - -- [getDecryptedAsInternalUser](client._internal_namespace.EncryptedSavedObjectsClient.md#getdecryptedasinternaluser) - -## Methods - -### getDecryptedAsInternalUser - -▸ **getDecryptedAsInternalUser**<`T`\>(`type`, `id`, `options?`): `Promise`<[`SavedObject`](client._internal_namespace.SavedObject.md)<`T`\>\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `type` | `string` | -| `id` | `string` | -| `options?` | [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) | - -#### Returns - -`Promise`<[`SavedObject`](client._internal_namespace.SavedObject.md)<`T`\>\> - -#### Defined in - -x-pack/plugins/encrypted_saved_objects/target/types/server/saved_objects/index.d.ts:18 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ExecuteOptions-1.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ExecuteOptions-1.md deleted file mode 100644 index 4004d5c484793..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ExecuteOptions-1.md +++ /dev/null @@ -1,101 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ExecuteOptions - -# Interface: ExecuteOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ExecuteOptions - -## Hierarchy - -- `Pick`<[`ExecuteOptions`](client._internal_namespace.ExecuteOptions.md), ``"params"`` \| ``"source"``\> - - ↳ **`ExecuteOptions`** - -## Table of contents - -### Properties - -- [apiKey](client._internal_namespace.ExecuteOptions-1.md#apikey) -- [executionId](client._internal_namespace.ExecuteOptions-1.md#executionid) -- [id](client._internal_namespace.ExecuteOptions-1.md#id) -- [params](client._internal_namespace.ExecuteOptions-1.md#params) -- [relatedSavedObjects](client._internal_namespace.ExecuteOptions-1.md#relatedsavedobjects) -- [source](client._internal_namespace.ExecuteOptions-1.md#source) -- [spaceId](client._internal_namespace.ExecuteOptions-1.md#spaceid) - -## Properties - -### apiKey - -• **apiKey**: ``null`` \| `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/create_execute_function.d.ts:15 - -___ - -### executionId - -• **executionId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/create_execute_function.d.ts:16 - -___ - -### id - -• **id**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/create_execute_function.d.ts:13 - -___ - -### params - -• **params**: `Record`<`string`, `unknown`\> - -#### Inherited from - -Pick.params - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:28 - -___ - -### relatedSavedObjects - -• `Optional` **relatedSavedObjects**: `Readonly`<{ `namespace?`: `string` ; `typeId?`: `string` } & { `id`: `string` ; `type`: `string` }\>[] - -#### Defined in - -x-pack/plugins/actions/target/types/server/create_execute_function.d.ts:17 - -___ - -### source - -• `Optional` **source**: [`ActionExecutionSource`](client._internal_namespace.ActionExecutionSource.md)<`unknown`\> - -#### Inherited from - -Pick.source - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:29 - -___ - -### spaceId - -• **spaceId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/create_execute_function.d.ts:14 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ExecuteOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ExecuteOptions.md deleted file mode 100644 index fb808b1afbbee..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ExecuteOptions.md +++ /dev/null @@ -1,104 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ExecuteOptions - -# Interface: ExecuteOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ExecuteOptions - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Source` | `unknown` | - -## Table of contents - -### Properties - -- [actionId](client._internal_namespace.ExecuteOptions.md#actionid) -- [executionId](client._internal_namespace.ExecuteOptions.md#executionid) -- [isEphemeral](client._internal_namespace.ExecuteOptions.md#isephemeral) -- [params](client._internal_namespace.ExecuteOptions.md#params) -- [relatedSavedObjects](client._internal_namespace.ExecuteOptions.md#relatedsavedobjects) -- [request](client._internal_namespace.ExecuteOptions.md#request) -- [source](client._internal_namespace.ExecuteOptions.md#source) -- [taskInfo](client._internal_namespace.ExecuteOptions.md#taskinfo) - -## Properties - -### actionId - -• **actionId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:25 - -___ - -### executionId - -• `Optional` **executionId**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:31 - -___ - -### isEphemeral - -• `Optional` **isEphemeral**: `boolean` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:26 - -___ - -### params - -• **params**: `Record`<`string`, `unknown`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:28 - -___ - -### relatedSavedObjects - -• `Optional` **relatedSavedObjects**: `Readonly`<{ `namespace?`: `string` ; `typeId?`: `string` } & { `id`: `string` ; `type`: `string` }\>[] - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:32 - -___ - -### request - -• **request**: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:27 - -___ - -### source - -• `Optional` **source**: [`ActionExecutionSource`](client._internal_namespace.ActionExecutionSource.md)<`Source`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:29 - -___ - -### taskInfo - -• `Optional` **taskInfo**: [`TaskInfo`](client._internal_namespace.TaskInfo.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:30 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureElasticsearchPrivileges.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureElasticsearchPrivileges.md deleted file mode 100644 index bb462c5341233..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureElasticsearchPrivileges.md +++ /dev/null @@ -1,106 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FeatureElasticsearchPrivileges - -# Interface: FeatureElasticsearchPrivileges - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FeatureElasticsearchPrivileges - -Elasticsearch Feature privilege definition - -## Table of contents - -### Properties - -- [requiredClusterPrivileges](client._internal_namespace.FeatureElasticsearchPrivileges.md#requiredclusterprivileges) -- [requiredIndexPrivileges](client._internal_namespace.FeatureElasticsearchPrivileges.md#requiredindexprivileges) -- [requiredRoles](client._internal_namespace.FeatureElasticsearchPrivileges.md#requiredroles) -- [ui](client._internal_namespace.FeatureElasticsearchPrivileges.md#ui) - -## Properties - -### requiredClusterPrivileges - -• **requiredClusterPrivileges**: `string`[] - -A set of Elasticsearch cluster privileges which are required for this feature to be enabled. -See https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_elasticsearch_privileges.d.ts:10 - -___ - -### requiredIndexPrivileges - -• `Optional` **requiredIndexPrivileges**: `Object` - -A set of Elasticsearch index privileges which are required for this feature to be enabled, keyed on index name or pattern. -See https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html#privileges-list-indices - -**`example`** - -Requiring `read` access to `logstash-*` and `all` access to `foo-*` -```ts -feature.registerElasticsearchPrivilege({ - privileges: [{ - requiredIndexPrivileges: { - ['logstash-*']: ['read'], - ['foo-*]: ['all'] - } - }] -}) -``` - -#### Index signature - -▪ [indexName: `string`]: `string`[] - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_elasticsearch_privileges.d.ts:30 - -___ - -### requiredRoles - -• `Optional` **requiredRoles**: `string`[] - -A set of Elasticsearch roles which are required for this feature to be enabled. - -**`deprecated`** do not rely on hard-coded role names. - -This is relied on by the reporting feature, and should be removed once reporting -migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/issues/19914 - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_elasticsearch_privileges.d.ts:41 - -___ - -### ui - -• **ui**: `string`[] - -A list of UI Capabilities that should be granted to users with this privilege. -These capabilities will automatically be namespaces within your feature id. - -**`example`** -```ts - { - ui: ['show', 'save'] - } - - This translates in the UI to the following (assuming a feature id of "foo"): - import { uiCapabilities } from 'ui/capabilities'; - - const canShowApp = uiCapabilities.foo.show; - const canSave = uiCapabilities.foo.save; -``` -Note: Since these are automatically namespaced, you are free to use generic names like "show" and "save". - -**`see`** UICapabilities - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_elasticsearch_privileges.d.ts:62 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureKibanaPrivileges.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureKibanaPrivileges.md deleted file mode 100644 index caf57a8ff8987..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureKibanaPrivileges.md +++ /dev/null @@ -1,246 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FeatureKibanaPrivileges - -# Interface: FeatureKibanaPrivileges - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FeatureKibanaPrivileges - -Feature privilege definition - -## Table of contents - -### Properties - -- [alerting](client._internal_namespace.FeatureKibanaPrivileges.md#alerting) -- [api](client._internal_namespace.FeatureKibanaPrivileges.md#api) -- [app](client._internal_namespace.FeatureKibanaPrivileges.md#app) -- [cases](client._internal_namespace.FeatureKibanaPrivileges.md#cases) -- [catalogue](client._internal_namespace.FeatureKibanaPrivileges.md#catalogue) -- [disabled](client._internal_namespace.FeatureKibanaPrivileges.md#disabled) -- [excludeFromBasePrivileges](client._internal_namespace.FeatureKibanaPrivileges.md#excludefrombaseprivileges) -- [management](client._internal_namespace.FeatureKibanaPrivileges.md#management) -- [requireAllSpaces](client._internal_namespace.FeatureKibanaPrivileges.md#requireallspaces) -- [savedObject](client._internal_namespace.FeatureKibanaPrivileges.md#savedobject) -- [ui](client._internal_namespace.FeatureKibanaPrivileges.md#ui) - -## Properties - -### alerting - -• `Optional` **alerting**: `Object` - -If your feature requires access to specific Alert Types, then specify your access needs here. -Include both Alert Types registered by the feature and external Alert Types such as built-in -Alert Types and Alert Types provided by other features to which you wish to grant access. - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `alert?` | `Object` | -| `alert.all?` | readonly `string`[] | -| `alert.read?` | readonly `string`[] | -| `rule?` | `Object` | -| `rule.all?` | readonly `string`[] | -| `rule.read?` | readonly `string`[] | - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:82 - -___ - -### api - -• `Optional` **api**: readonly `string`[] - -If your feature includes server-side APIs, you can tag those routes to secure access based on user permissions. - -**`example`** -```ts - // Configure your routes with a tag starting with the 'access:' prefix - server.route({ - path: '/api/my-route', - method: 'GET', - handler: () => { ...}, - options: { - tags: ['access:my_feature-admin'] - } - }); - - Then, specify the tags here (without the 'access:' prefix) which should be secured: - - { - api: ['my_feature-admin'] - } -``` - -NOTE: It is important to name your tags in a way that will not collide with other plugins/features. -A generic tag name like "access:read" could be used elsewhere, and access to that API endpoint would also -extend to any routes you have also tagged with that name. - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:64 - -___ - -### app - -• `Optional` **app**: readonly `string`[] - -If your feature exposes a client-side application (most of them do!), then you can control access to them here. - -**`example`** -```ts - { - app: ['my-app', 'kibana'] - } -``` - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:76 - -___ - -### cases - -• `Optional` **cases**: `Object` - -If your feature requires access to specific owners of cases (aka plugins that have created cases), then specify your access needs here. The values here should -be unique identifiers for the owners of cases you want access to. - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `all?` | readonly `string`[] | List of case owners which users should have full read/write access to when granted this privilege. **`example`** ```ts { all: ['securitySolution'] } ``` | -| `read?` | readonly `string`[] | List of case owners which users should have read-only access to when granted this privilege. **`example`** ```ts { read: ['securitySolution'] } ``` | - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:132 - -___ - -### catalogue - -• `Optional` **catalogue**: readonly `string`[] - -If this feature includes a catalogue entry, you can specify them here to control visibility based on user permissions. - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:37 - -___ - -### disabled - -• `Optional` **disabled**: `boolean` - -Whether or not this privilege should be hidden in the roles UI and disallowed on the API. Defaults to `false`. - -**`deprecated`** - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:18 - -___ - -### excludeFromBasePrivileges - -• `Optional` **excludeFromBasePrivileges**: `boolean` - -Whether or not this specific privilege should be excluded from the base privileges. - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:8 - -___ - -### management - -• `Optional` **management**: `Object` - -If this feature includes management sections, you can specify them here to control visibility of those -pages based on user privileges. - -**`example`** -```ts - // Enables access to the "Advanced Settings" management page within the Kibana section - management: { - kibana: ['settings'] - } -``` - -#### Index signature - -▪ [sectionId: `string`]: readonly `string`[] - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:31 - -___ - -### requireAllSpaces - -• `Optional` **requireAllSpaces**: `boolean` - -Whether or not this privilege should only be granted to `All Spaces *`. Should be used for features that do not -support Spaces. Defaults to `false`. - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:13 - -___ - -### savedObject - -• **savedObject**: `Object` - -If your feature requires access to specific saved objects, then specify your access needs here. - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `all` | readonly `string`[] | List of saved object types which users should have full read/write access to when granted this privilege. **`example`** ```ts { all: ['my-saved-object-type'] } ``` | -| `read` | readonly `string`[] | List of saved object types which users should have read-only access to when granted this privilege. **`example`** ```ts { read: ['config'] } ``` | - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:157 - -___ - -### ui - -• **ui**: readonly `string`[] - -A list of UI Capabilities that should be granted to users with this privilege. -These capabilities will automatically be namespaces within your feature id. - -**`example`** -```ts - { - ui: ['show', 'save'] - } - - This translates in the UI to the following (assuming a feature id of "foo"): - import { uiCapabilities } from 'ui/capabilities'; - - const canShowApp = uiCapabilities.foo.show; - const canSave = uiCapabilities.foo.save; -``` -Note: Since these are automatically namespaced, you are free to use generic names like "show" and "save". - -**`see`** UICapabilities - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:199 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureUsageServiceSetup.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureUsageServiceSetup.md deleted file mode 100644 index 77770e22b41e2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FeatureUsageServiceSetup.md +++ /dev/null @@ -1,34 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FeatureUsageServiceSetup - -# Interface: FeatureUsageServiceSetup - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FeatureUsageServiceSetup - -## Table of contents - -### Methods - -- [register](client._internal_namespace.FeatureUsageServiceSetup.md#register) - -## Methods - -### register - -▸ **register**(`featureName`, `licenseType`): `void` - -Register a feature to be able to notify of it's usages using the {@link FeatureUsageServiceStart | service start contract}. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `featureName` | `string` | -| `licenseType` | ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/licensing/target/types/server/services/feature_usage_service.d.ts:7 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindActionResult.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindActionResult.md deleted file mode 100644 index e7306b5d7b931..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindActionResult.md +++ /dev/null @@ -1,117 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FindActionResult - -# Interface: FindActionResult - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FindActionResult - -## Hierarchy - -- [`ActionResult`](client._internal_namespace.ActionResult.md) - - ↳ **`FindActionResult`** - -## Table of contents - -### Properties - -- [actionTypeId](client._internal_namespace.FindActionResult.md#actiontypeid) -- [config](client._internal_namespace.FindActionResult.md#config) -- [id](client._internal_namespace.FindActionResult.md#id) -- [isMissingSecrets](client._internal_namespace.FindActionResult.md#ismissingsecrets) -- [isPreconfigured](client._internal_namespace.FindActionResult.md#ispreconfigured) -- [name](client._internal_namespace.FindActionResult.md#name) -- [referencedByCount](client._internal_namespace.FindActionResult.md#referencedbycount) - -## Properties - -### actionTypeId - -• **actionTypeId**: `string` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[actionTypeId](client._internal_namespace.ActionResult.md#actiontypeid) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:50 - -___ - -### config - -• `Optional` **config**: [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[config](client._internal_namespace.ActionResult.md#config) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:53 - -___ - -### id - -• **id**: `string` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[id](client._internal_namespace.ActionResult.md#id) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:49 - -___ - -### isMissingSecrets - -• `Optional` **isMissingSecrets**: `boolean` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[isMissingSecrets](client._internal_namespace.ActionResult.md#ismissingsecrets) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:52 - -___ - -### isPreconfigured - -• **isPreconfigured**: `boolean` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[isPreconfigured](client._internal_namespace.ActionResult.md#ispreconfigured) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:54 - -___ - -### name - -• **name**: `string` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[name](client._internal_namespace.ActionResult.md#name) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:51 - -___ - -### referencedByCount - -• **referencedByCount**: `number` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:60 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCaseCommentsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCaseCommentsArgs.md deleted file mode 100644 index a5b1689fc0e9b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCaseCommentsArgs.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FindCaseCommentsArgs - -# Interface: FindCaseCommentsArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FindCaseCommentsArgs - -## Table of contents - -### Properties - -- [id](client._internal_namespace.FindCaseCommentsArgs.md#id) -- [options](client._internal_namespace.FindCaseCommentsArgs.md#options) -- [unsecuredSavedObjectsClient](client._internal_namespace.FindCaseCommentsArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### id - -• **id**: `string` \| `string`[] - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:84](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L84) - -___ - -### options - -• `Optional` **options**: [`SavedObjectFindOptionsKueryNode`](../modules/client._internal_namespace.md#savedobjectfindoptionskuerynode) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:85](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L85) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:83](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L83) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCaseConfigureArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCaseConfigureArgs.md deleted file mode 100644 index 5e3635fe0c3ec..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCaseConfigureArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FindCaseConfigureArgs - -# Interface: FindCaseConfigureArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FindCaseConfigureArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs.md) - - ↳ **`FindCaseConfigureArgs`** - -## Table of contents - -### Properties - -- [options](client._internal_namespace.FindCaseConfigureArgs.md#options) -- [unsecuredSavedObjectsClient](client._internal_namespace.FindCaseConfigureArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### options - -• `Optional` **options**: [`SavedObjectFindOptionsKueryNode`](../modules/client._internal_namespace.md#savedobjectfindoptionskuerynode) - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:37](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L37) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:30](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L30) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCasesArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCasesArgs.md deleted file mode 100644 index 0ac807ecaadac..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCasesArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FindCasesArgs - -# Interface: FindCasesArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FindCasesArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`FindCasesArgs`** - -## Table of contents - -### Properties - -- [options](client._internal_namespace.FindCasesArgs.md#options) -- [unsecuredSavedObjectsClient](client._internal_namespace.FindCasesArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### options - -• `Optional` **options**: [`SavedObjectFindOptionsKueryNode`](../modules/client._internal_namespace.md#savedobjectfindoptionskuerynode) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:89](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L89) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCommentsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCommentsArgs.md deleted file mode 100644 index b88437b3e33a8..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindCommentsArgs.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FindCommentsArgs - -# Interface: FindCommentsArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FindCommentsArgs - -## Table of contents - -### Properties - -- [id](client._internal_namespace.FindCommentsArgs.md#id) -- [options](client._internal_namespace.FindCommentsArgs.md#options) -- [unsecuredSavedObjectsClient](client._internal_namespace.FindCommentsArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### id - -• **id**: `string` \| `string`[] - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:78](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L78) - -___ - -### options - -• `Optional` **options**: [`SavedObjectFindOptionsKueryNode`](../modules/client._internal_namespace.md#savedobjectfindoptionskuerynode) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:79](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L79) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:77](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L77) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindConnectorMappingsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindConnectorMappingsArgs.md deleted file mode 100644 index 5f70d4ae539e8..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.FindConnectorMappingsArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / FindConnectorMappingsArgs - -# Interface: FindConnectorMappingsArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).FindConnectorMappingsArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-2.md) - - ↳ **`FindConnectorMappingsArgs`** - -## Table of contents - -### Properties - -- [options](client._internal_namespace.FindConnectorMappingsArgs.md#options) -- [unsecuredSavedObjectsClient](client._internal_namespace.FindConnectorMappingsArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### options - -• `Optional` **options**: [`SavedObjectFindOptionsKueryNode`](../modules/client._internal_namespace.md#savedobjectfindoptionskuerynode) - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:18](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L18) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-2.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-2.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:15](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L15) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetAllSpacesOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetAllSpacesOptions.md deleted file mode 100644 index 905d61791cb2e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetAllSpacesOptions.md +++ /dev/null @@ -1,44 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetAllSpacesOptions - -# Interface: GetAllSpacesOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetAllSpacesOptions - -Controls how spaces are retrieved. - -## Table of contents - -### Properties - -- [includeAuthorizedPurposes](client._internal_namespace.GetAllSpacesOptions.md#includeauthorizedpurposes) -- [purpose](client._internal_namespace.GetAllSpacesOptions.md#purpose) - -## Properties - -### includeAuthorizedPurposes - -• `Optional` **includeAuthorizedPurposes**: `boolean` - -Set to true to return a set of flags indicating which purposes the user is authorized for. - -**`see`** GetAllSpacesPurpose - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:65 - -___ - -### purpose - -• `Optional` **purpose**: [`GetAllSpacesPurpose`](../modules/client._internal_namespace.md#getallspacespurpose) - -An optional purpose describing how the set of spaces will be used. -The default purpose (`any`) will retrieve all spaces the user is authorized to see, -whereas a more specific purpose will retrieve all spaces the user is authorized to perform a specific action within. - -**`see`** GetAllSpacesPurpose - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:59 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetAttachmentArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetAttachmentArgs.md deleted file mode 100644 index 39f6f288c84c5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetAttachmentArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetAttachmentArgs - -# Interface: GetAttachmentArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetAttachmentArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`GetAttachmentArgs`** - -## Table of contents - -### Properties - -- [attachmentId](client._internal_namespace.GetAttachmentArgs.md#attachmentid) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetAttachmentArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### attachmentId - -• **attachmentId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:44](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L44) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseArgs.md deleted file mode 100644 index 5cca6876f1821..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetCaseArgs - -# Interface: GetCaseArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetCaseArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`GetCaseArgs`** - -## Table of contents - -### Properties - -- [id](client._internal_namespace.GetCaseArgs.md#id) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetCaseArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:69](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L69) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseConfigureArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseConfigureArgs.md deleted file mode 100644 index 2aa37a7bf78a9..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseConfigureArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetCaseConfigureArgs - -# Interface: GetCaseConfigureArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetCaseConfigureArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs.md) - - ↳ **`GetCaseConfigureArgs`** - -## Table of contents - -### Properties - -- [configurationId](client._internal_namespace.GetCaseConfigureArgs.md#configurationid) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetCaseConfigureArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### configurationId - -• **configurationId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:34](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L34) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:30](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L30) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseIdsByAlertIdArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseIdsByAlertIdArgs.md deleted file mode 100644 index 267aa4fe7100a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseIdsByAlertIdArgs.md +++ /dev/null @@ -1,53 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetCaseIdsByAlertIdArgs - -# Interface: GetCaseIdsByAlertIdArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetCaseIdsByAlertIdArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`GetCaseIdsByAlertIdArgs`** - -## Table of contents - -### Properties - -- [alertId](client._internal_namespace.GetCaseIdsByAlertIdArgs.md#alertid) -- [filter](client._internal_namespace.GetCaseIdsByAlertIdArgs.md#filter) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetCaseIdsByAlertIdArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### alertId - -• **alertId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:59](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L59) - -___ - -### filter - -• `Optional` **filter**: `KueryNode` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:60](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L60) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseUserActionArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseUserActionArgs.md deleted file mode 100644 index 08edac1f82b2c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCaseUserActionArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetCaseUserActionArgs - -# Interface: GetCaseUserActionArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetCaseUserActionArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`GetCaseUserActionArgs`** - -## Table of contents - -### Properties - -- [caseId](client._internal_namespace.GetCaseUserActionArgs.md#caseid) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetCaseUserActionArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### caseId - -• **caseId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:58](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L58) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCasesArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCasesArgs.md deleted file mode 100644 index d5e802e19b9c0..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetCasesArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetCasesArgs - -# Interface: GetCasesArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetCasesArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`GetCasesArgs`** - -## Table of contents - -### Properties - -- [caseIds](client._internal_namespace.GetCasesArgs.md#caseids) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetCasesArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### caseIds - -• **caseIds**: `string`[] - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:73](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L73) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetReportersArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetReportersArgs.md deleted file mode 100644 index af1116f4c3ddb..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetReportersArgs.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetReportersArgs - -# Interface: GetReportersArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetReportersArgs - -## Table of contents - -### Properties - -- [filter](client._internal_namespace.GetReportersArgs.md#filter) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetReportersArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### filter - -• `Optional` **filter**: `KueryNode` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:134](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L134) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:133](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L133) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetSpaceResult.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetSpaceResult.md deleted file mode 100644 index 8e4162988105e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetSpaceResult.md +++ /dev/null @@ -1,176 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetSpaceResult - -# Interface: GetSpaceResult - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetSpaceResult - -Response format when querying for spaces. - -## Hierarchy - -- [`Space`](client._internal_namespace.Space.md) - - ↳ **`GetSpaceResult`** - -## Table of contents - -### Properties - -- [\_reserved](client._internal_namespace.GetSpaceResult.md#_reserved) -- [authorizedPurposes](client._internal_namespace.GetSpaceResult.md#authorizedpurposes) -- [color](client._internal_namespace.GetSpaceResult.md#color) -- [description](client._internal_namespace.GetSpaceResult.md#description) -- [disabledFeatures](client._internal_namespace.GetSpaceResult.md#disabledfeatures) -- [id](client._internal_namespace.GetSpaceResult.md#id) -- [imageUrl](client._internal_namespace.GetSpaceResult.md#imageurl) -- [initials](client._internal_namespace.GetSpaceResult.md#initials) -- [name](client._internal_namespace.GetSpaceResult.md#name) - -## Properties - -### \_reserved - -• `Optional` `Private` **\_reserved**: `boolean` - -Indicates that this space is reserved (system controlled). -Reserved spaces cannot be created or deleted by end-users. - -#### Inherited from - -[Space](client._internal_namespace.Space.md).[_reserved](client._internal_namespace.Space.md#_reserved) - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:46 - -___ - -### authorizedPurposes - -• `Optional` **authorizedPurposes**: `Record`<[`GetAllSpacesPurpose`](../modules/client._internal_namespace.md#getallspacespurpose), `boolean`\> - -A set of flags indicating which purposes the user is authorized for. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:82 - -___ - -### color - -• `Optional` **color**: `string` - -Optional color (hex code) for this space. -If neither `color` nor `imageUrl` is specified, then a color will be automatically generated. - -#### Inherited from - -[Space](client._internal_namespace.Space.md).[color](client._internal_namespace.Space.md#color) - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:24 - -___ - -### description - -• `Optional` **description**: `string` - -Optional description for this space. - -#### Inherited from - -[Space](client._internal_namespace.Space.md).[description](client._internal_namespace.Space.md#description) - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:19 - -___ - -### disabledFeatures - -• **disabledFeatures**: `string`[] - -The set of feature ids that should be hidden within this space. - -#### Inherited from - -[Space](client._internal_namespace.Space.md).[disabledFeatures](client._internal_namespace.Space.md#disabledfeatures) - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:40 - -___ - -### id - -• **id**: `string` - -The unique identifier for this space. -The id becomes part of the "URL Identifier" of the space. - -Example: an id of `marketing` would result in the URL identifier of `/s/marketing`. - -#### Inherited from - -[Space](client._internal_namespace.Space.md).[id](client._internal_namespace.Space.md#id) - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:11 - -___ - -### imageUrl - -• `Optional` **imageUrl**: `string` - -Optional base-64 encoded data image url to show as this space's avatar. -This setting takes precedence over any configured `color` or `initials`. - -#### Inherited from - -[Space](client._internal_namespace.Space.md).[imageUrl](client._internal_namespace.Space.md#imageurl) - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:36 - -___ - -### initials - -• `Optional` **initials**: `string` - -Optional display initials for this space's avatar. Supports a maximum of 2 characters. -If initials are not provided, then they will be derived from the space name automatically. - -Initials are not displayed if an `imageUrl` has been specified. - -#### Inherited from - -[Space](client._internal_namespace.Space.md).[initials](client._internal_namespace.Space.md#initials) - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:31 - -___ - -### name - -• **name**: `string` - -Display name for this space. - -#### Inherited from - -[Space](client._internal_namespace.Space.md).[name](client._internal_namespace.Space.md#name) - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:15 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetTagsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetTagsArgs.md deleted file mode 100644 index 31088513fe67f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetTagsArgs.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetTagsArgs - -# Interface: GetTagsArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetTagsArgs - -## Table of contents - -### Properties - -- [filter](client._internal_namespace.GetTagsArgs.md#filter) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetTagsArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### filter - -• `Optional` **filter**: `KueryNode` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:129](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L129) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:128](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L128) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetUserActionItemByDifference.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetUserActionItemByDifference.md deleted file mode 100644 index 50f9ae9a6fc34..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetUserActionItemByDifference.md +++ /dev/null @@ -1,162 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetUserActionItemByDifference - -# Interface: GetUserActionItemByDifference - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetUserActionItemByDifference - -## Hierarchy - -- [`CommonUserActionArgs`](../modules/client._internal_namespace.md#commonuseractionargs) - - ↳ **`GetUserActionItemByDifference`** - -## Table of contents - -### Properties - -- [action](client._internal_namespace.GetUserActionItemByDifference.md#action) -- [attachmentId](client._internal_namespace.GetUserActionItemByDifference.md#attachmentid) -- [caseId](client._internal_namespace.GetUserActionItemByDifference.md#caseid) -- [connectorId](client._internal_namespace.GetUserActionItemByDifference.md#connectorid) -- [field](client._internal_namespace.GetUserActionItemByDifference.md#field) -- [newValue](client._internal_namespace.GetUserActionItemByDifference.md#newvalue) -- [originalValue](client._internal_namespace.GetUserActionItemByDifference.md#originalvalue) -- [owner](client._internal_namespace.GetUserActionItemByDifference.md#owner) -- [unsecuredSavedObjectsClient](client._internal_namespace.GetUserActionItemByDifference.md#unsecuredsavedobjectsclient) -- [user](client._internal_namespace.GetUserActionItemByDifference.md#user) - -## Properties - -### action - -• `Optional` **action**: ``"add"`` \| ``"create"`` \| ``"delete"`` \| ``"update"`` \| ``"push_to_service"`` - -#### Inherited from - -CommonUserActionArgs.action - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:80](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L80) - -___ - -### attachmentId - -• `Optional` **attachmentId**: `string` - -#### Inherited from - -CommonUserActionArgs.attachmentId - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:78](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L78) - -___ - -### caseId - -• **caseId**: `string` - -#### Inherited from - -CommonUserActionArgs.caseId - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:76](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L76) - -___ - -### connectorId - -• `Optional` **connectorId**: `string` - -#### Inherited from - -CommonUserActionArgs.connectorId - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:79](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L79) - -___ - -### field - -• **field**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:83](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L83) - -___ - -### newValue - -• **newValue**: `unknown` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:85](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L85) - -___ - -### originalValue - -• **originalValue**: `unknown` - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:84](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L84) - -___ - -### owner - -• **owner**: `string` - -#### Inherited from - -CommonUserActionArgs.owner - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:77](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L77) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -CommonUserActionArgs.unsecuredSavedObjectsClient - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) - -___ - -### user - -• **user**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Inherited from - -CommonUserActionArgs.user - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:75](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L75) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetUserArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetUserArgs.md deleted file mode 100644 index d4913925ff206..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.GetUserArgs.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / GetUserArgs - -# Interface: GetUserArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).GetUserArgs - -## Table of contents - -### Properties - -- [request](client._internal_namespace.GetUserArgs.md#request) - -## Properties - -### request - -• **request**: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:110](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L110) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IEventLogger.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IEventLogger.md deleted file mode 100644 index a1b44e51859d4..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IEventLogger.md +++ /dev/null @@ -1,73 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / IEventLogger - -# Interface: IEventLogger - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).IEventLogger - -## Table of contents - -### Methods - -- [logEvent](client._internal_namespace.IEventLogger.md#logevent) -- [startTiming](client._internal_namespace.IEventLogger.md#starttiming) -- [stopTiming](client._internal_namespace.IEventLogger.md#stoptiming) - -## Methods - -### logEvent - -▸ **logEvent**(`properties`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `properties` | [`IEvent`](../modules/client._internal_namespace.md#ievent) | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/event_log/target/types/server/types.d.ts:34 - -___ - -### startTiming - -▸ **startTiming**(`event`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `event` | [`IEvent`](../modules/client._internal_namespace.md#ievent) | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/event_log/target/types/server/types.d.ts:35 - -___ - -### stopTiming - -▸ **stopTiming**(`event`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `event` | [`IEvent`](../modules/client._internal_namespace.md#ievent) | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/event_log/target/types/server/types.d.ts:36 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IKibanaSocket.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IKibanaSocket.md deleted file mode 100644 index cc2ea54f3975a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IKibanaSocket.md +++ /dev/null @@ -1,150 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / IKibanaSocket - -# Interface: IKibanaSocket - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).IKibanaSocket - -A tiny abstraction for TCP socket. - -## Table of contents - -### Properties - -- [authorizationError](client._internal_namespace.IKibanaSocket.md#authorizationerror) -- [authorized](client._internal_namespace.IKibanaSocket.md#authorized) - -### Methods - -- [getPeerCertificate](client._internal_namespace.IKibanaSocket.md#getpeercertificate) -- [getProtocol](client._internal_namespace.IKibanaSocket.md#getprotocol) -- [renegotiate](client._internal_namespace.IKibanaSocket.md#renegotiate) - -## Properties - -### authorizationError - -• `Optional` `Readonly` **authorizationError**: `Error` - -The reason why the peer's certificate has not been verified. This property becomes available -only when `authorized` is `false`. - -#### Defined in - -src/core/target/types/server/http/router/socket.d.ts:45 - -___ - -### authorized - -• `Optional` `Readonly` **authorized**: `boolean` - -Indicates whether or not the peer certificate was signed by one of the specified CAs. When TLS -isn't used the value is `undefined`. - -#### Defined in - -src/core/target/types/server/http/router/socket.d.ts:40 - -## Methods - -### getPeerCertificate - -▸ **getPeerCertificate**(`detailed`): ``null`` \| `DetailedPeerCertificate` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `detailed` | ``true`` | - -#### Returns - -``null`` \| `DetailedPeerCertificate` - -#### Defined in - -src/core/target/types/server/http/router/socket.d.ts:9 - -▸ **getPeerCertificate**(`detailed`): ``null`` \| `PeerCertificate` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `detailed` | ``false`` | - -#### Returns - -``null`` \| `PeerCertificate` - -#### Defined in - -src/core/target/types/server/http/router/socket.d.ts:10 - -▸ **getPeerCertificate**(`detailed?`): ``null`` \| `DetailedPeerCertificate` \| `PeerCertificate` - -Returns an object representing the peer's certificate. -The returned object has some properties corresponding to the field of the certificate. -If detailed argument is true the full chain with issuer property will be returned, -if false only the top certificate without issuer property. -If the peer does not provide a certificate, it returns null. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `detailed?` | `boolean` | If true; the full chain with issuer property will be returned. | - -#### Returns - -``null`` \| `DetailedPeerCertificate` \| `PeerCertificate` - -An object representing the peer's certificate. - -#### Defined in - -src/core/target/types/server/http/router/socket.d.ts:20 - -___ - -### getProtocol - -▸ **getProtocol**(): ``null`` \| `string` - -Returns a string containing the negotiated SSL/TLS protocol version of the current connection. The value 'unknown' will be returned for -connected sockets that have not completed the handshaking process. The value null will be returned for server sockets or disconnected -client sockets. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information. - -#### Returns - -``null`` \| `string` - -#### Defined in - -src/core/target/types/server/http/router/socket.d.ts:26 - -___ - -### renegotiate - -▸ **renegotiate**(`options`): `Promise`<`void`\> - -Renegotiates a connection to obtain the peer's certificate. This cannot be used when the protocol version is TLSv1.3. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options` | `Object` | The options may contain the following fields: rejectUnauthorized, requestCert (See tls.createServer() for details). | -| `options.rejectUnauthorized?` | `boolean` | - | -| `options.requestCert?` | `boolean` | - | - -#### Returns - -`Promise`<`void`\> - -A Promise that will be resolved if renegotiation succeeded, or will be rejected if renegotiation failed. - -#### Defined in - -src/core/target/types/server/http/router/socket.d.ts:32 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ILicense.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ILicense.md deleted file mode 100644 index 8449411b85e42..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ILicense.md +++ /dev/null @@ -1,236 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ILicense - -# Interface: ILicense - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ILicense - -## Table of contents - -### Properties - -- [error](client._internal_namespace.ILicense.md#error) -- [expiryDateInMillis](client._internal_namespace.ILicense.md#expirydateinmillis) -- [isActive](client._internal_namespace.ILicense.md#isactive) -- [isAvailable](client._internal_namespace.ILicense.md#isavailable) -- [mode](client._internal_namespace.ILicense.md#mode) -- [signature](client._internal_namespace.ILicense.md#signature) -- [status](client._internal_namespace.ILicense.md#status) -- [type](client._internal_namespace.ILicense.md#type) -- [uid](client._internal_namespace.ILicense.md#uid) - -### Methods - -- [check](client._internal_namespace.ILicense.md#check) -- [getFeature](client._internal_namespace.ILicense.md#getfeature) -- [getUnavailableReason](client._internal_namespace.ILicense.md#getunavailablereason) -- [hasAtLeast](client._internal_namespace.ILicense.md#hasatleast) -- [toJSON](client._internal_namespace.ILicense.md#tojson) - -## Properties - -### error - -• `Optional` **error**: `string` - -A potential error denoting the failure of the license from being retrieved. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:119 - -___ - -### expiryDateInMillis - -• `Optional` **expiryDateInMillis**: `number` - -Unix epoch of the expiration date of the license. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:94 - -___ - -### isActive - -• **isActive**: `boolean` - -Determine if the status of the license is active. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:90 - -___ - -### isAvailable - -• **isAvailable**: `boolean` - -Determine if the license container has information. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:111 - -___ - -### mode - -• `Optional` **mode**: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -The license type, being usually one of basic, standard, gold, platinum, or trial. - -**`deprecated`** use 'type' instead. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:103 - -___ - -### signature - -• **signature**: `string` - -Signature of the license content. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:107 - -___ - -### status - -• `Optional` **status**: [`LicenseStatus`](../modules/client._internal_namespace.md#licensestatus) - -The validity status of the license. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:86 - -___ - -### type - -• `Optional` **type**: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -The license type, being usually one of basic, standard, gold, platinum, or trial. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:98 - -___ - -### uid - -• `Optional` **uid**: `string` - -UID for license. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:82 - -## Methods - -### check - -▸ **check**(`pluginName`, `minimumLicenseRequired`): [`LicenseCheck`](client._internal_namespace.LicenseCheck.md) - -For a given plugin and license type, receive information about the status of the license. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `pluginName` | `string` | the name of the plugin | -| `minimumLicenseRequired` | ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` | the minimum valid license for operating the given plugin | - -#### Returns - -[`LicenseCheck`](client._internal_namespace.LicenseCheck.md) - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:134 - -___ - -### getFeature - -▸ **getFeature**(`name`): [`LicenseFeature`](client._internal_namespace.LicenseFeature.md) - -A specific API for interacting with the specific features of the license. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `name` | `string` | the name of the feature to interact with | - -#### Returns - -[`LicenseFeature`](client._internal_namespace.LicenseFeature.md) - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:139 - -___ - -### getUnavailableReason - -▸ **getUnavailableReason**(): `undefined` \| `string` - -If the license is not available, provides a string or Error containing the reason. - -#### Returns - -`undefined` \| `string` - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:123 - -___ - -### hasAtLeast - -▸ **hasAtLeast**(`minimumLicenseRequired`): `boolean` - -Determine if license type >= minimal required license type. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `minimumLicenseRequired` | ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` | the minimum valid license required for the given feature | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:128 - -___ - -### toJSON - -▸ **toJSON**(): [`PublicLicenseJSON`](client._internal_namespace.PublicLicenseJSON.md) - -Returns - -#### Returns - -[`PublicLicenseJSON`](client._internal_namespace.PublicLicenseJSON.md) - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:115 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md deleted file mode 100644 index 17a5e67c8b2b6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md +++ /dev/null @@ -1,61 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ISavedObjectsPointInTimeFinder - -# Interface: ISavedObjectsPointInTimeFinder - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ISavedObjectsPointInTimeFinder - -## Type parameters - -| Name | -| :------ | -| `T` | -| `A` | - -## Table of contents - -### Methods - -- [close](client._internal_namespace.ISavedObjectsPointInTimeFinder.md#close) -- [find](client._internal_namespace.ISavedObjectsPointInTimeFinder.md#find) - -## Methods - -### close - -▸ **close**(): `Promise`<`void`\> - -Closes the Point-In-Time associated with this finder instance. - -Once you have retrieved all of the results you need, it is recommended -to call `close()` to clean up the PIT and prevent Elasticsearch from -consuming resources unnecessarily. This is only required if you are -done iterating and have not yet paged through all of the results: the -PIT will automatically be closed for you once you reach the last page -of results, or if the underlying call to `find` fails for any reason. - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/point_in_time_finder.d.ts:43 - -___ - -### find - -▸ **find**(): `AsyncGenerator`<[`SavedObjectsFindResponse`](client._internal_namespace.SavedObjectsFindResponse.md)<`T`, `A`\>, `any`, `unknown`\> - -An async generator which wraps calls to `savedObjectsClient.find` and -iterates over multiple pages of results using `_pit` and `search_after`. -This will open a new Point-In-Time (PIT), and continue paging until a set -of results is received that's smaller than the designated `perPage` size. - -#### Returns - -`AsyncGenerator`<[`SavedObjectsFindResponse`](client._internal_namespace.SavedObjectsFindResponse.md)<`T`, `A`\>, `any`, `unknown`\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/point_in_time_finder.d.ts:32 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IScopedClusterClient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IScopedClusterClient.md deleted file mode 100644 index 47f8263232290..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IScopedClusterClient.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / IScopedClusterClient - -# Interface: IScopedClusterClient - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).IScopedClusterClient - -Serves the same purpose as the normal {@link IClusterClient | cluster client} but exposes -an additional `asCurrentUser` method that doesn't use credentials of the Kibana internal -user (as `asInternalUser` does) to request Elasticsearch API, but rather passes HTTP headers -extracted from the current user request to the API instead. - -## Table of contents - -### Properties - -- [asCurrentUser](client._internal_namespace.IScopedClusterClient.md#ascurrentuser) -- [asInternalUser](client._internal_namespace.IScopedClusterClient.md#asinternaluser) - -## Properties - -### asCurrentUser - -• `Readonly` **asCurrentUser**: [`ElasticsearchClient`](../modules/client._internal_namespace.md#elasticsearchclient) - -A [client](../modules/client._internal_namespace.md#elasticsearchclient) to be used to query the elasticsearch cluster -on behalf of the user that initiated the request to the Kibana server. - -#### Defined in - -src/core/target/types/server/elasticsearch/client/scoped_cluster_client.d.ts:20 - -___ - -### asInternalUser - -• `Readonly` **asInternalUser**: [`ElasticsearchClient`](../modules/client._internal_namespace.md#elasticsearchclient) - -A [client](../modules/client._internal_namespace.md#elasticsearchclient) to be used to query the elasticsearch cluster -on behalf of the internal Kibana user. - -#### Defined in - -src/core/target/types/server/elasticsearch/client/scoped_cluster_client.d.ts:15 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ISpacesClient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ISpacesClient.md deleted file mode 100644 index 5b7aab2435b5a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ISpacesClient.md +++ /dev/null @@ -1,151 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ISpacesClient - -# Interface: ISpacesClient - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ISpacesClient - -Client interface for interacting with spaces. - -## Table of contents - -### Methods - -- [create](client._internal_namespace.ISpacesClient.md#create) -- [delete](client._internal_namespace.ISpacesClient.md#delete) -- [disableLegacyUrlAliases](client._internal_namespace.ISpacesClient.md#disablelegacyurlaliases) -- [get](client._internal_namespace.ISpacesClient.md#get) -- [getAll](client._internal_namespace.ISpacesClient.md#getall) -- [update](client._internal_namespace.ISpacesClient.md#update) - -## Methods - -### create - -▸ **create**(`space`): `Promise`<[`Space`](client._internal_namespace.Space.md)\> - -Creates a space. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `space` | [`Space`](client._internal_namespace.Space.md) | the space to create. | - -#### Returns - -`Promise`<[`Space`](client._internal_namespace.Space.md)\> - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_client/spaces_client.d.ts:22 - -___ - -### delete - -▸ **delete**(`id`): `Promise`<`void`\> - -Deletes a space, and all saved objects belonging to that space. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `id` | `string` | the id of the space to delete. | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_client/spaces_client.d.ts:33 - -___ - -### disableLegacyUrlAliases - -▸ **disableLegacyUrlAliases**(`aliases`): `Promise`<`void`\> - -Disables the specified legacy URL aliases. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `aliases` | [`LegacyUrlAliasTarget`](client._internal_namespace.LegacyUrlAliasTarget.md)[] | the aliases to disable. | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_client/spaces_client.d.ts:38 - -___ - -### get - -▸ **get**(`id`): `Promise`<[`Space`](client._internal_namespace.Space.md)\> - -Retrieve a space by its id. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `id` | `string` | the space id. | - -#### Returns - -`Promise`<[`Space`](client._internal_namespace.Space.md)\> - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_client/spaces_client.d.ts:17 - -___ - -### getAll - -▸ **getAll**(`options?`): `Promise`<[`GetSpaceResult`](client._internal_namespace.GetSpaceResult.md)[]\> - -Retrieve all available spaces. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `options?` | [`GetAllSpacesOptions`](client._internal_namespace.GetAllSpacesOptions.md) | controls which spaces are retrieved. | - -#### Returns - -`Promise`<[`GetSpaceResult`](client._internal_namespace.GetSpaceResult.md)[]\> - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_client/spaces_client.d.ts:12 - -___ - -### update - -▸ **update**(`id`, `space`): `Promise`<[`Space`](client._internal_namespace.Space.md)\> - -Updates a space. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `id` | `string` | the id of the space to update. | -| `space` | [`Space`](client._internal_namespace.Space.md) | the updated space. | - -#### Returns - -`Promise`<[`Space`](client._internal_namespace.Space.md)\> - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_client/spaces_client.d.ts:28 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IUsageCounter.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IUsageCounter.md deleted file mode 100644 index 9ed76ff78e51b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IUsageCounter.md +++ /dev/null @@ -1,37 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / IUsageCounter - -# Interface: IUsageCounter - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).IUsageCounter - -Usage Counter allows to keep track of any events that occur. -By calling [IUsageCounter.incrementCounter](client._internal_namespace.IUsageCounter.md#incrementcounter) devs can notify this -API whenever the event happens. - -## Table of contents - -### Methods - -- [incrementCounter](client._internal_namespace.IUsageCounter.md#incrementcounter) - -## Methods - -### incrementCounter - -▸ **incrementCounter**(`params`): `void` - -Notifies the counter about a new event happening so it can increase the count internally. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `params` | [`IncrementCounterParams`](client._internal_namespace.IncrementCounterParams.md) | [IncrementCounterParams](client._internal_namespace.IncrementCounterParams.md) | - -#### Returns - -`void` - -#### Defined in - -src/plugins/usage_collection/target/types/server/usage_counters/usage_counter.d.ts:33 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IncrementCounterParams.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IncrementCounterParams.md deleted file mode 100644 index 0c79f0d867cdc..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IncrementCounterParams.md +++ /dev/null @@ -1,51 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / IncrementCounterParams - -# Interface: IncrementCounterParams - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).IncrementCounterParams - -Details about the counter to be incremented - -## Table of contents - -### Properties - -- [counterName](client._internal_namespace.IncrementCounterParams.md#countername) -- [counterType](client._internal_namespace.IncrementCounterParams.md#countertype) -- [incrementBy](client._internal_namespace.IncrementCounterParams.md#incrementby) - -## Properties - -### counterName - -• **counterName**: `string` - -The name of the counter - -#### Defined in - -src/plugins/usage_collection/target/types/server/usage_counters/usage_counter.d.ts:17 - -___ - -### counterType - -• `Optional` **counterType**: `string` - -The counter type ("count" by default) - -#### Defined in - -src/plugins/usage_collection/target/types/server/usage_counters/usage_counter.d.ts:19 - -___ - -### incrementBy - -• `Optional` **incrementBy**: `number` - -Increment the counter by this number (1 if not specified) - -#### Defined in - -src/plugins/usage_collection/target/types/server/usage_counters/usage_counter.d.ts:21 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IndexMapping.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IndexMapping.md deleted file mode 100644 index 71cfddb7c8981..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IndexMapping.md +++ /dev/null @@ -1,45 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / IndexMapping - -# Interface: IndexMapping - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).IndexMapping - -**`internal`** - -## Table of contents - -### Properties - -- [\_meta](client._internal_namespace.IndexMapping.md#_meta) -- [dynamic](client._internal_namespace.IndexMapping.md#dynamic) -- [properties](client._internal_namespace.IndexMapping.md#properties) - -## Properties - -### \_meta - -• `Optional` **\_meta**: [`IndexMappingMeta`](client._internal_namespace.IndexMappingMeta.md) - -#### Defined in - -src/core/target/types/server/saved_objects/mappings/types.d.ts:104 - -___ - -### dynamic - -• `Optional` **dynamic**: `boolean` \| ``"strict"`` - -#### Defined in - -src/core/target/types/server/saved_objects/mappings/types.d.ts:102 - -___ - -### properties - -• **properties**: [`SavedObjectsMappingProperties`](client._internal_namespace.SavedObjectsMappingProperties.md) - -#### Defined in - -src/core/target/types/server/saved_objects/mappings/types.d.ts:103 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IndexMappingMeta.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IndexMappingMeta.md deleted file mode 100644 index de9e76ae00099..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IndexMappingMeta.md +++ /dev/null @@ -1,27 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / IndexMappingMeta - -# Interface: IndexMappingMeta - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).IndexMappingMeta - -**`internal`** - -## Table of contents - -### Properties - -- [migrationMappingPropertyHashes](client._internal_namespace.IndexMappingMeta.md#migrationmappingpropertyhashes) - -## Properties - -### migrationMappingPropertyHashes - -• `Optional` **migrationMappingPropertyHashes**: `Object` - -#### Index signature - -▪ [k: `string`]: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/mappings/types.d.ts:108 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IntervalSchedule.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IntervalSchedule.md deleted file mode 100644 index 365dfd5f7dfdf..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.IntervalSchedule.md +++ /dev/null @@ -1,23 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / IntervalSchedule - -# Interface: IntervalSchedule - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).IntervalSchedule - -## Table of contents - -### Properties - -- [interval](client._internal_namespace.IntervalSchedule.md#interval) - -## Properties - -### interval - -• **interval**: `string` - -An interval in minutes (e.g. '5m'). If specified, this is a recurring task. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:137 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaFeatureConfig.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaFeatureConfig.md deleted file mode 100644 index 2013e42ad5bf2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaFeatureConfig.md +++ /dev/null @@ -1,257 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / KibanaFeatureConfig - -# Interface: KibanaFeatureConfig - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).KibanaFeatureConfig - -Interface for registering a feature. -Feature registration allows plugins to hide their applications with spaces, -and secure access when configured for security. - -## Table of contents - -### Properties - -- [alerting](client._internal_namespace.KibanaFeatureConfig.md#alerting) -- [app](client._internal_namespace.KibanaFeatureConfig.md#app) -- [cases](client._internal_namespace.KibanaFeatureConfig.md#cases) -- [catalogue](client._internal_namespace.KibanaFeatureConfig.md#catalogue) -- [category](client._internal_namespace.KibanaFeatureConfig.md#category) -- [excludeFromBasePrivileges](client._internal_namespace.KibanaFeatureConfig.md#excludefrombaseprivileges) -- [id](client._internal_namespace.KibanaFeatureConfig.md#id) -- [management](client._internal_namespace.KibanaFeatureConfig.md#management) -- [minimumLicense](client._internal_namespace.KibanaFeatureConfig.md#minimumlicense) -- [name](client._internal_namespace.KibanaFeatureConfig.md#name) -- [order](client._internal_namespace.KibanaFeatureConfig.md#order) -- [privileges](client._internal_namespace.KibanaFeatureConfig.md#privileges) -- [privilegesTooltip](client._internal_namespace.KibanaFeatureConfig.md#privilegestooltip) -- [reserved](client._internal_namespace.KibanaFeatureConfig.md#reserved) -- [subFeatures](client._internal_namespace.KibanaFeatureConfig.md#subfeatures) - -## Properties - -### alerting - -• `Optional` **alerting**: readonly `string`[] - -If your feature grants access to specific Alert Types, you can specify them here to control visibility based on the current space. -Include both Alert Types registered by the feature and external Alert Types such as built-in -Alert Types and Alert Types provided by other features to which you wish to grant access. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:83 - -___ - -### app - -• **app**: readonly `string`[] - -An array of app ids that are enabled when this feature is enabled. -Apps specified here will automatically cascade to the privileges defined below, unless specified differently there. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:54 - -___ - -### cases - -• `Optional` **cases**: readonly `string`[] - -If your feature grants access to specific case types, you can specify them here to control visibility based on the current space. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:87 - -___ - -### catalogue - -• `Optional` **catalogue**: readonly `string`[] - -If this feature includes a catalogue entry, you can specify them here to control visibility based on the current space. - -Items specified here will automatically cascade to the privileges defined below, unless specified differently there. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:77 - -___ - -### category - -• **category**: [`AppCategory`](client._internal_namespace.AppCategory.md) - -The category for this feature. -This will be used to organize the list of features for display within the -Spaces and Roles management screens. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:30 - -___ - -### excludeFromBasePrivileges - -• `Optional` **excludeFromBasePrivileges**: `boolean` - -Whether or not this feature should be excluded from the base privileges. -This is primarily helpful when migrating applications with a "legacy" privileges model -to use Kibana privileges. We don't want these features to be considered part of the `all` -or `read` base privileges in a minor release if the user was previously granted access -using an additional reserved role. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:42 - -___ - -### id - -• **id**: `string` - -Unique identifier for this feature. -This identifier is also used when generating UI Capabilities. - -**`see`** UICapabilities - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:19 - -___ - -### management - -• `Optional` **management**: `Object` - -If this feature includes management sections, you can specify them here to control visibility of those -pages based on the current space. - -Items specified here will automatically cascade to the privileges defined below, unless specified differently there. - -**`example`** -```ts - // Enables access to the "Advanced Settings" management page within the Kibana section - management: { - kibana: ['settings'] - } -``` - -#### Index signature - -▪ [sectionId: `string`]: readonly `string`[] - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:69 - -___ - -### minimumLicense - -• `Optional` **minimumLicense**: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -Optional minimum supported license. -If omitted, all licenses are allowed. -This does not restrict access to your feature based on license. -Its only purpose is to inform the space and roles UIs on which features to display. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:49 - -___ - -### name - -• **name**: `string` - -Display name for this feature. -This will be displayed to end-users, so a translatable string is advised for i18n. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:24 - -___ - -### order - -• `Optional` **order**: `number` - -An ordinal used to sort features relative to one another for display. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:34 - -___ - -### privileges - -• **privileges**: ``null`` \| { `all`: [`FeatureKibanaPrivileges`](client._internal_namespace.FeatureKibanaPrivileges.md) ; `read`: [`FeatureKibanaPrivileges`](client._internal_namespace.FeatureKibanaPrivileges.md) } - -Feature privilege definition. - -**`example`** -```ts - { - all: {...}, - read: {...} - } -``` - -**`see`** FeatureKibanaPrivileges - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:100 - -___ - -### privilegesTooltip - -• `Optional` **privilegesTooltip**: `string` - -Optional message to display on the Role Management screen when configuring permissions for this feature. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:111 - -___ - -### reserved - -• `Optional` `Private` **reserved**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `description` | `string` | -| `privileges` | readonly [`ReservedKibanaPrivilege`](client._internal_namespace.ReservedKibanaPrivilege.md)[] | - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:115 - -___ - -### subFeatures - -• `Optional` **subFeatures**: readonly [`SubFeatureConfig`](client._internal_namespace.SubFeatureConfig.md)[] - -Optional sub-feature privilege definitions. This can only be specified if `privileges` are are also defined. - -#### Defined in - -x-pack/plugins/features/target/types/common/kibana_feature.d.ts:107 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaMigratorOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaMigratorOptions.md deleted file mode 100644 index 1b316e68c5771..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaMigratorOptions.md +++ /dev/null @@ -1,76 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / KibanaMigratorOptions - -# Interface: KibanaMigratorOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).KibanaMigratorOptions - -## Table of contents - -### Properties - -- [client](client._internal_namespace.KibanaMigratorOptions.md#client) -- [kibanaIndex](client._internal_namespace.KibanaMigratorOptions.md#kibanaindex) -- [kibanaVersion](client._internal_namespace.KibanaMigratorOptions.md#kibanaversion) -- [logger](client._internal_namespace.KibanaMigratorOptions.md#logger) -- [soMigrationsConfig](client._internal_namespace.KibanaMigratorOptions.md#somigrationsconfig) -- [typeRegistry](client._internal_namespace.KibanaMigratorOptions.md#typeregistry) - -## Properties - -### client - -• **client**: [`ElasticsearchClient`](../modules/client._internal_namespace.md#elasticsearchclient) - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:10 - -___ - -### kibanaIndex - -• **kibanaIndex**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:13 - -___ - -### kibanaVersion - -• **kibanaVersion**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:14 - -___ - -### logger - -• **logger**: `Logger` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:15 - -___ - -### soMigrationsConfig - -• **soMigrationsConfig**: `Readonly`<{} & { `batchSize`: `number` ; `maxBatchSizeBytes`: `ByteSizeValue` ; `pollInterval`: `number` ; `retryAttempts`: `number` ; `scrollDuration`: `string` ; `skip`: `boolean` }\> - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:12 - -___ - -### typeRegistry - -• **typeRegistry**: [`ISavedObjectTypeRegistry`](../modules/client._internal_namespace.md#isavedobjecttyperegistry) - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:11 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaMigratorStatus.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaMigratorStatus.md deleted file mode 100644 index 21bba02200fa4..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaMigratorStatus.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / KibanaMigratorStatus - -# Interface: KibanaMigratorStatus - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).KibanaMigratorStatus - -## Table of contents - -### Properties - -- [result](client._internal_namespace.KibanaMigratorStatus.md#result) -- [status](client._internal_namespace.KibanaMigratorStatus.md#status) -- [waitingIndex](client._internal_namespace.KibanaMigratorStatus.md#waitingindex) - -## Properties - -### result - -• `Optional` **result**: [`MigrationResult`](../modules/client._internal_namespace.md#migrationresult)[] - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:20 - -___ - -### status - -• **status**: [`MigrationStatus`](../modules/client._internal_namespace.md#migrationstatus) - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:19 - -___ - -### waitingIndex - -• `Optional` **waitingIndex**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:21 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaRequestEvents.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaRequestEvents.md deleted file mode 100644 index c4b610af9ba99..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.KibanaRequestEvents.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / KibanaRequestEvents - -# Interface: KibanaRequestEvents - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).KibanaRequestEvents - -Request events. - -## Table of contents - -### Properties - -- [aborted$](client._internal_namespace.KibanaRequestEvents.md#aborted$) -- [completed$](client._internal_namespace.KibanaRequestEvents.md#completed$) - -## Properties - -### aborted$ - -• **aborted$**: `Observable`<`void`\> - -Observable that emits once if and when the request has been aborted. - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:48 - -___ - -### completed$ - -• **completed$**: `Observable`<`void`\> - -Observable that emits once if and when the request has been completely handled. - -**`remarks`** -The request may be considered completed if: -- A response has been sent to the client; or -- The request was aborted. - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:57 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LegacyUrlAliasTarget.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LegacyUrlAliasTarget.md deleted file mode 100644 index 1580adc5c3127..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LegacyUrlAliasTarget.md +++ /dev/null @@ -1,51 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / LegacyUrlAliasTarget - -# Interface: LegacyUrlAliasTarget - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).LegacyUrlAliasTarget - -Client interface for interacting with legacy URL aliases. - -## Table of contents - -### Properties - -- [sourceId](client._internal_namespace.LegacyUrlAliasTarget.md#sourceid) -- [targetSpace](client._internal_namespace.LegacyUrlAliasTarget.md#targetspace) -- [targetType](client._internal_namespace.LegacyUrlAliasTarget.md#targettype) - -## Properties - -### sourceId - -• **sourceId**: `string` - -The original ID of the object, before it was converted. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:99 - -___ - -### targetSpace - -• **targetSpace**: `string` - -The namespace that the object existed in when it was converted. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:91 - -___ - -### targetType - -• **targetType**: `string` - -The type of the object when it was converted. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:95 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicenseCheck.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicenseCheck.md deleted file mode 100644 index 084c5ae23607e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicenseCheck.md +++ /dev/null @@ -1,36 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / LicenseCheck - -# Interface: LicenseCheck - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).LicenseCheck - -## Table of contents - -### Properties - -- [message](client._internal_namespace.LicenseCheck.md#message) -- [state](client._internal_namespace.LicenseCheck.md#state) - -## Properties - -### message - -• `Optional` **message**: `string` - -A message containing the reason for a license type not being valid. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:75 - -___ - -### state - -• **state**: [`LicenseCheckState`](../modules/client._internal_namespace.md#licensecheckstate) - -The state of checking the results of a license type meeting the license minimum. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:71 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicenseFeature.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicenseFeature.md deleted file mode 100644 index e6794cd50d933..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicenseFeature.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / LicenseFeature - -# Interface: LicenseFeature - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).LicenseFeature - -## Table of contents - -### Properties - -- [isAvailable](client._internal_namespace.LicenseFeature.md#isavailable) -- [isEnabled](client._internal_namespace.LicenseFeature.md#isenabled) - -## Properties - -### isAvailable - -• **isAvailable**: `boolean` - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:16 - -___ - -### isEnabled - -• **isEnabled**: `boolean` - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:17 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicensingPluginSetup.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicensingPluginSetup.md deleted file mode 100644 index 240dbd27ad2fc..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.LicensingPluginSetup.md +++ /dev/null @@ -1,60 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / LicensingPluginSetup - -# Interface: LicensingPluginSetup - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).LicensingPluginSetup - -## Table of contents - -### Properties - -- [featureUsage](client._internal_namespace.LicensingPluginSetup.md#featureusage) -- [license$](client._internal_namespace.LicensingPluginSetup.md#license$) - -### Methods - -- [refresh](client._internal_namespace.LicensingPluginSetup.md#refresh) - -## Properties - -### featureUsage - -• **featureUsage**: [`FeatureUsageServiceSetup`](client._internal_namespace.FeatureUsageServiceSetup.md) - -APIs to register licensed feature usage. - -#### Defined in - -x-pack/plugins/licensing/target/types/server/types.d.ts:49 - -___ - -### license$ - -• **license$**: `Observable`<[`ILicense`](client._internal_namespace.ILicense.md)\> - -Steam of licensing information [ILicense](client._internal_namespace.ILicense.md). - -**`deprecated`** in favour of the counterpart provided from start contract - -#### Defined in - -x-pack/plugins/licensing/target/types/server/types.d.ts:40 - -## Methods - -### refresh - -▸ **refresh**(): `Promise`<[`ILicense`](client._internal_namespace.ILicense.md)\> - -Triggers licensing information re-fetch. - -**`deprecated`** in favour of the counterpart provided from start contract - -#### Returns - -`Promise`<[`ILicense`](client._internal_namespace.ILicense.md)\> - -#### Defined in - -x-pack/plugins/licensing/target/types/server/types.d.ts:45 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Middleware.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Middleware.md deleted file mode 100644 index 0a6d5169b4278..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Middleware.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Middleware - -# Interface: Middleware - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Middleware - -## Table of contents - -### Properties - -- [beforeMarkRunning](client._internal_namespace.Middleware.md#beforemarkrunning) -- [beforeRun](client._internal_namespace.Middleware.md#beforerun) -- [beforeSave](client._internal_namespace.Middleware.md#beforesave) - -## Properties - -### beforeMarkRunning - -• **beforeMarkRunning**: [`BeforeRunContextFunction`](../modules/client._internal_namespace.md#beforeruncontextfunction) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/lib/middleware.d.ts:11 - -___ - -### beforeRun - -• **beforeRun**: [`BeforeRunContextFunction`](../modules/client._internal_namespace.md#beforeruncontextfunction) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/lib/middleware.d.ts:10 - -___ - -### beforeSave - -• **beforeSave**: [`BeforeSaveContextFunction`](../modules/client._internal_namespace.md#beforesavecontextfunction) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/lib/middleware.d.ts:9 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.OperationDetails.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.OperationDetails.md deleted file mode 100644 index a7e428f943d05..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.OperationDetails.md +++ /dev/null @@ -1,91 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / OperationDetails - -# Interface: OperationDetails - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).OperationDetails - -Defines the structure for a case API route. - -## Table of contents - -### Properties - -- [action](client._internal_namespace.OperationDetails.md#action) -- [docType](client._internal_namespace.OperationDetails.md#doctype) -- [ecsType](client._internal_namespace.OperationDetails.md#ecstype) -- [name](client._internal_namespace.OperationDetails.md#name) -- [savedObjectType](client._internal_namespace.OperationDetails.md#savedobjecttype) -- [verbs](client._internal_namespace.OperationDetails.md#verbs) - -## Properties - -### action - -• **action**: `string` - -The ECS `event.action` field, should be in the form of _ e.g comment_get, case_fined - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:83](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L83) - -___ - -### docType - -• **docType**: `string` - -The readable name of the entity being operated on e.g. case, comment, configurations (make it plural if it reads better that way etc) - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:91](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L91) - -___ - -### ecsType - -• **ecsType**: `EcsEventType` - -The ECS event type that this operation should be audit logged as (creation, deletion, access, etc) - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:74](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L74) - -___ - -### name - -• **name**: `string` - -The name of the operation to authorize against for the privilege check. -These values need to match one of the operation strings defined here: x-pack/plugins/security/server/authorization/privileges/feature_privilege_builder/cases.ts - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:79](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L79) - -___ - -### savedObjectType - -• **savedObjectType**: `string` - -The actual saved object type of the entity e.g. cases, cases-comments - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:95](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L95) - -___ - -### verbs - -• **verbs**: [`Verbs`](client._internal_namespace.Verbs.md) - -The verbs that are associated with this type of operation, these should line up with the event type e.g. creating, created, create etc - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:87](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L87) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.OwnerEntity.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.OwnerEntity.md deleted file mode 100644 index 771823c8e9711..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.OwnerEntity.md +++ /dev/null @@ -1,35 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / OwnerEntity - -# Interface: OwnerEntity - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).OwnerEntity - -Describes an entity with the necessary fields to identify if the user is authorized to interact with the saved object -returned from some find query. - -## Table of contents - -### Properties - -- [id](client._internal_namespace.OwnerEntity.md#id) -- [owner](client._internal_namespace.OwnerEntity.md#owner) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:104](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L104) - -___ - -### owner - -• **owner**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:103](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L103) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCase.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCase.md deleted file mode 100644 index 39774f46c552f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCase.md +++ /dev/null @@ -1,54 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PatchCase - -# Interface: PatchCase - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PatchCase - -## Table of contents - -### Properties - -- [caseId](client._internal_namespace.PatchCase.md#caseid) -- [originalCase](client._internal_namespace.PatchCase.md#originalcase) -- [updatedAttributes](client._internal_namespace.PatchCase.md#updatedattributes) -- [version](client._internal_namespace.PatchCase.md#version) - -## Properties - -### caseId - -• **caseId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:98](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L98) - -___ - -### originalCase - -• **originalCase**: [`SavedObject`](client._internal_namespace.SavedObject.md)<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:100](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L100) - -___ - -### updatedAttributes - -• **updatedAttributes**: `Partial`<{ `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & [`PushedArgs`](client._internal_namespace.PushedArgs.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:99](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L99) - -___ - -### version - -• `Optional` **version**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:101](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L101) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCaseConfigureArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCaseConfigureArgs.md deleted file mode 100644 index c6909426e1088..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCaseConfigureArgs.md +++ /dev/null @@ -1,64 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PatchCaseConfigureArgs - -# Interface: PatchCaseConfigureArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PatchCaseConfigureArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs.md) - - ↳ **`PatchCaseConfigureArgs`** - -## Table of contents - -### Properties - -- [configurationId](client._internal_namespace.PatchCaseConfigureArgs.md#configurationid) -- [originalConfiguration](client._internal_namespace.PatchCaseConfigureArgs.md#originalconfiguration) -- [unsecuredSavedObjectsClient](client._internal_namespace.PatchCaseConfigureArgs.md#unsecuredsavedobjectsclient) -- [updatedAttributes](client._internal_namespace.PatchCaseConfigureArgs.md#updatedattributes) - -## Properties - -### configurationId - -• **configurationId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:46](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L46) - -___ - -### originalConfiguration - -• **originalConfiguration**: [`SavedObject`](client._internal_namespace.SavedObject.md)<{ `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\> - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:48](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L48) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:30](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L30) - -___ - -### updatedAttributes - -• **updatedAttributes**: `Partial`<{ `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\> - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:47](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L47) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCasesArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCasesArgs.md deleted file mode 100644 index 24db998f64f3d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PatchCasesArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PatchCasesArgs - -# Interface: PatchCasesArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PatchCasesArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`PatchCasesArgs`** - -## Table of contents - -### Properties - -- [cases](client._internal_namespace.PatchCasesArgs.md#cases) -- [unsecuredSavedObjectsClient](client._internal_namespace.PatchCasesArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### cases - -• **cases**: [`PatchCase`](client._internal_namespace.PatchCase.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:106](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L106) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PersistableState.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PersistableState.md deleted file mode 100644 index 7300cc96a8fd2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PersistableState.md +++ /dev/null @@ -1,133 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PersistableState - -# Interface: PersistableState - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PersistableState - -Persistable state interface can be implemented by something that persists -(stores) state, for example, in a saved object. Once implemented that thing -will gain ability to "extract" and "inject" saved object references, which -are necessary for various saved object tasks, such as export. It will also be -able to do state migrations across Kibana versions, if the shape of the state -would change over time. - -**`todo`** Maybe rename it to `PersistableStateItem`? - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `P` | extends `SerializableRecord` = `SerializableRecord` | - -## Table of contents - -### Properties - -- [migrations](client._internal_namespace.PersistableState.md#migrations) - -### Methods - -- [extract](client._internal_namespace.PersistableState.md#extract) -- [inject](client._internal_namespace.PersistableState.md#inject) -- [telemetry](client._internal_namespace.PersistableState.md#telemetry) - -## Properties - -### migrations - -• **migrations**: [`MigrateFunctionsObject`](../modules/client._internal_namespace.md#migratefunctionsobject) \| [`GetMigrationFunctionObjectFn`](../modules/client._internal_namespace.md#getmigrationfunctionobjectfn) - -A list of migration functions, which migrate the persistable state -serializable object to the next version. Migration functions should are -keyed by the Kibana version using semver, where the version indicates to -which version the state will be migrated to. - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:75 - -## Methods - -### extract - -▸ **extract**(`state`): `Object` - -A function which receives state and should return the state with references -extracted and an array of the extracted references. The default case could -simply return the same state with an empty array of references. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `state` | `P` | The persistable state serializable state object. | - -#### Returns - -`Object` - -Persistable state object with references extracted and a list of - references. - -| Name | Type | -| :------ | :------ | -| `references` | [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] | -| `state` | `P` | - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:65 - -___ - -### inject - -▸ **inject**(`state`, `references`): `P` - -A function which receives state and a list of references and should return -back the state with references injected. The default is an identity -function. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `state` | `P` | The persistable state serializable state object. | -| `references` | [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] | List of saved object references. | - -#### Returns - -`P` - -Persistable state object with references injected. - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:55 - -___ - -### telemetry - -▸ **telemetry**(`state`, `stats`): `Record`<`string`, `any`\> - -Function which reports telemetry information. This function is essentially -a "reducer" - it receives the existing "stats" object and returns an -updated version of the "stats" object. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `state` | `P` | The persistable state serializable state object. | -| `stats` | `Record`<`string`, `any`\> | Stats object containing the stats which were already collected. This `stats` object shall not be mutated in-line. | - -#### Returns - -`Record`<`string`, `any`\> - -A new stats object augmented with new telemetry information. - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:45 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PluginStartContract.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PluginStartContract.md deleted file mode 100644 index 3ded8d5c50642..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PluginStartContract.md +++ /dev/null @@ -1,40 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PluginStartContract - -# Interface: PluginStartContract - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PluginStartContract - -## Table of contents - -### Methods - -- [getElasticsearchFeatures](client._internal_namespace.PluginStartContract.md#getelasticsearchfeatures) -- [getKibanaFeatures](client._internal_namespace.PluginStartContract.md#getkibanafeatures) - -## Methods - -### getElasticsearchFeatures - -▸ **getElasticsearchFeatures**(): [`ElasticsearchFeature`](../classes/client._internal_namespace.ElasticsearchFeature.md)[] - -#### Returns - -[`ElasticsearchFeature`](../classes/client._internal_namespace.ElasticsearchFeature.md)[] - -#### Defined in - -x-pack/plugins/features/target/types/server/plugin.d.ts:28 - -___ - -### getKibanaFeatures - -▸ **getKibanaFeatures**(): [`KibanaFeature`](../classes/client._internal_namespace.KibanaFeature.md)[] - -#### Returns - -[`KibanaFeature`](../classes/client._internal_namespace.KibanaFeature.md)[] - -#### Defined in - -x-pack/plugins/features/target/types/server/plugin.d.ts:29 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseArgs.md deleted file mode 100644 index 03690ece438b7..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseArgs.md +++ /dev/null @@ -1,53 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PostCaseArgs - -# Interface: PostCaseArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PostCaseArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`PostCaseArgs`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.PostCaseArgs.md#attributes) -- [id](client._internal_namespace.PostCaseArgs.md#id) -- [unsecuredSavedObjectsClient](client._internal_namespace.PostCaseArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### attributes - -• **attributes**: { `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:93](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L93) - -___ - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:94](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L94) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseConfigureArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseConfigureArgs.md deleted file mode 100644 index b10f3e3ae51ba..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseConfigureArgs.md +++ /dev/null @@ -1,53 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PostCaseConfigureArgs - -# Interface: PostCaseConfigureArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PostCaseConfigureArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs.md) - - ↳ **`PostCaseConfigureArgs`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.PostCaseConfigureArgs.md#attributes) -- [id](client._internal_namespace.PostCaseConfigureArgs.md#id) -- [unsecuredSavedObjectsClient](client._internal_namespace.PostCaseConfigureArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### attributes - -• **attributes**: { `closure_type`: ``"close-by-user"`` \| ``"close-by-pushing"`` = ClosureTypeRT; `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt } & { `owner`: `string` = rt.string } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:41](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L41) - -___ - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:42](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L42) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/configure/index.ts:30](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/configure/index.ts#L30) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseUserActionArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseUserActionArgs.md deleted file mode 100644 index 5b890d18106ea..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostCaseUserActionArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PostCaseUserActionArgs - -# Interface: PostCaseUserActionArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PostCaseUserActionArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-1.md) - - ↳ **`PostCaseUserActionArgs`** - -## Table of contents - -### Properties - -- [actions](client._internal_namespace.PostCaseUserActionArgs.md#actions) -- [unsecuredSavedObjectsClient](client._internal_namespace.PostCaseUserActionArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### actions - -• **actions**: [`BuilderReturnValue`](client._internal_namespace.BuilderReturnValue.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:67](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L67) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-1.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-1.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/index.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/index.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostConnectorMappingsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostConnectorMappingsArgs.md deleted file mode 100644 index d4cc3e71a0ba8..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PostConnectorMappingsArgs.md +++ /dev/null @@ -1,60 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PostConnectorMappingsArgs - -# Interface: PostConnectorMappingsArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PostConnectorMappingsArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-2.md) - - ↳ **`PostConnectorMappingsArgs`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.PostConnectorMappingsArgs.md#attributes) -- [references](client._internal_namespace.PostConnectorMappingsArgs.md#references) -- [unsecuredSavedObjectsClient](client._internal_namespace.PostConnectorMappingsArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### attributes - -• **attributes**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `mappings` | { action\_type: "append" \| "nothing" \| "overwrite"; source: "description" \| "title" \| "comments"; target: string; }[] | -| `owner` | `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:22](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L22) - -___ - -### references - -• **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:23](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L23) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-2.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-2.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:15](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L15) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PreConfiguredAction.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PreConfiguredAction.md deleted file mode 100644 index d5bd141afd372..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PreConfiguredAction.md +++ /dev/null @@ -1,124 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PreConfiguredAction - -# Interface: PreConfiguredAction - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PreConfiguredAction - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Config` | extends [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) = [`ActionTypeConfig`](../modules/client._internal_namespace.md#actiontypeconfig) | -| `Secrets` | extends [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets) = [`ActionTypeSecrets`](../modules/client._internal_namespace.md#actiontypesecrets) | - -## Hierarchy - -- [`ActionResult`](client._internal_namespace.ActionResult.md)<`Config`\> - - ↳ **`PreConfiguredAction`** - -## Table of contents - -### Properties - -- [actionTypeId](client._internal_namespace.PreConfiguredAction.md#actiontypeid) -- [config](client._internal_namespace.PreConfiguredAction.md#config) -- [id](client._internal_namespace.PreConfiguredAction.md#id) -- [isMissingSecrets](client._internal_namespace.PreConfiguredAction.md#ismissingsecrets) -- [isPreconfigured](client._internal_namespace.PreConfiguredAction.md#ispreconfigured) -- [name](client._internal_namespace.PreConfiguredAction.md#name) -- [secrets](client._internal_namespace.PreConfiguredAction.md#secrets) - -## Properties - -### actionTypeId - -• **actionTypeId**: `string` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[actionTypeId](client._internal_namespace.ActionResult.md#actiontypeid) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:50 - -___ - -### config - -• `Optional` **config**: `Config` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[config](client._internal_namespace.ActionResult.md#config) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:53 - -___ - -### id - -• **id**: `string` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[id](client._internal_namespace.ActionResult.md#id) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:49 - -___ - -### isMissingSecrets - -• `Optional` **isMissingSecrets**: `boolean` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[isMissingSecrets](client._internal_namespace.ActionResult.md#ismissingsecrets) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:52 - -___ - -### isPreconfigured - -• **isPreconfigured**: `boolean` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[isPreconfigured](client._internal_namespace.ActionResult.md#ispreconfigured) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:54 - -___ - -### name - -• **name**: `string` - -#### Inherited from - -[ActionResult](client._internal_namespace.ActionResult.md).[name](client._internal_namespace.ActionResult.md#name) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:51 - -___ - -### secrets - -• **secrets**: `Secrets` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:57 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ProxySettings.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ProxySettings.md deleted file mode 100644 index e1816a9f513cd..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ProxySettings.md +++ /dev/null @@ -1,65 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ProxySettings - -# Interface: ProxySettings - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ProxySettings - -## Table of contents - -### Properties - -- [proxyBypassHosts](client._internal_namespace.ProxySettings.md#proxybypasshosts) -- [proxyHeaders](client._internal_namespace.ProxySettings.md#proxyheaders) -- [proxyOnlyHosts](client._internal_namespace.ProxySettings.md#proxyonlyhosts) -- [proxySSLSettings](client._internal_namespace.ProxySettings.md#proxysslsettings) -- [proxyUrl](client._internal_namespace.ProxySettings.md#proxyurl) - -## Properties - -### proxyBypassHosts - -• **proxyBypassHosts**: `undefined` \| `Set`<`string`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:110 - -___ - -### proxyHeaders - -• `Optional` **proxyHeaders**: `Record`<`string`, `string`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:112 - -___ - -### proxyOnlyHosts - -• **proxyOnlyHosts**: `undefined` \| `Set`<`string`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:111 - -___ - -### proxySSLSettings - -• **proxySSLSettings**: [`SSLSettings`](client._internal_namespace.SSLSettings.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:113 - -___ - -### proxyUrl - -• **proxyUrl**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:109 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PublicLicense.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PublicLicense.md deleted file mode 100644 index 63c54f6be23cd..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PublicLicense.md +++ /dev/null @@ -1,80 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PublicLicense - -# Interface: PublicLicense - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PublicLicense - -Subset of license data considered as non-sensitive information. -Can be passed to the client. - -## Table of contents - -### Properties - -- [expiryDateInMillis](client._internal_namespace.PublicLicense.md#expirydateinmillis) -- [mode](client._internal_namespace.PublicLicense.md#mode) -- [status](client._internal_namespace.PublicLicense.md#status) -- [type](client._internal_namespace.PublicLicense.md#type) -- [uid](client._internal_namespace.PublicLicense.md#uid) - -## Properties - -### expiryDateInMillis - -• **expiryDateInMillis**: `number` - -Unix epoch of the expiration date of the license. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:36 - -___ - -### mode - -• **mode**: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -The license type, being usually one of basic, standard, gold, platinum, or trial. - -**`deprecated`** use 'type' instead - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:45 - -___ - -### status - -• **status**: [`LicenseStatus`](../modules/client._internal_namespace.md#licensestatus) - -The validity status of the license. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:32 - -___ - -### type - -• **type**: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -The license type, being usually one of basic, standard, gold, platinum, or trial. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:40 - -___ - -### uid - -• **uid**: `string` - -UID for license. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:28 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PublicLicenseJSON.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PublicLicenseJSON.md deleted file mode 100644 index 895a3654baaf2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PublicLicenseJSON.md +++ /dev/null @@ -1,46 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PublicLicenseJSON - -# Interface: PublicLicenseJSON - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PublicLicenseJSON - -Subset of license & features data considered as non-sensitive information. -Structured as json to be passed to the client. - -## Table of contents - -### Properties - -- [features](client._internal_namespace.PublicLicenseJSON.md#features) -- [license](client._internal_namespace.PublicLicenseJSON.md#license) -- [signature](client._internal_namespace.PublicLicenseJSON.md#signature) - -## Properties - -### features - -• `Optional` **features**: [`PublicFeatures`](../modules/client._internal_namespace.md#publicfeatures) - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:59 - -___ - -### license - -• `Optional` **license**: [`PublicLicense`](client._internal_namespace.PublicLicense.md) - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:58 - -___ - -### signature - -• **signature**: `string` - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:60 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PushedArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PushedArgs.md deleted file mode 100644 index 0637bcb1cb21f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.PushedArgs.md +++ /dev/null @@ -1,40 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / PushedArgs - -# Interface: PushedArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).PushedArgs - -## Table of contents - -### Properties - -- [pushed\_at](client._internal_namespace.PushedArgs.md#pushed_at) -- [pushed\_by](client._internal_namespace.PushedArgs.md#pushed_by) - -## Properties - -### pushed\_at - -• **pushed\_at**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:64](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L64) - -___ - -### pushed\_by - -• **pushed\_by**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:65](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L65) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Referencable.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Referencable.md deleted file mode 100644 index b8914a27eb524..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Referencable.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Referencable - -# Interface: Referencable - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Referencable - -## Table of contents - -### Properties - -- [references](client._internal_namespace.Referencable.md#references) - -## Properties - -### references - -• **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:40 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ReservedKibanaPrivilege.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ReservedKibanaPrivilege.md deleted file mode 100644 index cfd5cc23baa8c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ReservedKibanaPrivilege.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ReservedKibanaPrivilege - -# Interface: ReservedKibanaPrivilege - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ReservedKibanaPrivilege - -## Table of contents - -### Properties - -- [id](client._internal_namespace.ReservedKibanaPrivilege.md#id) -- [privilege](client._internal_namespace.ReservedKibanaPrivilege.md#privilege) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -x-pack/plugins/features/target/types/common/reserved_kibana_privilege.d.ts:3 - -___ - -### privilege - -• **privilege**: [`FeatureKibanaPrivileges`](client._internal_namespace.FeatureKibanaPrivileges.md) - -#### Defined in - -x-pack/plugins/features/target/types/common/reserved_kibana_privilege.d.ts:4 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ResponseSettings.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ResponseSettings.md deleted file mode 100644 index b5c3a7374e03d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ResponseSettings.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ResponseSettings - -# Interface: ResponseSettings - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ResponseSettings - -## Table of contents - -### Properties - -- [maxContentLength](client._internal_namespace.ResponseSettings.md#maxcontentlength) -- [timeout](client._internal_namespace.ResponseSettings.md#timeout) - -## Properties - -### maxContentLength - -• **maxContentLength**: `number` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:116 - -___ - -### timeout - -• **timeout**: `number` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:117 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteConfigOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteConfigOptions.md deleted file mode 100644 index 447612f4b9ece..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteConfigOptions.md +++ /dev/null @@ -1,100 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RouteConfigOptions - -# Interface: RouteConfigOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RouteConfigOptions - -Additional route options. - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Method` | extends [`RouteMethod`](../modules/client._internal_namespace.md#routemethod) | - -## Table of contents - -### Properties - -- [authRequired](client._internal_namespace.RouteConfigOptions.md#authrequired) -- [body](client._internal_namespace.RouteConfigOptions.md#body) -- [tags](client._internal_namespace.RouteConfigOptions.md#tags) -- [timeout](client._internal_namespace.RouteConfigOptions.md#timeout) -- [xsrfRequired](client._internal_namespace.RouteConfigOptions.md#xsrfrequired) - -## Properties - -### authRequired - -• `Optional` **authRequired**: `boolean` \| ``"optional"`` - -Defines authentication mode for a route: -- true. A user has to have valid credentials to access a resource -- false. A user can access a resource without any credentials. -- 'optional'. A user can access a resource, and will be authenticated if provided credentials are valid. - Can be useful when we grant access to a resource but want to identify a user if possible. - -Defaults to `true` if an auth mechanism is registered. - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:89 - -___ - -### body - -• `Optional` **body**: `Method` extends ``"options"`` \| ``"get"`` ? `undefined` : [`RouteConfigOptionsBody`](client._internal_namespace.RouteConfigOptionsBody.md) - -Additional body options [RouteConfigOptionsBody](client._internal_namespace.RouteConfigOptionsBody.md). - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:105 - -___ - -### tags - -• `Optional` **tags**: readonly `string`[] - -Additional metadata tag strings to attach to the route. - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:101 - -___ - -### timeout - -• `Optional` **timeout**: `Object` - -Defines per-route timeouts. - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `idleSocket?` | `number` | Milliseconds the socket can be idle before it's closed | -| `payload?` | `Method` extends ``"options"`` \| ``"get"`` ? `undefined` : `number` | Milliseconds to receive the payload | - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:109 - -___ - -### xsrfRequired - -• `Optional` **xsrfRequired**: `Method` extends ``"get"`` ? `never` : `boolean` - -Defines xsrf protection requirements for a route: -- true. Requires an incoming POST/PUT/DELETE request to contain `kbn-xsrf` header. -- false. Disables xsrf protection. - -Set to true by default - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:97 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteConfigOptionsBody.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteConfigOptionsBody.md deleted file mode 100644 index c392c1845b22a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteConfigOptionsBody.md +++ /dev/null @@ -1,89 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RouteConfigOptionsBody - -# Interface: RouteConfigOptionsBody - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RouteConfigOptionsBody - -Additional body options for a route - -## Table of contents - -### Properties - -- [accepts](client._internal_namespace.RouteConfigOptionsBody.md#accepts) -- [maxBytes](client._internal_namespace.RouteConfigOptionsBody.md#maxbytes) -- [output](client._internal_namespace.RouteConfigOptionsBody.md#output) -- [parse](client._internal_namespace.RouteConfigOptionsBody.md#parse) - -## Properties - -### accepts - -• `Optional` **accepts**: `string` \| `string`[] \| [`RouteContentType`](../modules/client._internal_namespace.md#routecontenttype)[] - -A string or an array of strings with the allowed mime types for the endpoint. Use this settings to limit the set of allowed mime types. Note that allowing additional mime types not listed -above will not enable them to be parsed, and if parse is true, the request will result in an error response. - -Default value: allows parsing of the following mime types: -* application/json -* application/*+json -* application/octet-stream -* application/x-www-form-urlencoded -* multipart/form-data -* text/* - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:45 - -___ - -### maxBytes - -• `Optional` **maxBytes**: `number` - -Limits the size of incoming payloads to the specified byte count. Allowing very large payloads may cause the server to run out of memory. - -Default value: The one set in the kibana.yml config file under the parameter `server.maxPayload`. - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:51 - -___ - -### output - -• `Optional` **output**: ``"data"`` \| ``"stream"`` - -The processed payload format. The value must be one of: -* 'data' - the incoming payload is read fully into memory. If parse is true, the payload is parsed (JSON, form-decoded, multipart) based on the 'Content-Type' header. If parse is false, a raw -Buffer is returned. -* 'stream' - the incoming payload is made available via a Stream.Readable interface. If the payload is 'multipart/form-data' and parse is true, field values are presented as text while files -are provided as streams. File streams from a 'multipart/form-data' upload will also have a hapi property containing the filename and headers properties. Note that payload streams for multipart -payloads are a synthetic interface created on top of the entire multipart content loaded into memory. To avoid loading large multipart payloads into memory, set parse to false and handle the -multipart payload in the handler using a streaming parser (e.g. pez). - -Default value: 'data', unless no validation.body is provided in the route definition. In that case the default is 'stream' to alleviate memory pressure. - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:63 - -___ - -### parse - -• `Optional` **parse**: `boolean` \| ``"gunzip"`` - -Determines if the incoming payload is processed or presented raw. Available values: -* true - if the request 'Content-Type' matches the allowed mime types set by allow (for the whole payload as well as parts), the payload is converted into an object when possible. If the -format is unknown, a Bad Request (400) error response is sent. Any known content encoding is decoded. -* false - the raw payload is returned unmodified. -* 'gunzip' - the raw payload is returned unmodified after any known content encoding is decoded. - -Default value: true, unless no validation.body is provided in the route definition. In that case the default is false to alleviate memory pressure. - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:73 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidationResultFactory.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidationResultFactory.md deleted file mode 100644 index 4e45bca74bdee..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidationResultFactory.md +++ /dev/null @@ -1,71 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RouteValidationResultFactory - -# Interface: RouteValidationResultFactory - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RouteValidationResultFactory - -Validation result factory to be used in the custom validation function to return the valid data or validation errors - -See [RouteValidationFunction](../modules/client._internal_namespace.md#routevalidationfunction). - -## Table of contents - -### Methods - -- [badRequest](client._internal_namespace.RouteValidationResultFactory.md#badrequest) -- [ok](client._internal_namespace.RouteValidationResultFactory.md#ok) - -## Methods - -### badRequest - -▸ **badRequest**(`error`, `path?`): `Object` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `string` \| `Error` | -| `path?` | `string`[] | - -#### Returns - -`Object` - -| Name | Type | -| :------ | :------ | -| `error` | [`RouteValidationError`](../classes/client._internal_namespace.RouteValidationError.md) | - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:14 - -___ - -### ok - -▸ **ok**<`T`\>(`value`): `Object` - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `value` | `T` | - -#### Returns - -`Object` - -| Name | Type | -| :------ | :------ | -| `value` | `T` | - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:11 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidatorConfig.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidatorConfig.md deleted file mode 100644 index dcea2693b8a07..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidatorConfig.md +++ /dev/null @@ -1,60 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RouteValidatorConfig - -# Interface: RouteValidatorConfig - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RouteValidatorConfig - -The configuration object to the RouteValidator class. -Set `params`, `query` and/or `body` to specify the validation logic to follow for that property. - -## Type parameters - -| Name | -| :------ | -| `P` | -| `Q` | -| `B` | - -## Table of contents - -### Properties - -- [body](client._internal_namespace.RouteValidatorConfig.md#body) -- [params](client._internal_namespace.RouteValidatorConfig.md#params) -- [query](client._internal_namespace.RouteValidatorConfig.md#query) - -## Properties - -### body - -• `Optional` **body**: [`RouteValidationSpec`](../modules/client._internal_namespace.md#routevalidationspec)<`B`\> - -Validation logic for the body payload - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:79 - -___ - -### params - -• `Optional` **params**: [`RouteValidationSpec`](../modules/client._internal_namespace.md#routevalidationspec)<`P`\> - -Validation logic for the URL params - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:69 - -___ - -### query - -• `Optional` **query**: [`RouteValidationSpec`](../modules/client._internal_namespace.md#routevalidationspec)<`Q`\> - -Validation logic for the Query params - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:74 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidatorOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidatorOptions.md deleted file mode 100644 index 2652ad7475e82..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RouteValidatorOptions.md +++ /dev/null @@ -1,33 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RouteValidatorOptions - -# Interface: RouteValidatorOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RouteValidatorOptions - -Additional options for the RouteValidator class to modify its default behaviour. - -## Table of contents - -### Properties - -- [unsafe](client._internal_namespace.RouteValidatorOptions.md#unsafe) - -## Properties - -### unsafe - -• `Optional` **unsafe**: `Object` - -Set the `unsafe` config to avoid running some additional internal *safe* validations on top of your custom validation - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `body?` | `boolean` | -| `params?` | `boolean` | -| `query?` | `boolean` | - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:91 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RunContext.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RunContext.md deleted file mode 100644 index 01eec0d08684b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RunContext.md +++ /dev/null @@ -1,25 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RunContext - -# Interface: RunContext - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RunContext - -The run context is passed into a task's run function as its sole argument. - -## Table of contents - -### Properties - -- [taskInstance](client._internal_namespace.RunContext.md#taskinstance) - -## Properties - -### taskInstance - -• **taskInstance**: [`ConcreteTaskInstance`](client._internal_namespace.ConcreteTaskInstance.md) - -The document describing the task instance, its params, state, id, etc. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:23 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RunNowResult.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RunNowResult.md deleted file mode 100644 index d5a584a4b99c5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.RunNowResult.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / RunNowResult - -# Interface: RunNowResult - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).RunNowResult - -## Table of contents - -### Properties - -- [id](client._internal_namespace.RunNowResult.md#id) -- [state](client._internal_namespace.RunNowResult.md#state) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_scheduling.d.ts:18 - -___ - -### state - -• `Optional` **state**: `Record`<`string`, `any`\> - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_scheduling.d.ts:19 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SSLSettings.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SSLSettings.md deleted file mode 100644 index ce1f83e937876..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SSLSettings.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SSLSettings - -# Interface: SSLSettings - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SSLSettings - -## Table of contents - -### Properties - -- [verificationMode](client._internal_namespace.SSLSettings.md#verificationmode) - -## Properties - -### verificationMode - -• `Optional` **verificationMode**: ``"none"`` \| ``"certificate"`` \| ``"full"`` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:120 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObject.md deleted file mode 100644 index 7a2ab41e7cf9c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObject.md +++ /dev/null @@ -1,167 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObject - -# Interface: SavedObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObject - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Hierarchy - -- **`SavedObject`** - - ↳ [`SavedObjectsFindResult`](client._internal_namespace.SavedObjectsFindResult.md) - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.SavedObject.md#attributes) -- [coreMigrationVersion](client._internal_namespace.SavedObject.md#coremigrationversion) -- [error](client._internal_namespace.SavedObject.md#error) -- [id](client._internal_namespace.SavedObject.md#id) -- [migrationVersion](client._internal_namespace.SavedObject.md#migrationversion) -- [namespaces](client._internal_namespace.SavedObject.md#namespaces) -- [originId](client._internal_namespace.SavedObject.md#originid) -- [references](client._internal_namespace.SavedObject.md#references) -- [type](client._internal_namespace.SavedObject.md#type) -- [updated\_at](client._internal_namespace.SavedObject.md#updated_at) -- [version](client._internal_namespace.SavedObject.md#version) - -## Properties - -### attributes - -• **attributes**: `T` - -{@inheritdoc SavedObjectAttributes} - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:61 - -___ - -### coreMigrationVersion - -• `Optional` **coreMigrationVersion**: `string` - -A semver value that is used when upgrading objects between Kibana versions. - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:67 - -___ - -### error - -• `Optional` **error**: [`SavedObjectError`](client._internal_namespace.SavedObjectError.md) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:59 - -___ - -### id - -• **id**: `string` - -The ID of this Saved Object, guaranteed to be unique for all objects of the same `type` - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:52 - -___ - -### migrationVersion - -• `Optional` **migrationVersion**: [`SavedObjectsMigrationVersion`](client._internal_namespace.SavedObjectsMigrationVersion.md) - -{@inheritdoc SavedObjectsMigrationVersion} - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:65 - -___ - -### namespaces - -• `Optional` **namespaces**: `string`[] - -Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with -`namespaceType: 'agnostic'`. - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:72 - -___ - -### originId - -• `Optional` **originId**: `string` - -The ID of the saved object this originated from. This is set if this object's `id` was regenerated; that can happen during migration -from a legacy single-namespace type, or during import. It is only set during migration or create operations. This is used during import -to ensure that ID regeneration is deterministic, so saved objects will be overwritten if they are imported multiple times into a given -space. - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:79 - -___ - -### references - -• **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -{@inheritdoc SavedObjectReference} - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:63 - -___ - -### type - -• **type**: `string` - -The type of Saved Object. Each plugin can define it's own custom Saved Object types. - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:54 - -___ - -### updated\_at - -• `Optional` **updated\_at**: `string` - -Timestamp of the last time this document had been updated. - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:58 - -___ - -### version - -• `Optional` **version**: `string` - -An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:56 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectAttributes.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectAttributes.md deleted file mode 100644 index 2f260171ce47a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectAttributes.md +++ /dev/null @@ -1,20 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectAttributes - -# Interface: SavedObjectAttributes - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectAttributes - -The data for a Saved Object is stored as an object in the `attributes` -property. - -## Hierarchy - -- **`SavedObjectAttributes`** - - ↳ [`ActionUpdate`](client._internal_namespace.ActionUpdate.md) - - ↳ [`ConnectorToken`](client._internal_namespace.ConnectorToken.md) - -## Indexable - -▪ [key: `string`]: [`SavedObjectAttribute`](../modules/client._internal_namespace.md#savedobjectattribute) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectDoc.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectDoc.md deleted file mode 100644 index 50478fb7b3cf2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectDoc.md +++ /dev/null @@ -1,128 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectDoc - -# Interface: SavedObjectDoc - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectDoc - -Saved Object base document - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.SavedObjectDoc.md#attributes) -- [coreMigrationVersion](client._internal_namespace.SavedObjectDoc.md#coremigrationversion) -- [id](client._internal_namespace.SavedObjectDoc.md#id) -- [migrationVersion](client._internal_namespace.SavedObjectDoc.md#migrationversion) -- [namespace](client._internal_namespace.SavedObjectDoc.md#namespace) -- [namespaces](client._internal_namespace.SavedObjectDoc.md#namespaces) -- [originId](client._internal_namespace.SavedObjectDoc.md#originid) -- [type](client._internal_namespace.SavedObjectDoc.md#type) -- [updated\_at](client._internal_namespace.SavedObjectDoc.md#updated_at) -- [version](client._internal_namespace.SavedObjectDoc.md#version) - -## Properties - -### attributes - -• **attributes**: `T` - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:28 - -___ - -### coreMigrationVersion - -• `Optional` **coreMigrationVersion**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:34 - -___ - -### id - -• **id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:29 - -___ - -### migrationVersion - -• `Optional` **migrationVersion**: [`SavedObjectsMigrationVersion`](client._internal_namespace.SavedObjectsMigrationVersion.md) - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:33 - -___ - -### namespace - -• `Optional` **namespace**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:31 - -___ - -### namespaces - -• `Optional` **namespaces**: `string`[] - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:32 - -___ - -### originId - -• `Optional` **originId**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:37 - -___ - -### type - -• **type**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:30 - -___ - -### updated\_at - -• `Optional` **updated\_at**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:36 - -___ - -### version - -• `Optional` **version**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:35 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectError.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectError.md deleted file mode 100644 index 8b93bb038d5fa..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectError.md +++ /dev/null @@ -1,54 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectError - -# Interface: SavedObjectError - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectError - -## Table of contents - -### Properties - -- [error](client._internal_namespace.SavedObjectError.md#error) -- [message](client._internal_namespace.SavedObjectError.md#message) -- [metadata](client._internal_namespace.SavedObjectError.md#metadata) -- [statusCode](client._internal_namespace.SavedObjectError.md#statuscode) - -## Properties - -### error - -• **error**: `string` - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:82 - -___ - -### message - -• **message**: `string` - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:83 - -___ - -### metadata - -• `Optional` **metadata**: `Record`<`string`, `unknown`\> - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:85 - -___ - -### statusCode - -• **statusCode**: `number` - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:84 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectMigrationContext.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectMigrationContext.md deleted file mode 100644 index b16816fc5ec40..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectMigrationContext.md +++ /dev/null @@ -1,64 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectMigrationContext - -# Interface: SavedObjectMigrationContext - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectMigrationContext - -Migration context provided when invoking a [migration handler](../modules/client._internal_namespace.md#savedobjectmigrationfn) - -## Table of contents - -### Properties - -- [convertToMultiNamespaceTypeVersion](client._internal_namespace.SavedObjectMigrationContext.md#converttomultinamespacetypeversion) -- [isSingleNamespaceType](client._internal_namespace.SavedObjectMigrationContext.md#issinglenamespacetype) -- [log](client._internal_namespace.SavedObjectMigrationContext.md#log) -- [migrationVersion](client._internal_namespace.SavedObjectMigrationContext.md#migrationversion) - -## Properties - -### convertToMultiNamespaceTypeVersion - -• `Optional` `Readonly` **convertToMultiNamespaceTypeVersion**: `string` - -The version in which this object type is being converted to a multi-namespace type - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/types.d.ts:57 - -___ - -### isSingleNamespaceType - -• `Readonly` **isSingleNamespaceType**: `boolean` - -Whether this is a single-namespace type or not - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/types.d.ts:61 - -___ - -### log - -• `Readonly` **log**: [`SavedObjectsMigrationLogger`](client._internal_namespace.SavedObjectsMigrationLogger.md) - -logger instance to be used by the migration handler - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/types.d.ts:49 - -___ - -### migrationVersion - -• `Readonly` **migrationVersion**: `string` - -The migration version that this migration function is defined for - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/types.d.ts:53 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectMigrationMap.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectMigrationMap.md deleted file mode 100644 index 2632e6259ff5b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectMigrationMap.md +++ /dev/null @@ -1,23 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectMigrationMap - -# Interface: SavedObjectMigrationMap - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectMigrationMap - -A map of [migration functions](../modules/client._internal_namespace.md#savedobjectmigrationfn) to be used for a given type. -The map's keys must be valid semver versions, and they cannot exceed the current Kibana version. - -For a given document, only migrations with a higher version number than that of the document will be applied. -Migrations are executed in order, starting from the lowest version and ending with the highest one. - -**`example`** -```typescript -const migrationsMap: SavedObjectMigrationMap = { - '1.0.0': migrateToV1, - '2.1.0': migrateToV21 -} -``` - -## Indexable - -▪ [version: `string`]: [`SavedObjectMigrationFn`](../modules/client._internal_namespace.md#savedobjectmigrationfn)<`any`, `any`\> diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectReference.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectReference.md deleted file mode 100644 index 2c3f8ac1c7cc0..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectReference.md +++ /dev/null @@ -1,45 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectReference - -# Interface: SavedObjectReference - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectReference - -A reference to another saved object. - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectReference.md#id) -- [name](client._internal_namespace.SavedObjectReference.md#name) -- [type](client._internal_namespace.SavedObjectReference.md#type) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:30 - -___ - -### name - -• **name**: `string` - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:28 - -___ - -### type - -• **type**: `string` - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:29 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectReferenceWithContext.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectReferenceWithContext.md deleted file mode 100644 index 511e6aec3d9b6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectReferenceWithContext.md +++ /dev/null @@ -1,91 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectReferenceWithContext - -# Interface: SavedObjectReferenceWithContext - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectReferenceWithContext - -A returned input object or one of its references, with additional context. - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectReferenceWithContext.md#id) -- [inboundReferences](client._internal_namespace.SavedObjectReferenceWithContext.md#inboundreferences) -- [isMissing](client._internal_namespace.SavedObjectReferenceWithContext.md#ismissing) -- [spaces](client._internal_namespace.SavedObjectReferenceWithContext.md#spaces) -- [spacesWithMatchingAliases](client._internal_namespace.SavedObjectReferenceWithContext.md#spaceswithmatchingaliases) -- [type](client._internal_namespace.SavedObjectReferenceWithContext.md#type) - -## Properties - -### id - -• **id**: `string` - -The ID of the referenced object - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:45 - -___ - -### inboundReferences - -• **inboundReferences**: { `id`: `string` ; `name`: `string` ; `type`: `string` }[] - -References to this object; note that this does not contain _all inbound references everywhere for this object_, it only contains -inbound references for the scope of this operation - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:52 - -___ - -### isMissing - -• `Optional` **isMissing**: `boolean` - -Whether or not this object or reference is missing - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:61 - -___ - -### spaces - -• **spaces**: `string`[] - -The space(s) that the referenced object exists in - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:47 - -___ - -### spacesWithMatchingAliases - -• `Optional` **spacesWithMatchingAliases**: `string`[] - -The space(s) that legacy URL aliases matching this type/id exist in - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:63 - -___ - -### type - -• **type**: `string` - -The type of the referenced object - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:43 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBaseOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBaseOptions.md deleted file mode 100644 index afce23c52c88d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBaseOptions.md +++ /dev/null @@ -1,47 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBaseOptions - -# Interface: SavedObjectsBaseOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBaseOptions - -## Hierarchy - -- **`SavedObjectsBaseOptions`** - - ↳ [`SavedObjectsRemoveReferencesToResponse`](client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md) - - ↳ [`SavedObjectsCreateOptions`](client._internal_namespace.SavedObjectsCreateOptions.md) - - ↳ [`SavedObjectsDeleteOptions`](client._internal_namespace.SavedObjectsDeleteOptions.md) - - ↳ [`SavedObjectsUpdateOptions`](client._internal_namespace.SavedObjectsUpdateOptions.md) - - ↳ [`SavedObjectsBulkUpdateOptions`](client._internal_namespace.SavedObjectsBulkUpdateOptions.md) - - ↳ [`SavedObjectsRemoveReferencesToOptions`](client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md) - - ↳ [`SavedObjectsCollectMultiNamespaceReferencesOptions`](client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md) - - ↳ [`SavedObjectsUpdateObjectsSpacesOptions`](client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md) - - ↳ [`SavedObjectsDeleteByNamespaceOptions`](client._internal_namespace.SavedObjectsDeleteByNamespaceOptions.md) - - ↳ [`SavedObjectsIncrementCounterOptions`](client._internal_namespace.SavedObjectsIncrementCounterOptions.md) - -## Table of contents - -### Properties - -- [namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -## Properties - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkCreateObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkCreateObject.md deleted file mode 100644 index 1a5bbd79801ba..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkCreateObject.md +++ /dev/null @@ -1,136 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBulkCreateObject - -# Interface: SavedObjectsBulkCreateObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBulkCreateObject - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.SavedObjectsBulkCreateObject.md#attributes) -- [coreMigrationVersion](client._internal_namespace.SavedObjectsBulkCreateObject.md#coremigrationversion) -- [id](client._internal_namespace.SavedObjectsBulkCreateObject.md#id) -- [initialNamespaces](client._internal_namespace.SavedObjectsBulkCreateObject.md#initialnamespaces) -- [migrationVersion](client._internal_namespace.SavedObjectsBulkCreateObject.md#migrationversion) -- [originId](client._internal_namespace.SavedObjectsBulkCreateObject.md#originid) -- [references](client._internal_namespace.SavedObjectsBulkCreateObject.md#references) -- [type](client._internal_namespace.SavedObjectsBulkCreateObject.md#type) -- [version](client._internal_namespace.SavedObjectsBulkCreateObject.md#version) - -## Properties - -### attributes - -• **attributes**: `T` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:54 - -___ - -### coreMigrationVersion - -• `Optional` **coreMigrationVersion**: `string` - -A semver value that is used when upgrading objects between Kibana versions. If undefined, this will be automatically set to the current -Kibana version when the object is created. If this is set to a non-semver value, or it is set to a semver value greater than the -current Kibana version, it will result in an error. - -**`remarks`** -Do not attempt to set this manually. It should only be used if you retrieved an existing object that had the `coreMigrationVersion` -field set and you want to create it again. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:68 - -___ - -### id - -• `Optional` **id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:52 - -___ - -### initialNamespaces - -• `Optional` **initialNamespaces**: `string`[] - -Optional initial namespaces for the object to be created in. If this is defined, it will supersede the namespace ID that is in -[SavedObjectsCreateOptions](client._internal_namespace.SavedObjectsCreateOptions.md). - -* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, - including the "All spaces" identifier (`'*'`). -* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only - be used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed. -* For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:81 - -___ - -### migrationVersion - -• `Optional` **migrationVersion**: [`SavedObjectsMigrationVersion`](client._internal_namespace.SavedObjectsMigrationVersion.md) - -{@inheritDoc SavedObjectsMigrationVersion} - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:58 - -___ - -### originId - -• `Optional` **originId**: `string` - -Optional ID of the original saved object, if this object's `id` was regenerated - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:70 - -___ - -### references - -• `Optional` **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:56 - -___ - -### type - -• **type**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:53 - -___ - -### version - -• `Optional` **version**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:55 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkGetObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkGetObject.md deleted file mode 100644 index 3b3dd0ecbc28b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkGetObject.md +++ /dev/null @@ -1,65 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBulkGetObject - -# Interface: SavedObjectsBulkGetObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBulkGetObject - -## Table of contents - -### Properties - -- [fields](client._internal_namespace.SavedObjectsBulkGetObject.md#fields) -- [id](client._internal_namespace.SavedObjectsBulkGetObject.md#id) -- [namespaces](client._internal_namespace.SavedObjectsBulkGetObject.md#namespaces) -- [type](client._internal_namespace.SavedObjectsBulkGetObject.md#type) - -## Properties - -### fields - -• `Optional` **fields**: `string`[] - -SavedObject fields to include in the response - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:239 - -___ - -### id - -• **id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:236 - -___ - -### namespaces - -• `Optional` **namespaces**: `string`[] - -Optional namespace(s) for the object to be retrieved in. If this is defined, it will supersede the namespace ID that is in the -top-level options. - -* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, - including the "All spaces" identifier (`'*'`). -* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only - be used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed. -* For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:250 - -___ - -### type - -• **type**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:237 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResolveObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResolveObject.md deleted file mode 100644 index 56105f08768ae..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResolveObject.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBulkResolveObject - -# Interface: SavedObjectsBulkResolveObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBulkResolveObject - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectsBulkResolveObject.md#id) -- [type](client._internal_namespace.SavedObjectsBulkResolveObject.md#type) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:279 - -___ - -### type - -• **type**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:280 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResolveResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResolveResponse.md deleted file mode 100644 index 4f7fc1463bb4b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResolveResponse.md +++ /dev/null @@ -1,27 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBulkResolveResponse - -# Interface: SavedObjectsBulkResolveResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBulkResolveResponse - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Table of contents - -### Properties - -- [resolved\_objects](client._internal_namespace.SavedObjectsBulkResolveResponse.md#resolved_objects) - -## Properties - -### resolved\_objects - -• **resolved\_objects**: [`SavedObjectsResolveResponse`](client._internal_namespace.SavedObjectsResolveResponse.md)<`T`\>[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:287 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResponse.md deleted file mode 100644 index 76af857d6f612..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkResponse.md +++ /dev/null @@ -1,27 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBulkResponse - -# Interface: SavedObjectsBulkResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBulkResponse - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Table of contents - -### Properties - -- [saved\_objects](client._internal_namespace.SavedObjectsBulkResponse.md#saved_objects) - -## Properties - -### saved\_objects - -• **saved\_objects**: [`SavedObject`](client._internal_namespace.SavedObject.md)<`T`\>[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:107 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateObject.md deleted file mode 100644 index f0ae9c5aa503f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateObject.md +++ /dev/null @@ -1,111 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBulkUpdateObject - -# Interface: SavedObjectsBulkUpdateObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBulkUpdateObject - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Hierarchy - -- `Pick`<[`SavedObjectsUpdateOptions`](client._internal_namespace.SavedObjectsUpdateOptions.md)<`T`\>, ``"version"`` \| ``"references"``\> - - ↳ **`SavedObjectsBulkUpdateObject`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.SavedObjectsBulkUpdateObject.md#attributes) -- [id](client._internal_namespace.SavedObjectsBulkUpdateObject.md#id) -- [namespace](client._internal_namespace.SavedObjectsBulkUpdateObject.md#namespace) -- [references](client._internal_namespace.SavedObjectsBulkUpdateObject.md#references) -- [type](client._internal_namespace.SavedObjectsBulkUpdateObject.md#type) -- [version](client._internal_namespace.SavedObjectsBulkUpdateObject.md#version) - -## Properties - -### attributes - -• **attributes**: `Partial`<`T`\> - -{@inheritdoc SavedObjectAttributes} - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:93 - -___ - -### id - -• **id**: `string` - -The ID of this Saved Object, guaranteed to be unique for all objects of the same `type` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:89 - -___ - -### namespace - -• `Optional` **namespace**: `string` - -Optional namespace string to use when searching for this object. If this is defined, it will supersede the namespace ID that is in -[SavedObjectsBulkUpdateOptions](client._internal_namespace.SavedObjectsBulkUpdateOptions.md). - -Note: the default namespace's string representation is `'default'`, and its ID representation is `undefined`. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:100 - -___ - -### references - -• `Optional` **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -{@inheritdoc SavedObjectReference} - -#### Inherited from - -Pick.references - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:191 - -___ - -### type - -• **type**: `string` - -The type of this Saved Object. Each plugin can define it's own custom Saved Object types. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:91 - -___ - -### version - -• `Optional` **version**: `string` - -An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. - -#### Inherited from - -Pick.version - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:189 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateOptions.md deleted file mode 100644 index 4de3a8eefdb02..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateOptions.md +++ /dev/null @@ -1,46 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBulkUpdateOptions - -# Interface: SavedObjectsBulkUpdateOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBulkUpdateOptions - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsBulkUpdateOptions`** - -## Table of contents - -### Properties - -- [namespace](client._internal_namespace.SavedObjectsBulkUpdateOptions.md#namespace) -- [refresh](client._internal_namespace.SavedObjectsBulkUpdateOptions.md#refresh) - -## Properties - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### refresh - -• `Optional` **refresh**: [`MutatingOperationRefreshSetting`](../modules/client._internal_namespace.md#mutatingoperationrefreshsetting) - -The Elasticsearch Refresh setting for this operation - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:219 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md deleted file mode 100644 index 93fb3c3f3a3b2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md +++ /dev/null @@ -1,27 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsBulkUpdateResponse - -# Interface: SavedObjectsBulkUpdateResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsBulkUpdateResponse - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Table of contents - -### Properties - -- [saved\_objects](client._internal_namespace.SavedObjectsBulkUpdateResponse.md#saved_objects) - -## Properties - -### saved\_objects - -• **saved\_objects**: [`SavedObjectsUpdateResponse`](client._internal_namespace.SavedObjectsUpdateResponse.md)<`T`\>[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:264 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCheckConflictsObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCheckConflictsObject.md deleted file mode 100644 index 7b8a8b1b6982f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCheckConflictsObject.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsCheckConflictsObject - -# Interface: SavedObjectsCheckConflictsObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsCheckConflictsObject - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectsCheckConflictsObject.md#id) -- [type](client._internal_namespace.SavedObjectsCheckConflictsObject.md#type) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:169 - -___ - -### type - -• **type**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:170 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCheckConflictsResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCheckConflictsResponse.md deleted file mode 100644 index d43f929a18fed..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCheckConflictsResponse.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsCheckConflictsResponse - -# Interface: SavedObjectsCheckConflictsResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsCheckConflictsResponse - -## Table of contents - -### Properties - -- [errors](client._internal_namespace.SavedObjectsCheckConflictsResponse.md#errors) - -## Properties - -### errors - -• **errors**: { `error`: [`SavedObjectError`](client._internal_namespace.SavedObjectError.md) ; `id`: `string` ; `type`: `string` }[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:177 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md deleted file mode 100644 index acf9af85bdc20..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md +++ /dev/null @@ -1,37 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsClosePointInTimeResponse - -# Interface: SavedObjectsClosePointInTimeResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsClosePointInTimeResponse - -## Table of contents - -### Properties - -- [num\_freed](client._internal_namespace.SavedObjectsClosePointInTimeResponse.md#num_freed) -- [succeeded](client._internal_namespace.SavedObjectsClosePointInTimeResponse.md#succeeded) - -## Properties - -### num\_freed - -• **num\_freed**: `number` - -The number of search contexts that have been successfully closed. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:360 - -___ - -### succeeded - -• **succeeded**: `boolean` - -If true, all search contexts associated with the PIT id are -successfully closed. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:356 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesObject.md deleted file mode 100644 index 7db1c04858eb3..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesObject.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsCollectMultiNamespaceReferencesObject - -# Interface: SavedObjectsCollectMultiNamespaceReferencesObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsCollectMultiNamespaceReferencesObject - -An object to collect references for. It must be a multi-namespace type (in other words, the object type must be registered with the -`namespaceType: 'multiple'` or `namespaceType: 'multiple-isolated'` option). - -Note: if options.purpose is 'updateObjectsSpaces', it must be a shareable type (in other words, the object type must be registered with -the `namespaceType: 'multiple'`). - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesObject.md#id) -- [type](client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesObject.md#type) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:24 - -___ - -### type - -• **type**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:25 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md deleted file mode 100644 index 32ffe4158cc00..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md +++ /dev/null @@ -1,48 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsCollectMultiNamespaceReferencesOptions - -# Interface: SavedObjectsCollectMultiNamespaceReferencesOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsCollectMultiNamespaceReferencesOptions - -Options for collecting references. - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsCollectMultiNamespaceReferencesOptions`** - -## Table of contents - -### Properties - -- [namespace](client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md#namespace) -- [purpose](client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md#purpose) - -## Properties - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### purpose - -• `Optional` **purpose**: ``"collectMultiNamespaceReferences"`` \| ``"updateObjectsSpaces"`` - -Optional purpose used to determine filtering and authorization checks; default is 'collectMultiNamespaceReferences' - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:34 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md deleted file mode 100644 index 768ce8c1c6094..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md +++ /dev/null @@ -1,23 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsCollectMultiNamespaceReferencesResponse - -# Interface: SavedObjectsCollectMultiNamespaceReferencesResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsCollectMultiNamespaceReferencesResponse - -The response when object references are collected. - -## Table of contents - -### Properties - -- [objects](client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md#objects) - -## Properties - -### objects - -• **objects**: [`SavedObjectReferenceWithContext`](client._internal_namespace.SavedObjectReferenceWithContext.md)[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/collect_multi_namespace_references.d.ts:71 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCreateOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCreateOptions.md deleted file mode 100644 index d2b13605808ac..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCreateOptions.md +++ /dev/null @@ -1,162 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsCreateOptions - -# Interface: SavedObjectsCreateOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsCreateOptions - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsCreateOptions`** - -## Table of contents - -### Properties - -- [coreMigrationVersion](client._internal_namespace.SavedObjectsCreateOptions.md#coremigrationversion) -- [id](client._internal_namespace.SavedObjectsCreateOptions.md#id) -- [initialNamespaces](client._internal_namespace.SavedObjectsCreateOptions.md#initialnamespaces) -- [migrationVersion](client._internal_namespace.SavedObjectsCreateOptions.md#migrationversion) -- [namespace](client._internal_namespace.SavedObjectsCreateOptions.md#namespace) -- [originId](client._internal_namespace.SavedObjectsCreateOptions.md#originid) -- [overwrite](client._internal_namespace.SavedObjectsCreateOptions.md#overwrite) -- [references](client._internal_namespace.SavedObjectsCreateOptions.md#references) -- [refresh](client._internal_namespace.SavedObjectsCreateOptions.md#refresh) -- [version](client._internal_namespace.SavedObjectsCreateOptions.md#version) - -## Properties - -### coreMigrationVersion - -• `Optional` **coreMigrationVersion**: `string` - -A semver value that is used when upgrading objects between Kibana versions. If undefined, this will be automatically set to the current -Kibana version when the object is created. If this is set to a non-semver value, or it is set to a semver value greater than the -current Kibana version, it will result in an error. - -**`remarks`** -Do not attempt to set this manually. It should only be used if you retrieved an existing object that had the `coreMigrationVersion` -field set and you want to create it again. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:29 - -___ - -### id - -• `Optional` **id**: `string` - -(not recommended) Specify an id for the document - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:10 - -___ - -### initialNamespaces - -• `Optional` **initialNamespaces**: `string`[] - -Optional initial namespaces for the object to be created in. If this is defined, it will supersede the namespace ID that is in -[SavedObjectsCreateOptions](client._internal_namespace.SavedObjectsCreateOptions.md). - -* For shareable object types (registered with `namespaceType: 'multiple'`): this option can be used to specify one or more spaces, - including the "All spaces" identifier (`'*'`). -* For isolated object types (registered with `namespaceType: 'single'` or `namespaceType: 'multiple-isolated'`): this option can only - be used to specify a single space, and the "All spaces" identifier (`'*'`) is not allowed. -* For global object types (registered with `namespaceType: 'agnostic'`): this option cannot be used. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:45 - -___ - -### migrationVersion - -• `Optional` **migrationVersion**: [`SavedObjectsMigrationVersion`](client._internal_namespace.SavedObjectsMigrationVersion.md) - -{@inheritDoc SavedObjectsMigrationVersion} - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:19 - -___ - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### originId - -• `Optional` **originId**: `string` - -Optional ID of the original saved object, if this object's `id` was regenerated - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:34 - -___ - -### overwrite - -• `Optional` **overwrite**: `boolean` - -Overwrite existing documents (defaults to false) - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:12 - -___ - -### references - -• `Optional` **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:30 - -___ - -### refresh - -• `Optional` **refresh**: [`MutatingOperationRefreshSetting`](../modules/client._internal_namespace.md#mutatingoperationrefreshsetting) - -The Elasticsearch Refresh setting for this operation - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:32 - -___ - -### version - -• `Optional` **version**: `string` - -An opaque version number which changes on each successful write operation. -Can be used in conjunction with `overwrite` for implementing optimistic concurrency control. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:17 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCreatePointInTimeFinderDependencies.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCreatePointInTimeFinderDependencies.md deleted file mode 100644 index 3289e3cb4144f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsCreatePointInTimeFinderDependencies.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsCreatePointInTimeFinderDependencies - -# Interface: SavedObjectsCreatePointInTimeFinderDependencies - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsCreatePointInTimeFinderDependencies - -## Table of contents - -### Properties - -- [client](client._internal_namespace.SavedObjectsCreatePointInTimeFinderDependencies.md#client) - -## Properties - -### client - -• **client**: `Pick`<[`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract), ``"find"`` \| ``"openPointInTimeForType"`` \| ``"closePointInTime"``\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/point_in_time_finder.d.ts:12 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsDeleteByNamespaceOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsDeleteByNamespaceOptions.md deleted file mode 100644 index 17fa13e76ec5f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsDeleteByNamespaceOptions.md +++ /dev/null @@ -1,46 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsDeleteByNamespaceOptions - -# Interface: SavedObjectsDeleteByNamespaceOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsDeleteByNamespaceOptions - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsDeleteByNamespaceOptions`** - -## Table of contents - -### Properties - -- [namespace](client._internal_namespace.SavedObjectsDeleteByNamespaceOptions.md#namespace) -- [refresh](client._internal_namespace.SavedObjectsDeleteByNamespaceOptions.md#refresh) - -## Properties - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### refresh - -• `Optional` **refresh**: `boolean` - -The Elasticsearch supports only boolean flag for this operation - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:49 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsDeleteOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsDeleteOptions.md deleted file mode 100644 index 21bd9feec57cf..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsDeleteOptions.md +++ /dev/null @@ -1,59 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsDeleteOptions - -# Interface: SavedObjectsDeleteOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsDeleteOptions - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsDeleteOptions`** - -## Table of contents - -### Properties - -- [force](client._internal_namespace.SavedObjectsDeleteOptions.md#force) -- [namespace](client._internal_namespace.SavedObjectsDeleteOptions.md#namespace) -- [refresh](client._internal_namespace.SavedObjectsDeleteOptions.md#refresh) - -## Properties - -### force - -• `Optional` **force**: `boolean` - -Force deletion of an object that exists in multiple namespaces - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:229 - -___ - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### refresh - -• `Optional` **refresh**: [`MutatingOperationRefreshSetting`](../modules/client._internal_namespace.md#mutatingoperationrefreshsetting) - -The Elasticsearch Refresh setting for this operation - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:227 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsExportTransformContext.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsExportTransformContext.md deleted file mode 100644 index 2b82cecc98091..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsExportTransformContext.md +++ /dev/null @@ -1,26 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsExportTransformContext - -# Interface: SavedObjectsExportTransformContext - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsExportTransformContext - -Context passed down to a [export transform function](../modules/client._internal_namespace.md#savedobjectsexporttransform) - -## Table of contents - -### Properties - -- [request](client._internal_namespace.SavedObjectsExportTransformContext.md#request) - -## Properties - -### request - -• **request**: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> - -The request that initiated the export request. Can be used to create scoped -services or client inside the [transformation](../modules/client._internal_namespace.md#savedobjectsexporttransform) - -#### Defined in - -src/core/target/types/server/saved_objects/export/types.d.ts:87 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindOptions.md deleted file mode 100644 index 1cc767734ce55..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindOptions.md +++ /dev/null @@ -1,270 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsFindOptions - -# Interface: SavedObjectsFindOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsFindOptions - -## Table of contents - -### Properties - -- [aggs](client._internal_namespace.SavedObjectsFindOptions.md#aggs) -- [defaultSearchOperator](client._internal_namespace.SavedObjectsFindOptions.md#defaultsearchoperator) -- [fields](client._internal_namespace.SavedObjectsFindOptions.md#fields) -- [filter](client._internal_namespace.SavedObjectsFindOptions.md#filter) -- [hasReference](client._internal_namespace.SavedObjectsFindOptions.md#hasreference) -- [hasReferenceOperator](client._internal_namespace.SavedObjectsFindOptions.md#hasreferenceoperator) -- [namespaces](client._internal_namespace.SavedObjectsFindOptions.md#namespaces) -- [page](client._internal_namespace.SavedObjectsFindOptions.md#page) -- [perPage](client._internal_namespace.SavedObjectsFindOptions.md#perpage) -- [pit](client._internal_namespace.SavedObjectsFindOptions.md#pit) -- [preference](client._internal_namespace.SavedObjectsFindOptions.md#preference) -- [rootSearchFields](client._internal_namespace.SavedObjectsFindOptions.md#rootsearchfields) -- [search](client._internal_namespace.SavedObjectsFindOptions.md#search) -- [searchAfter](client._internal_namespace.SavedObjectsFindOptions.md#searchafter) -- [searchFields](client._internal_namespace.SavedObjectsFindOptions.md#searchfields) -- [sortField](client._internal_namespace.SavedObjectsFindOptions.md#sortfield) -- [sortOrder](client._internal_namespace.SavedObjectsFindOptions.md#sortorder) -- [type](client._internal_namespace.SavedObjectsFindOptions.md#type) -- [typeToNamespacesMap](client._internal_namespace.SavedObjectsFindOptions.md#typetonamespacesmap) - -## Properties - -### aggs - -• `Optional` **aggs**: `Record`<`string`, `AggregationsAggregationContainer`\> - -A record of aggregations to perform. -The API currently only supports a limited set of metrics and bucket aggregation types. -Additional aggregation types can be contributed to Core. - -**`example`** -Aggregating on SO attribute field -```ts -const aggs = { latest_version: { max: { field: 'dashboard.attributes.version' } } }; -return client.find({ type: 'dashboard', aggs }) -``` - -**`example`** -Aggregating on SO root field -```ts -const aggs = { latest_update: { max: { field: 'dashboard.updated_at' } } }; -return client.find({ type: 'dashboard', aggs }) -``` - -**`alpha`** - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:103 - -___ - -### defaultSearchOperator - -• `Optional` **defaultSearchOperator**: ``"AND"`` \| ``"OR"`` - -The search operator to use with the provided filter. Defaults to `OR` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:80 - -___ - -### fields - -• `Optional` **fields**: `string`[] - -An array of fields to include in the results - -**`example`** -SavedObjects.find({type: 'dashboard', fields: ['attributes.name', 'attributes.location']}) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:54 - -___ - -### filter - -• `Optional` **filter**: `any` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:81 - -___ - -### hasReference - -• `Optional` **hasReference**: [`SavedObjectsFindOptionsReference`](client._internal_namespace.SavedObjectsFindOptionsReference.md) \| [`SavedObjectsFindOptionsReference`](client._internal_namespace.SavedObjectsFindOptionsReference.md)[] - -Search for documents having a reference to the specified objects. -Use `hasReferenceOperator` to specify the operator to use when searching for multiple references. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:72 - -___ - -### hasReferenceOperator - -• `Optional` **hasReferenceOperator**: ``"AND"`` \| ``"OR"`` - -The operator to use when searching by multiple references using the `hasReference` option. Defaults to `OR` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:76 - -___ - -### namespaces - -• `Optional` **namespaces**: `string`[] - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:104 - -___ - -### page - -• `Optional` **page**: `number` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:45 - -___ - -### perPage - -• `Optional` **perPage**: `number` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:46 - -___ - -### pit - -• `Optional` **pit**: [`SavedObjectsPitParams`](client._internal_namespace.SavedObjectsPitParams.md) - -Search against a specific Point In Time (PIT) that you've opened with [SavedObjectsClient.openPointInTimeForType](../classes/client._internal_namespace.SavedObjectsClient.md#openpointintimefortype). - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:118 - -___ - -### preference - -• `Optional` **preference**: `string` - -An optional ES preference value to be used for the query - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:114 - -___ - -### rootSearchFields - -• `Optional` **rootSearchFields**: `string`[] - -The fields to perform the parsed query against. Unlike the `searchFields` argument, these are expected to be root fields and will not -be modified. If used in conjunction with `searchFields`, both are concatenated together. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:67 - -___ - -### search - -• `Optional` **search**: `string` - -Search documents using the Elasticsearch Simple Query String syntax. See Elasticsearch Simple Query String `query` argument for more information - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:56 - -___ - -### searchAfter - -• `Optional` **searchAfter**: `string`[] - -Use the sort values from the previous page to retrieve the next page of results. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:62 - -___ - -### searchFields - -• `Optional` **searchFields**: `string`[] - -The fields to perform the parsed query against. See Elasticsearch Simple Query String `fields` argument for more information - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:58 - -___ - -### sortField - -• `Optional` **sortField**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:47 - -___ - -### sortOrder - -• `Optional` **sortOrder**: `SortOrder` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:48 - -___ - -### type - -• **type**: `string` \| `string`[] - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:44 - -___ - -### typeToNamespacesMap - -• `Optional` **typeToNamespacesMap**: `Map`<`string`, `undefined` \| `string`[]\> - -This map defines each type to search for, and the namespace(s) to search for the type in; this is only intended to be used by a saved -object client wrapper. -If this is defined, it supersedes the `type` and `namespaces` fields when building the Elasticsearch query. -Any types that are not included in this map will be excluded entirely. -If a type is included but its value is undefined, the operation will search for that type in the Default namespace. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:112 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindOptionsReference.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindOptionsReference.md deleted file mode 100644 index dd1f782c26b7d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindOptionsReference.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsFindOptionsReference - -# Interface: SavedObjectsFindOptionsReference - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsFindOptionsReference - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectsFindOptionsReference.md#id) -- [type](client._internal_namespace.SavedObjectsFindOptionsReference.md#type) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:30 - -___ - -### type - -• **type**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:29 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindResponse.md deleted file mode 100644 index 5fd16ec67e781..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindResponse.md +++ /dev/null @@ -1,88 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsFindResponse - -# Interface: SavedObjectsFindResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsFindResponse - -Return type of the Saved Objects `find()` method. - -*Note*: this type is different between the Public and Server Saved Objects -clients. - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | -| `A` | `unknown` | - -## Table of contents - -### Properties - -- [aggregations](client._internal_namespace.SavedObjectsFindResponse.md#aggregations) -- [page](client._internal_namespace.SavedObjectsFindResponse.md#page) -- [per\_page](client._internal_namespace.SavedObjectsFindResponse.md#per_page) -- [pit\_id](client._internal_namespace.SavedObjectsFindResponse.md#pit_id) -- [saved\_objects](client._internal_namespace.SavedObjectsFindResponse.md#saved_objects) -- [total](client._internal_namespace.SavedObjectsFindResponse.md#total) - -## Properties - -### aggregations - -• `Optional` **aggregations**: `A` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:157 - -___ - -### page - -• **page**: `number` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:161 - -___ - -### per\_page - -• **per\_page**: `number` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:160 - -___ - -### pit\_id - -• `Optional` **pit\_id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:162 - -___ - -### saved\_objects - -• **saved\_objects**: [`SavedObjectsFindResult`](client._internal_namespace.SavedObjectsFindResult.md)<`T`\>[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:158 - -___ - -### total - -• **total**: `number` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:159 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindResult.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindResult.md deleted file mode 100644 index aa7578f7daaa6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsFindResult.md +++ /dev/null @@ -1,262 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsFindResult - -# Interface: SavedObjectsFindResult - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsFindResult - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Hierarchy - -- [`SavedObject`](client._internal_namespace.SavedObject.md)<`T`\> - - ↳ **`SavedObjectsFindResult`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.SavedObjectsFindResult.md#attributes) -- [coreMigrationVersion](client._internal_namespace.SavedObjectsFindResult.md#coremigrationversion) -- [error](client._internal_namespace.SavedObjectsFindResult.md#error) -- [id](client._internal_namespace.SavedObjectsFindResult.md#id) -- [migrationVersion](client._internal_namespace.SavedObjectsFindResult.md#migrationversion) -- [namespaces](client._internal_namespace.SavedObjectsFindResult.md#namespaces) -- [originId](client._internal_namespace.SavedObjectsFindResult.md#originid) -- [references](client._internal_namespace.SavedObjectsFindResult.md#references) -- [score](client._internal_namespace.SavedObjectsFindResult.md#score) -- [sort](client._internal_namespace.SavedObjectsFindResult.md#sort) -- [type](client._internal_namespace.SavedObjectsFindResult.md#type) -- [updated\_at](client._internal_namespace.SavedObjectsFindResult.md#updated_at) -- [version](client._internal_namespace.SavedObjectsFindResult.md#version) - -## Properties - -### attributes - -• **attributes**: `T` - -{@inheritdoc SavedObjectAttributes} - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[attributes](client._internal_namespace.SavedObject.md#attributes) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:61 - -___ - -### coreMigrationVersion - -• `Optional` **coreMigrationVersion**: `string` - -A semver value that is used when upgrading objects between Kibana versions. - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[coreMigrationVersion](client._internal_namespace.SavedObject.md#coremigrationversion) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:67 - -___ - -### error - -• `Optional` **error**: [`SavedObjectError`](client._internal_namespace.SavedObjectError.md) - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[error](client._internal_namespace.SavedObject.md#error) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:59 - -___ - -### id - -• **id**: `string` - -The ID of this Saved Object, guaranteed to be unique for all objects of the same `type` - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[id](client._internal_namespace.SavedObject.md#id) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:52 - -___ - -### migrationVersion - -• `Optional` **migrationVersion**: [`SavedObjectsMigrationVersion`](client._internal_namespace.SavedObjectsMigrationVersion.md) - -{@inheritdoc SavedObjectsMigrationVersion} - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[migrationVersion](client._internal_namespace.SavedObject.md#migrationversion) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:65 - -___ - -### namespaces - -• `Optional` **namespaces**: `string`[] - -Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with -`namespaceType: 'agnostic'`. - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[namespaces](client._internal_namespace.SavedObject.md#namespaces) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:72 - -___ - -### originId - -• `Optional` **originId**: `string` - -The ID of the saved object this originated from. This is set if this object's `id` was regenerated; that can happen during migration -from a legacy single-namespace type, or during import. It is only set during migration or create operations. This is used during import -to ensure that ID regeneration is deterministic, so saved objects will be overwritten if they are imported multiple times into a given -space. - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[originId](client._internal_namespace.SavedObject.md#originid) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:79 - -___ - -### references - -• **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -{@inheritdoc SavedObjectReference} - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[references](client._internal_namespace.SavedObject.md#references) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:63 - -___ - -### score - -• **score**: `number` - -The Elasticsearch `_score` of this result. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:117 - -___ - -### sort - -• `Optional` **sort**: `string`[] - -The Elasticsearch `sort` value of this result. - -**`remarks`** -This can be passed directly to the `searchAfter` param in the [SavedObjectsFindOptions](client._internal_namespace.SavedObjectsFindOptions.md) -in order to page through large numbers of hits. It is recommended you use this alongside -a Point In Time (PIT) that was opened with [SavedObjectsClient.openPointInTimeForType](../classes/client._internal_namespace.SavedObjectsClient.md#openpointintimefortype). - -**`example`** -```ts -const { id } = await savedObjectsClient.openPointInTimeForType('visualization'); -const page1 = await savedObjectsClient.find({ - type: 'visualization', - sortField: 'updated_at', - sortOrder: 'asc', - pit: { id }, -}); -const lastHit = page1.saved_objects[page1.saved_objects.length - 1]; -const page2 = await savedObjectsClient.find({ - type: 'visualization', - sortField: 'updated_at', - sortOrder: 'asc', - pit: { id: page1.pit_id }, - searchAfter: lastHit.sort, -}); -await savedObjectsClient.closePointInTime(page2.pit_id); -``` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:146 - -___ - -### type - -• **type**: `string` - -The type of Saved Object. Each plugin can define it's own custom Saved Object types. - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[type](client._internal_namespace.SavedObject.md#type) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:54 - -___ - -### updated\_at - -• `Optional` **updated\_at**: `string` - -Timestamp of the last time this document had been updated. - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[updated_at](client._internal_namespace.SavedObject.md#updated_at) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:58 - -___ - -### version - -• `Optional` **version**: `string` - -An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. - -#### Inherited from - -[SavedObject](client._internal_namespace.SavedObject.md).[version](client._internal_namespace.SavedObject.md#version) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:56 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportActionRequiredWarning.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportActionRequiredWarning.md deleted file mode 100644 index e2996e270116e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportActionRequiredWarning.md +++ /dev/null @@ -1,65 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsImportActionRequiredWarning - -# Interface: SavedObjectsImportActionRequiredWarning - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsImportActionRequiredWarning - -A warning meant to notify that a specific user action is required to finalize the import -of some type of object. - -**`remark`** The `actionUrl` must be a path relative to the basePath, and not include it. - -## Table of contents - -### Properties - -- [actionPath](client._internal_namespace.SavedObjectsImportActionRequiredWarning.md#actionpath) -- [buttonLabel](client._internal_namespace.SavedObjectsImportActionRequiredWarning.md#buttonlabel) -- [message](client._internal_namespace.SavedObjectsImportActionRequiredWarning.md#message) -- [type](client._internal_namespace.SavedObjectsImportActionRequiredWarning.md#type) - -## Properties - -### actionPath - -• **actionPath**: `string` - -The path (without the basePath) that the user should be redirect to address this warning. - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:191 - -___ - -### buttonLabel - -• `Optional` **buttonLabel**: `string` - -An optional label to use for the link button. If unspecified, a default label will be used. - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:193 - -___ - -### message - -• **message**: `string` - -The translated message to display to the user. - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:189 - -___ - -### type - -• **type**: ``"action_required"`` - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:187 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportHookResult.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportHookResult.md deleted file mode 100644 index 37e2cbd5d788b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportHookResult.md +++ /dev/null @@ -1,25 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsImportHookResult - -# Interface: SavedObjectsImportHookResult - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsImportHookResult - -Result from a [import hook](../modules/client._internal_namespace.md#savedobjectsimporthook) - -## Table of contents - -### Properties - -- [warnings](client._internal_namespace.SavedObjectsImportHookResult.md#warnings) - -## Properties - -### warnings - -• `Optional` **warnings**: [`SavedObjectsImportWarning`](../modules/client._internal_namespace.md#savedobjectsimportwarning)[] - -An optional list of warnings to display in the UI when the import succeeds. - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:213 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportSimpleWarning.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportSimpleWarning.md deleted file mode 100644 index 55f2c60462af4..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsImportSimpleWarning.md +++ /dev/null @@ -1,36 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsImportSimpleWarning - -# Interface: SavedObjectsImportSimpleWarning - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsImportSimpleWarning - -A simple informative warning that will be displayed to the user. - -## Table of contents - -### Properties - -- [message](client._internal_namespace.SavedObjectsImportSimpleWarning.md#message) -- [type](client._internal_namespace.SavedObjectsImportSimpleWarning.md#type) - -## Properties - -### message - -• **message**: `string` - -The translated message to display to the user - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:176 - -___ - -### type - -• **type**: ``"simple"`` - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:174 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsIncrementCounterField.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsIncrementCounterField.md deleted file mode 100644 index b215848243659..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsIncrementCounterField.md +++ /dev/null @@ -1,36 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsIncrementCounterField - -# Interface: SavedObjectsIncrementCounterField - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsIncrementCounterField - -## Table of contents - -### Properties - -- [fieldName](client._internal_namespace.SavedObjectsIncrementCounterField.md#fieldname) -- [incrementBy](client._internal_namespace.SavedObjectsIncrementCounterField.md#incrementby) - -## Properties - -### fieldName - -• **fieldName**: `string` - -The field name to increment the counter by. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:63 - -___ - -### incrementBy - -• `Optional` **incrementBy**: `number` - -The number to increment the field by (defaults to 1). - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:65 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsIncrementCounterOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsIncrementCounterOptions.md deleted file mode 100644 index ce239bd55e5c2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsIncrementCounterOptions.md +++ /dev/null @@ -1,93 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsIncrementCounterOptions - -# Interface: SavedObjectsIncrementCounterOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsIncrementCounterOptions - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Attributes` | `unknown` | - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsIncrementCounterOptions`** - -## Table of contents - -### Properties - -- [initialize](client._internal_namespace.SavedObjectsIncrementCounterOptions.md#initialize) -- [migrationVersion](client._internal_namespace.SavedObjectsIncrementCounterOptions.md#migrationversion) -- [namespace](client._internal_namespace.SavedObjectsIncrementCounterOptions.md#namespace) -- [refresh](client._internal_namespace.SavedObjectsIncrementCounterOptions.md#refresh) -- [upsertAttributes](client._internal_namespace.SavedObjectsIncrementCounterOptions.md#upsertattributes) - -## Properties - -### initialize - -• `Optional` **initialize**: `boolean` - -(default=false) If true, sets all the counter fields to 0 if they don't -already exist. Existing fields will be left as-is and won't be incremented. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:30 - -___ - -### migrationVersion - -• `Optional` **migrationVersion**: [`SavedObjectsMigrationVersion`](client._internal_namespace.SavedObjectsMigrationVersion.md) - -[SavedObjectsMigrationVersion](client._internal_namespace.SavedObjectsMigrationVersion.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:32 - -___ - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### refresh - -• `Optional` **refresh**: [`MutatingOperationRefreshSetting`](../modules/client._internal_namespace.md#mutatingoperationrefreshsetting) - -(default='wait_for') The Elasticsearch refresh setting for this -operation. See [MutatingOperationRefreshSetting](../modules/client._internal_namespace.md#mutatingoperationrefreshsetting) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:37 - -___ - -### upsertAttributes - -• `Optional` **upsertAttributes**: `Attributes` - -Attributes to use when upserting the document if it doesn't exist. - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:41 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMappingProperties.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMappingProperties.md deleted file mode 100644 index 5dca5a908c566..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMappingProperties.md +++ /dev/null @@ -1,11 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsMappingProperties - -# Interface: SavedObjectsMappingProperties - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsMappingProperties - -Describe the fields of a [saved object type](client._internal_namespace.SavedObjectsTypeMappingDefinition.md). - -## Indexable - -▪ [field: `string`]: [`SavedObjectsFieldMapping`](../modules/client._internal_namespace.md#savedobjectsfieldmapping) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMigrationLogger.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMigrationLogger.md deleted file mode 100644 index 399885d1ab4ae..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMigrationLogger.md +++ /dev/null @@ -1,124 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsMigrationLogger - -# Interface: SavedObjectsMigrationLogger - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsMigrationLogger - -## Table of contents - -### Methods - -- [debug](client._internal_namespace.SavedObjectsMigrationLogger.md#debug) -- [error](client._internal_namespace.SavedObjectsMigrationLogger.md#error) -- [info](client._internal_namespace.SavedObjectsMigrationLogger.md#info) -- [warn](client._internal_namespace.SavedObjectsMigrationLogger.md#warn) -- [warning](client._internal_namespace.SavedObjectsMigrationLogger.md#warning) - -## Methods - -### debug - -▸ **debug**(`msg`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msg` | `string` | - -#### Returns - -`void` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/core/migration_logger.d.ts:5 - -___ - -### error - -▸ **error**<`Meta`\>(`msg`, `meta`): `void` - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Meta` | extends `LogMeta` = `LogMeta` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msg` | `string` | -| `meta` | `Meta` | - -#### Returns - -`void` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/core/migration_logger.d.ts:12 - -___ - -### info - -▸ **info**(`msg`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msg` | `string` | - -#### Returns - -`void` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/core/migration_logger.d.ts:6 - -___ - -### warn - -▸ **warn**(`msg`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msg` | `string` | - -#### Returns - -`void` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/core/migration_logger.d.ts:11 - -___ - -### warning - -▸ **warning**(`msg`): `void` - -**`deprecated`** Use `warn` instead. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msg` | `string` | - -#### Returns - -`void` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/core/migration_logger.d.ts:10 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMigrationVersion.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMigrationVersion.md deleted file mode 100644 index deee7313ee96b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsMigrationVersion.md +++ /dev/null @@ -1,21 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsMigrationVersion - -# Interface: SavedObjectsMigrationVersion - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsMigrationVersion - -Information about the migrations that have been applied to this SavedObject. -When Kibana starts up, KibanaMigrator detects outdated documents and -migrates them based on this value. For each migration that has been applied, -the plugin's name is used as a key and the latest migration version as the -value. - -**`example`** -migrationVersion: { - dashboard: '7.1.1', - space: '6.6.6', -} - -## Indexable - -▪ [pluginName: `string`]: `string` diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md deleted file mode 100644 index 1b5d7dd5c90ea..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md +++ /dev/null @@ -1,54 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsOpenPointInTimeOptions - -# Interface: SavedObjectsOpenPointInTimeOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsOpenPointInTimeOptions - -## Table of contents - -### Properties - -- [keepAlive](client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md#keepalive) -- [namespaces](client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md#namespaces) -- [preference](client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md#preference) - -## Properties - -### keepAlive - -• `Optional` **keepAlive**: `string` - -Optionally specify how long ES should keep the PIT alive until the next request. Defaults to `5m`. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:320 - -___ - -### namespaces - -• `Optional` **namespaces**: `string`[] - -An optional list of namespaces to be used when opening the PIT. - -When the spaces plugin is enabled: - - this will default to the user's current space (as determined by the URL) - - if specified, the user's current space will be ignored - - `['*']` will search across all available spaces - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:333 - -___ - -### preference - -• `Optional` **preference**: `string` - -An optional ES preference value to be used for the query. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:324 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md deleted file mode 100644 index 22718b1c3177c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md +++ /dev/null @@ -1,23 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsOpenPointInTimeResponse - -# Interface: SavedObjectsOpenPointInTimeResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsOpenPointInTimeResponse - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md#id) - -## Properties - -### id - -• **id**: `string` - -PIT ID returned from ES. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:342 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsPitParams.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsPitParams.md deleted file mode 100644 index 0c2d6fdc1cc4e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsPitParams.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsPitParams - -# Interface: SavedObjectsPitParams - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsPitParams - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectsPitParams.md#id) -- [keepAlive](client._internal_namespace.SavedObjectsPitParams.md#keepalive) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:36 - -___ - -### keepAlive - -• `Optional` **keepAlive**: `string` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:37 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md deleted file mode 100644 index 79de02623cf8a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md +++ /dev/null @@ -1,46 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsRemoveReferencesToOptions - -# Interface: SavedObjectsRemoveReferencesToOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsRemoveReferencesToOptions - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsRemoveReferencesToOptions`** - -## Table of contents - -### Properties - -- [namespace](client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md#namespace) -- [refresh](client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md#refresh) - -## Properties - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### refresh - -• `Optional` **refresh**: `boolean` - -The Elasticsearch Refresh setting for this operation. Defaults to `true` - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:203 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md deleted file mode 100644 index c6d285307c99d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md +++ /dev/null @@ -1,46 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsRemoveReferencesToResponse - -# Interface: SavedObjectsRemoveReferencesToResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsRemoveReferencesToResponse - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsRemoveReferencesToResponse`** - -## Table of contents - -### Properties - -- [namespace](client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md#namespace) -- [updated](client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md#updated) - -## Properties - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### updated - -• **updated**: `number` - -The number of objects that have been updated by this operation - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:211 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsResolveResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsResolveResponse.md deleted file mode 100644 index a4d66d064bf63..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsResolveResponse.md +++ /dev/null @@ -1,61 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsResolveResponse - -# Interface: SavedObjectsResolveResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsResolveResponse - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Table of contents - -### Properties - -- [alias\_target\_id](client._internal_namespace.SavedObjectsResolveResponse.md#alias_target_id) -- [outcome](client._internal_namespace.SavedObjectsResolveResponse.md#outcome) -- [saved\_object](client._internal_namespace.SavedObjectsResolveResponse.md#saved_object) - -## Properties - -### alias\_target\_id - -• `Optional` **alias\_target\_id**: `string` - -The ID of the object that the legacy URL alias points to. This is only defined when the outcome is `'aliasMatch'` or `'conflict'`. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:311 - -___ - -### outcome - -• **outcome**: ``"exactMatch"`` \| ``"aliasMatch"`` \| ``"conflict"`` - -The outcome for a successful `resolve` call is one of the following values: - - * `'exactMatch'` -- One document exactly matched the given ID. - * `'aliasMatch'` -- One document with a legacy URL alias matched the given ID; in this case the `saved_object.id` field is different - than the given ID. - * `'conflict'` -- Two documents matched the given ID, one was an exact match and another with a legacy URL alias; in this case the - `saved_object` object is the exact match, and the `saved_object.id` field is the same as the given ID. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:307 - -___ - -### saved\_object - -• **saved\_object**: [`SavedObject`](client._internal_namespace.SavedObject.md)<`T`\> - -The saved object that was found. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:297 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsType.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsType.md deleted file mode 100644 index b211135fc93ac..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsType.md +++ /dev/null @@ -1,212 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsType - -# Interface: SavedObjectsType - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsType - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Attributes` | `any` | - -## Table of contents - -### Properties - -- [convertToAliasScript](client._internal_namespace.SavedObjectsType.md#converttoaliasscript) -- [convertToMultiNamespaceTypeVersion](client._internal_namespace.SavedObjectsType.md#converttomultinamespacetypeversion) -- [excludeOnUpgrade](client._internal_namespace.SavedObjectsType.md#excludeonupgrade) -- [hidden](client._internal_namespace.SavedObjectsType.md#hidden) -- [indexPattern](client._internal_namespace.SavedObjectsType.md#indexpattern) -- [management](client._internal_namespace.SavedObjectsType.md#management) -- [mappings](client._internal_namespace.SavedObjectsType.md#mappings) -- [migrations](client._internal_namespace.SavedObjectsType.md#migrations) -- [name](client._internal_namespace.SavedObjectsType.md#name) -- [namespaceType](client._internal_namespace.SavedObjectsType.md#namespacetype) -- [schemas](client._internal_namespace.SavedObjectsType.md#schemas) - -## Properties - -### convertToAliasScript - -• `Optional` **convertToAliasScript**: `string` - -If defined, will be used to convert the type to an alias. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:235 - -___ - -### convertToMultiNamespaceTypeVersion - -• `Optional` **convertToMultiNamespaceTypeVersion**: `string` - -If defined, objects of this type will be converted to a 'multiple' or 'multiple-isolated' namespace type when migrating to this -version. - -Requirements: - - 1. This string value must be a valid semver version - 2. This type must have previously specified [`namespaceType: 'single'`](../modules/client._internal_namespace.md#savedobjectsnamespacetype) - 3. This type must also specify [`namespaceType: 'multiple'`](../modules/client._internal_namespace.md#savedobjectsnamespacetype) *or* - [`namespaceType: 'multiple-isolated'`](../modules/client._internal_namespace.md#savedobjectsnamespacetype) - -Example of a single-namespace type in 7.12: - -```ts -{ - name: 'foo', - hidden: false, - namespaceType: 'single', - mappings: {...} -} -``` - -Example after converting to a multi-namespace (isolated) type in 8.0: - -```ts -{ - name: 'foo', - hidden: false, - namespaceType: 'multiple-isolated', - mappings: {...}, - convertToMultiNamespaceTypeVersion: '8.0.0' -} -``` - -Example after converting to a multi-namespace (shareable) type in 8.1: - -```ts -{ - name: 'foo', - hidden: false, - namespaceType: 'multiple', - mappings: {...}, - convertToMultiNamespaceTypeVersion: '8.0.0' -} -``` - -Note: migration function(s) can be optionally specified for any of these versions and will not interfere with the conversion process. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:305 - -___ - -### excludeOnUpgrade - -• `Optional` **excludeOnUpgrade**: [`SavedObjectTypeExcludeFromUpgradeFilterHook`](../modules/client._internal_namespace.md#savedobjecttypeexcludefromupgradefilterhook) - -If defined, allows a type to exclude unneeded documents from the migration process and effectively be deleted. -See [SavedObjectTypeExcludeFromUpgradeFilterHook](../modules/client._internal_namespace.md#savedobjecttypeexcludefromupgradefilterhook) for more details. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:240 - -___ - -### hidden - -• **hidden**: `boolean` - -Is the type hidden by default. If true, repositories will not have access to this type unless explicitly -declared as an `extraType` when creating the repository. - -See {@link SavedObjectsServiceStart.createInternalRepository | createInternalRepository}. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:223 - -___ - -### indexPattern - -• `Optional` **indexPattern**: `string` - -If defined, the type instances will be stored in the given index instead of the default one. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:231 - -___ - -### management - -• `Optional` **management**: [`SavedObjectsTypeManagementDefinition`](client._internal_namespace.SavedObjectsTypeManagementDefinition.md)<`Attributes`\> - -An optional [saved objects management section](client._internal_namespace.SavedObjectsTypeManagementDefinition.md) definition for the type. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:309 - -___ - -### mappings - -• **mappings**: [`SavedObjectsTypeMappingDefinition`](client._internal_namespace.SavedObjectsTypeMappingDefinition.md) - -The [mapping definition](client._internal_namespace.SavedObjectsTypeMappingDefinition.md) for the type. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:244 - -___ - -### migrations - -• `Optional` **migrations**: [`SavedObjectMigrationMap`](client._internal_namespace.SavedObjectMigrationMap.md) \| () => [`SavedObjectMigrationMap`](client._internal_namespace.SavedObjectMigrationMap.md) - -An optional map of [migrations](../modules/client._internal_namespace.md#savedobjectmigrationfn) or a function returning a map of [migrations](../modules/client._internal_namespace.md#savedobjectmigrationfn) to be used to migrate the type. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:248 - -___ - -### name - -• **name**: `string` - -The name of the type, which is also used as the internal id. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:216 - -___ - -### namespaceType - -• **namespaceType**: [`SavedObjectsNamespaceType`](../modules/client._internal_namespace.md#savedobjectsnamespacetype) - -The [namespace type](../modules/client._internal_namespace.md#savedobjectsnamespacetype) for the type. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:227 - -___ - -### schemas - -• `Optional` **schemas**: [`SavedObjectsValidationMap`](client._internal_namespace.SavedObjectsValidationMap.md) \| () => [`SavedObjectsValidationMap`](client._internal_namespace.SavedObjectsValidationMap.md) - -An optional schema that can be used to validate the attributes of the type. - -When provided, calls to [create](../classes/client._internal_namespace.SavedObjectsClient.md#create) will be validated against this schema. - -See [SavedObjectsValidationMap](client._internal_namespace.SavedObjectsValidationMap.md) for more details. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:256 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsTypeManagementDefinition.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsTypeManagementDefinition.md deleted file mode 100644 index 4c9f9b9342215..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsTypeManagementDefinition.md +++ /dev/null @@ -1,299 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsTypeManagementDefinition - -# Interface: SavedObjectsTypeManagementDefinition - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsTypeManagementDefinition - -Configuration options for the [type](client._internal_namespace.SavedObjectsType.md)'s management section. - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Attributes` | `any` | - -## Table of contents - -### Properties - -- [defaultSearchField](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#defaultsearchfield) -- [displayName](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#displayname) -- [icon](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#icon) -- [importableAndExportable](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#importableandexportable) -- [isExportable](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#isexportable) -- [onExport](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#onexport) -- [onImport](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#onimport) -- [visibleInManagement](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#visibleinmanagement) - -### Methods - -- [getEditUrl](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#getediturl) -- [getInAppUrl](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#getinappurl) -- [getTitle](client._internal_namespace.SavedObjectsTypeManagementDefinition.md#gettitle) - -## Properties - -### defaultSearchField - -• `Optional` **defaultSearchField**: `string` - -The default search field to use for this type. Defaults to `id`. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:337 - -___ - -### displayName - -• `Optional` **displayName**: `string` - -When specified, will be used instead of the type's name in SO management section's labels. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:324 - -___ - -### icon - -• `Optional` **icon**: `string` - -The eui icon name to display in the management table. -If not defined, the default icon will be used. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:342 - -___ - -### importableAndExportable - -• `Optional` **importableAndExportable**: `boolean` - -Is the type importable or exportable. Defaults to `false`. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:320 - -___ - -### isExportable - -• `Optional` **isExportable**: [`SavedObjectsExportablePredicate`](../modules/client._internal_namespace.md#savedobjectsexportablepredicate)<`Attributes`\> - -Optional hook to specify whether an object should be exportable. - -If specified, `isExportable` will be called during export for each -of this type's objects in the export, and the ones not matching the -predicate will be excluded from the export. - -When implementing both `isExportable` and `onExport`, it is mandatory that -`isExportable` returns the same value for an object before and after going -though the export transform. -E.g `isExportable(objectBeforeTransform) === isExportable(objectAfterTransform)` - -**`example`** -Registering a type with a per-object exportability predicate -```ts -// src/plugins/my_plugin/server/plugin.ts -import { myType } from './saved_objects'; - -export class Plugin() { - setup: (core: CoreSetup) => { - core.savedObjects.registerType({ - ...myType, - management: { - ...myType.management, - isExportable: (object) => { - if (object.attributes.myCustomAttr === 'foo') { - return false; - } - return true; - } - }, - }); - } -} -``` - -**`remarks`** `importableAndExportable` must be `true` to specify this property. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:462 - -___ - -### onExport - -• `Optional` **onExport**: [`SavedObjectsExportTransform`](../modules/client._internal_namespace.md#savedobjectsexporttransform)<`Attributes`\> - -An optional export transform function that can be used transform the objects of the registered type during -the export process. - -It can be used to either mutate the exported objects, or add additional objects (of any type) to the export list. - -See [the transform type documentation](../modules/client._internal_namespace.md#savedobjectsexporttransform) for more info and examples. - -When implementing both `isExportable` and `onExport`, it is mandatory that -`isExportable` returns the same value for an object before and after going -though the export transform. -E.g `isExportable(objectBeforeTransform) === isExportable(objectAfterTransform)` - -**`remarks`** `importableAndExportable` must be `true` to specify this property. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:380 - -___ - -### onImport - -• `Optional` **onImport**: [`SavedObjectsImportHook`](../modules/client._internal_namespace.md#savedobjectsimporthook)<`Attributes`\> - -An optional [import hook](../modules/client._internal_namespace.md#savedobjectsimporthook) to use when importing given type. - -Import hooks are executed during the savedObjects import process and allow to interact -with the imported objects. See the [hook documentation](../modules/client._internal_namespace.md#savedobjectsimporthook) -for more info. - -**`example`** -Registering a hook displaying a warning about a specific type of object -```ts -// src/plugins/my_plugin/server/plugin.ts -import { myType } from './saved_objects'; - -export class Plugin() { - setup: (core: CoreSetup) => { - core.savedObjects.registerType({ - ...myType, - management: { - ...myType.management, - onImport: (objects) => { - if(someActionIsNeeded(objects)) { - return { - warnings: [ - { - type: 'action_required', - message: 'Objects need to be manually enabled after import', - actionPath: '/app/my-app/require-activation', - }, - ] - } - } - return {}; - } - }, - }); - } -} -``` - -**`remarks`** messages returned in the warnings are user facing and must be translated. - -**`remarks`** `importableAndExportable` must be `true` to specify this property. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:423 - -___ - -### visibleInManagement - -• `Optional` **visibleInManagement**: `boolean` - -When set to false, the type will not be listed or searchable in the SO management section. -Main usage of setting this property to false for a type is when objects from the type should -be included in the export via references or export hooks, but should not directly appear in the SOM. -Defaults to `true`. - -**`remarks`** `importableAndExportable` must be `true` to specify this property. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:333 - -## Methods - -### getEditUrl - -▸ `Optional` **getEditUrl**(`savedObject`): `string` - -Function returning the url to use to redirect to the editing page of this object. -If not defined, editing will not be allowed. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `savedObject` | [`SavedObject`](client._internal_namespace.SavedObject.md)<`Attributes`\> | - -#### Returns - -`string` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:352 - -___ - -### getInAppUrl - -▸ `Optional` **getInAppUrl**(`savedObject`): `Object` - -Function returning the url to use to redirect to this object from the management section. -If not defined, redirecting to the object will not be allowed. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `savedObject` | [`SavedObject`](client._internal_namespace.SavedObject.md)<`Attributes`\> | - -#### Returns - -`Object` - -an object containing a `path` and `uiCapabilitiesPath` properties. the `path` is the path to - the object page, relative to the base path. `uiCapabilitiesPath` is the path to check in the - [uiCapabilities](client._internal_namespace.Capabilities.md) to check if the user has permission to access the object. - -| Name | Type | -| :------ | :------ | -| `path` | `string` | -| `uiCapabilitiesPath` | `string` | - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:361 - -___ - -### getTitle - -▸ `Optional` **getTitle**(`savedObject`): `string` - -Function returning the title to display in the management table. -If not defined, will use the object's type and id to generate a label. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `savedObject` | [`SavedObject`](client._internal_namespace.SavedObject.md)<`Attributes`\> | - -#### Returns - -`string` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:347 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsTypeMappingDefinition.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsTypeMappingDefinition.md deleted file mode 100644 index 4ebbf456a0556..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsTypeMappingDefinition.md +++ /dev/null @@ -1,62 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsTypeMappingDefinition - -# Interface: SavedObjectsTypeMappingDefinition - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsTypeMappingDefinition - -Describe a saved object type mapping. - -**`example`** -```ts -const typeDefinition: SavedObjectsTypeMappingDefinition = { - properties: { - enabled: { - type: "boolean" - }, - sendUsageFrom: { - ignore_above: 256, - type: "keyword" - }, - lastReported: { - type: "date" - }, - lastVersionChecked: { - ignore_above: 256, - type: "keyword" - }, - } -} -``` - -## Table of contents - -### Properties - -- [dynamic](client._internal_namespace.SavedObjectsTypeMappingDefinition.md#dynamic) -- [properties](client._internal_namespace.SavedObjectsTypeMappingDefinition.md#properties) - -## Properties - -### dynamic - -• `Optional` **dynamic**: ``false`` \| ``"strict"`` - -The dynamic property of the mapping, either `false` or `'strict'`. If -unspecified `dynamic: 'strict'` will be inherited from the top-level -index mappings. - -#### Defined in - -src/core/target/types/server/saved_objects/mappings/types.d.ts:33 - -___ - -### properties - -• **properties**: [`SavedObjectsMappingProperties`](client._internal_namespace.SavedObjectsMappingProperties.md) - -The underlying properties of the type mapping - -#### Defined in - -src/core/target/types/server/saved_objects/mappings/types.d.ts:35 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md deleted file mode 100644 index 5f5243a72ad69..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md +++ /dev/null @@ -1,68 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsUpdateObjectsSpacesObject - -# Interface: SavedObjectsUpdateObjectsSpacesObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsUpdateObjectsSpacesObject - -An object that should have its spaces updated. - -## Table of contents - -### Properties - -- [id](client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md#id) -- [spaces](client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md#spaces) -- [type](client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md#type) -- [version](client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md#version) - -## Properties - -### id - -• **id**: `string` - -The type of the object to update - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:14 - -___ - -### spaces - -• `Optional` **spaces**: `string`[] - -The space(s) that the object to update currently exists in. This is only intended to be used by SOC wrappers. - -**`internal`** - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:22 - -___ - -### type - -• **type**: `string` - -The ID of the object to update - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:16 - -___ - -### version - -• `Optional` **version**: `string` - -The version of the object to update; this is used for optimistic concurrency control. This is only intended to be used by SOC wrappers. - -**`internal`** - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:28 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md deleted file mode 100644 index 403680115772c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md +++ /dev/null @@ -1,48 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsUpdateObjectsSpacesOptions - -# Interface: SavedObjectsUpdateObjectsSpacesOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsUpdateObjectsSpacesOptions - -Options for the update operation. - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsUpdateObjectsSpacesOptions`** - -## Table of contents - -### Properties - -- [namespace](client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md#namespace) -- [refresh](client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md#refresh) - -## Properties - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### refresh - -• `Optional` **refresh**: [`MutatingOperationRefreshSetting`](../modules/client._internal_namespace.md#mutatingoperationrefreshsetting) - -The Elasticsearch Refresh setting for this operation - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:37 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md deleted file mode 100644 index 204b50f484657..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md +++ /dev/null @@ -1,23 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsUpdateObjectsSpacesResponse - -# Interface: SavedObjectsUpdateObjectsSpacesResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsUpdateObjectsSpacesResponse - -The response when objects' spaces are updated. - -## Table of contents - -### Properties - -- [objects](client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md#objects) - -## Properties - -### objects - -• **objects**: [`SavedObjectsUpdateObjectsSpacesResponseObject`](client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md)[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:45 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md deleted file mode 100644 index f529bdcf9344b..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md +++ /dev/null @@ -1,64 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsUpdateObjectsSpacesResponseObject - -# Interface: SavedObjectsUpdateObjectsSpacesResponseObject - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsUpdateObjectsSpacesResponseObject - -Details about a specific object's update result. - -## Table of contents - -### Properties - -- [error](client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md#error) -- [id](client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md#id) -- [spaces](client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md#spaces) -- [type](client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md#type) - -## Properties - -### error - -• `Optional` **error**: [`SavedObjectError`](client._internal_namespace.SavedObjectError.md) - -Included if there was an error updating this object's spaces - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:60 - -___ - -### id - -• **id**: `string` - -The ID of the referenced object - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:56 - -___ - -### spaces - -• **spaces**: `string`[] - -The space(s) that the referenced object exists in - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:58 - -___ - -### type - -• **type**: `string` - -The type of the referenced object - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/update_objects_spaces.d.ts:54 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateOptions.md deleted file mode 100644 index 0c7500b08b2fe..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateOptions.md +++ /dev/null @@ -1,91 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsUpdateOptions - -# Interface: SavedObjectsUpdateOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsUpdateOptions - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `Attributes` | `unknown` | - -## Hierarchy - -- [`SavedObjectsBaseOptions`](client._internal_namespace.SavedObjectsBaseOptions.md) - - ↳ **`SavedObjectsUpdateOptions`** - -## Table of contents - -### Properties - -- [namespace](client._internal_namespace.SavedObjectsUpdateOptions.md#namespace) -- [references](client._internal_namespace.SavedObjectsUpdateOptions.md#references) -- [refresh](client._internal_namespace.SavedObjectsUpdateOptions.md#refresh) -- [upsert](client._internal_namespace.SavedObjectsUpdateOptions.md#upsert) -- [version](client._internal_namespace.SavedObjectsUpdateOptions.md#version) - -## Properties - -### namespace - -• `Optional` **namespace**: `string` - -Specify the namespace for this operation - -#### Inherited from - -[SavedObjectsBaseOptions](client._internal_namespace.SavedObjectsBaseOptions.md).[namespace](client._internal_namespace.SavedObjectsBaseOptions.md#namespace) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:126 - -___ - -### references - -• `Optional` **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -{@inheritdoc SavedObjectReference} - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:191 - -___ - -### refresh - -• `Optional` **refresh**: [`MutatingOperationRefreshSetting`](../modules/client._internal_namespace.md#mutatingoperationrefreshsetting) - -The Elasticsearch Refresh setting for this operation - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:193 - -___ - -### upsert - -• `Optional` **upsert**: `Attributes` - -If specified, will be used to perform an upsert if the document doesn't exist - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:195 - -___ - -### version - -• `Optional` **version**: `string` - -An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:189 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md deleted file mode 100644 index 2fa6a0e54a556..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md +++ /dev/null @@ -1,199 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsUpdateResponse - -# Interface: SavedObjectsUpdateResponse - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsUpdateResponse - -## Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -## Hierarchy - -- `Omit`<[`SavedObject`](client._internal_namespace.SavedObject.md)<`T`\>, ``"attributes"`` \| ``"references"``\> - - ↳ **`SavedObjectsUpdateResponse`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.SavedObjectsUpdateResponse.md#attributes) -- [coreMigrationVersion](client._internal_namespace.SavedObjectsUpdateResponse.md#coremigrationversion) -- [error](client._internal_namespace.SavedObjectsUpdateResponse.md#error) -- [id](client._internal_namespace.SavedObjectsUpdateResponse.md#id) -- [migrationVersion](client._internal_namespace.SavedObjectsUpdateResponse.md#migrationversion) -- [namespaces](client._internal_namespace.SavedObjectsUpdateResponse.md#namespaces) -- [originId](client._internal_namespace.SavedObjectsUpdateResponse.md#originid) -- [references](client._internal_namespace.SavedObjectsUpdateResponse.md#references) -- [type](client._internal_namespace.SavedObjectsUpdateResponse.md#type) -- [updated\_at](client._internal_namespace.SavedObjectsUpdateResponse.md#updated_at) -- [version](client._internal_namespace.SavedObjectsUpdateResponse.md#version) - -## Properties - -### attributes - -• **attributes**: `Partial`<`T`\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:271 - -___ - -### coreMigrationVersion - -• `Optional` **coreMigrationVersion**: `string` - -A semver value that is used when upgrading objects between Kibana versions. - -#### Inherited from - -Omit.coreMigrationVersion - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:67 - -___ - -### error - -• `Optional` **error**: [`SavedObjectError`](client._internal_namespace.SavedObjectError.md) - -#### Inherited from - -Omit.error - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:59 - -___ - -### id - -• **id**: `string` - -The ID of this Saved Object, guaranteed to be unique for all objects of the same `type` - -#### Inherited from - -Omit.id - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:52 - -___ - -### migrationVersion - -• `Optional` **migrationVersion**: [`SavedObjectsMigrationVersion`](client._internal_namespace.SavedObjectsMigrationVersion.md) - -{@inheritdoc SavedObjectsMigrationVersion} - -#### Inherited from - -Omit.migrationVersion - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:65 - -___ - -### namespaces - -• `Optional` **namespaces**: `string`[] - -Space(s) that this saved object exists in. This attribute is not used for "global" saved object types which are registered with -`namespaceType: 'agnostic'`. - -#### Inherited from - -Omit.namespaces - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:72 - -___ - -### originId - -• `Optional` **originId**: `string` - -The ID of the saved object this originated from. This is set if this object's `id` was regenerated; that can happen during migration -from a legacy single-namespace type, or during import. It is only set during migration or create operations. This is used during import -to ensure that ID regeneration is deterministic, so saved objects will be overwritten if they are imported multiple times into a given -space. - -#### Inherited from - -Omit.originId - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:79 - -___ - -### references - -• **references**: `undefined` \| [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -src/core/target/types/server/saved_objects/service/saved_objects_client.d.ts:272 - -___ - -### type - -• **type**: `string` - -The type of Saved Object. Each plugin can define it's own custom Saved Object types. - -#### Inherited from - -Omit.type - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:54 - -___ - -### updated\_at - -• `Optional` **updated\_at**: `string` - -Timestamp of the last time this document had been updated. - -#### Inherited from - -Omit.updated\_at - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:58 - -___ - -### version - -• `Optional` **version**: `string` - -An opaque version number which changes on each successful write operation. Can be used for implementing optimistic concurrency control. - -#### Inherited from - -Omit.version - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:56 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsValidationMap.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsValidationMap.md deleted file mode 100644 index 366dc9fe0a476..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SavedObjectsValidationMap.md +++ /dev/null @@ -1,34 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SavedObjectsValidationMap - -# Interface: SavedObjectsValidationMap - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SavedObjectsValidationMap - -A map of [validation specs](../modules/client._internal_namespace.md#savedobjectsvalidationspec) to be used for a given type. -The map's keys must be valid semver versions. - -Any time you change the schema of a [SavedObjectsType](client._internal_namespace.SavedObjectsType.md), you should add a new entry -to this map for the Kibana version the change was introduced in. - -**`example`** -```typescript -const validationMap: SavedObjectsValidationMap = { - '1.0.0': schema.object({ - foo: schema.string(), - }), - '2.0.0': schema.object({ - foo: schema.string({ - minLength: 2, - validate(value) { - if (!/^[a-z]+$/.test(value)) { - return 'must be lowercase letters only'; - } - } - }), - }), -} -``` - -## Indexable - -▪ [version: `string`]: [`SavedObjectsValidationSpec`](../modules/client._internal_namespace.md#savedobjectsvalidationspec) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Services.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Services.md deleted file mode 100644 index 3a770aca3f595..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Services.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Services - -# Interface: Services - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Services - -## Table of contents - -### Properties - -- [connectorTokenClient](client._internal_namespace.Services.md#connectortokenclient) -- [savedObjectsClient](client._internal_namespace.Services.md#savedobjectsclient) -- [scopedClusterClient](client._internal_namespace.Services.md#scopedclusterclient) - -## Properties - -### connectorTokenClient - -• **connectorTokenClient**: [`ConnectorTokenClient`](../classes/client._internal_namespace.ConnectorTokenClient.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:26 - -___ - -### savedObjectsClient - -• **savedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:24 - -___ - -### scopedClusterClient - -• **scopedClusterClient**: [`ElasticsearchClient`](../modules/client._internal_namespace.md#elasticsearchclient) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:25 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Space.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Space.md deleted file mode 100644 index 018efefd6f456..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Space.md +++ /dev/null @@ -1,131 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Space - -# Interface: Space - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Space - -A Space. - -## Hierarchy - -- **`Space`** - - ↳ [`GetSpaceResult`](client._internal_namespace.GetSpaceResult.md) - -## Table of contents - -### Properties - -- [\_reserved](client._internal_namespace.Space.md#_reserved) -- [color](client._internal_namespace.Space.md#color) -- [description](client._internal_namespace.Space.md#description) -- [disabledFeatures](client._internal_namespace.Space.md#disabledfeatures) -- [id](client._internal_namespace.Space.md#id) -- [imageUrl](client._internal_namespace.Space.md#imageurl) -- [initials](client._internal_namespace.Space.md#initials) -- [name](client._internal_namespace.Space.md#name) - -## Properties - -### \_reserved - -• `Optional` `Private` **\_reserved**: `boolean` - -Indicates that this space is reserved (system controlled). -Reserved spaces cannot be created or deleted by end-users. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:46 - -___ - -### color - -• `Optional` **color**: `string` - -Optional color (hex code) for this space. -If neither `color` nor `imageUrl` is specified, then a color will be automatically generated. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:24 - -___ - -### description - -• `Optional` **description**: `string` - -Optional description for this space. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:19 - -___ - -### disabledFeatures - -• **disabledFeatures**: `string`[] - -The set of feature ids that should be hidden within this space. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:40 - -___ - -### id - -• **id**: `string` - -The unique identifier for this space. -The id becomes part of the "URL Identifier" of the space. - -Example: an id of `marketing` would result in the URL identifier of `/s/marketing`. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:11 - -___ - -### imageUrl - -• `Optional` **imageUrl**: `string` - -Optional base-64 encoded data image url to show as this space's avatar. -This setting takes precedence over any configured `color` or `initials`. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:36 - -___ - -### initials - -• `Optional` **initials**: `string` - -Optional display initials for this space's avatar. Supports a maximum of 2 characters. -If initials are not provided, then they will be derived from the space name automatically. - -Initials are not displayed if an `imageUrl` has been specified. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:31 - -___ - -### name - -• **name**: `string` - -Display name for this space. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:15 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SpacesServiceStart.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SpacesServiceStart.md deleted file mode 100644 index 5dd67943c579f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SpacesServiceStart.md +++ /dev/null @@ -1,150 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SpacesServiceStart - -# Interface: SpacesServiceStart - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SpacesServiceStart - -The Spaces service start contract. - -## Table of contents - -### Methods - -- [createSpacesClient](client._internal_namespace.SpacesServiceStart.md#createspacesclient) -- [getActiveSpace](client._internal_namespace.SpacesServiceStart.md#getactivespace) -- [getSpaceId](client._internal_namespace.SpacesServiceStart.md#getspaceid) -- [isInDefaultSpace](client._internal_namespace.SpacesServiceStart.md#isindefaultspace) -- [namespaceToSpaceId](client._internal_namespace.SpacesServiceStart.md#namespacetospaceid) -- [spaceIdToNamespace](client._internal_namespace.SpacesServiceStart.md#spaceidtonamespace) - -## Methods - -### createSpacesClient - -▸ **createSpacesClient**(`request`): [`ISpacesClient`](client._internal_namespace.ISpacesClient.md) - -Creates a scoped instance of the SpacesClient. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | the request. | - -#### Returns - -[`ISpacesClient`](client._internal_namespace.ISpacesClient.md) - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_service/spaces_service.d.ts:32 - -___ - -### getActiveSpace - -▸ **getActiveSpace**(`request`): `Promise`<[`Space`](client._internal_namespace.Space.md)\> - -Retrieves the Space associated with the provided request. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | the request. | - -#### Returns - -`Promise`<[`Space`](client._internal_namespace.Space.md)\> - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_service/spaces_service.d.ts:47 - -___ - -### getSpaceId - -▸ **getSpaceId**(`request`): `string` - -Retrieves the space id associated with the provided request. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | the request. | - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_service/spaces_service.d.ts:37 - -___ - -### isInDefaultSpace - -▸ **isInDefaultSpace**(`request`): `boolean` - -Indicates if the provided request is executing within the context of the `default` space. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | the request. | - -#### Returns - -`boolean` - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_service/spaces_service.d.ts:42 - -___ - -### namespaceToSpaceId - -▸ **namespaceToSpaceId**(`namespace`): `string` - -Converts the provided namespace into the corresponding space id. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `namespace` | `undefined` \| `string` | the namespace to convert. | - -#### Returns - -`string` - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_service/spaces_service.d.ts:57 - -___ - -### spaceIdToNamespace - -▸ **spaceIdToNamespace**(`spaceId`): `undefined` \| `string` - -Converts the provided space id into the corresponding Saved Objects `namespace` id. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `spaceId` | `string` | the space id to convert. | - -#### Returns - -`undefined` \| `string` - -#### Defined in - -x-pack/plugins/spaces/target/types/server/spaces_service/spaces_service.d.ts:52 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeatureConfig.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeatureConfig.md deleted file mode 100644 index adfb11e4efd7d..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeatureConfig.md +++ /dev/null @@ -1,38 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SubFeatureConfig - -# Interface: SubFeatureConfig - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SubFeatureConfig - -Configuration for a sub-feature. - -## Table of contents - -### Properties - -- [name](client._internal_namespace.SubFeatureConfig.md#name) -- [privilegeGroups](client._internal_namespace.SubFeatureConfig.md#privilegegroups) - -## Properties - -### name - -• **name**: `string` - -Display name for this sub-feature - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:9 - -___ - -### privilegeGroups - -• **privilegeGroups**: readonly [`SubFeaturePrivilegeGroupConfig`](client._internal_namespace.SubFeaturePrivilegeGroupConfig.md)[] - -Collection of privilege groups - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:11 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeaturePrivilegeConfig.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeaturePrivilegeConfig.md deleted file mode 100644 index 4cbd7bc89efc7..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeaturePrivilegeConfig.md +++ /dev/null @@ -1,334 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SubFeaturePrivilegeConfig - -# Interface: SubFeaturePrivilegeConfig - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SubFeaturePrivilegeConfig - -Configuration for a sub-feature privilege. - -## Hierarchy - -- `Omit`<[`FeatureKibanaPrivileges`](client._internal_namespace.FeatureKibanaPrivileges.md), ``"excludeFromBasePrivileges"``\> - - ↳ **`SubFeaturePrivilegeConfig`** - -## Table of contents - -### Properties - -- [alerting](client._internal_namespace.SubFeaturePrivilegeConfig.md#alerting) -- [api](client._internal_namespace.SubFeaturePrivilegeConfig.md#api) -- [app](client._internal_namespace.SubFeaturePrivilegeConfig.md#app) -- [cases](client._internal_namespace.SubFeaturePrivilegeConfig.md#cases) -- [catalogue](client._internal_namespace.SubFeaturePrivilegeConfig.md#catalogue) -- [disabled](client._internal_namespace.SubFeaturePrivilegeConfig.md#disabled) -- [id](client._internal_namespace.SubFeaturePrivilegeConfig.md#id) -- [includeIn](client._internal_namespace.SubFeaturePrivilegeConfig.md#includein) -- [management](client._internal_namespace.SubFeaturePrivilegeConfig.md#management) -- [minimumLicense](client._internal_namespace.SubFeaturePrivilegeConfig.md#minimumlicense) -- [name](client._internal_namespace.SubFeaturePrivilegeConfig.md#name) -- [requireAllSpaces](client._internal_namespace.SubFeaturePrivilegeConfig.md#requireallspaces) -- [savedObject](client._internal_namespace.SubFeaturePrivilegeConfig.md#savedobject) -- [ui](client._internal_namespace.SubFeaturePrivilegeConfig.md#ui) - -## Properties - -### alerting - -• `Optional` **alerting**: `Object` - -If your feature requires access to specific Alert Types, then specify your access needs here. -Include both Alert Types registered by the feature and external Alert Types such as built-in -Alert Types and Alert Types provided by other features to which you wish to grant access. - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `alert?` | `Object` | -| `alert.all?` | readonly `string`[] | -| `alert.read?` | readonly `string`[] | -| `rule?` | `Object` | -| `rule.all?` | readonly `string`[] | -| `rule.read?` | readonly `string`[] | - -#### Inherited from - -Omit.alerting - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:82 - -___ - -### api - -• `Optional` **api**: readonly `string`[] - -If your feature includes server-side APIs, you can tag those routes to secure access based on user permissions. - -**`example`** -```ts - // Configure your routes with a tag starting with the 'access:' prefix - server.route({ - path: '/api/my-route', - method: 'GET', - handler: () => { ...}, - options: { - tags: ['access:my_feature-admin'] - } - }); - - Then, specify the tags here (without the 'access:' prefix) which should be secured: - - { - api: ['my_feature-admin'] - } -``` - -NOTE: It is important to name your tags in a way that will not collide with other plugins/features. -A generic tag name like "access:read" could be used elsewhere, and access to that API endpoint would also -extend to any routes you have also tagged with that name. - -#### Inherited from - -Omit.api - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:64 - -___ - -### app - -• `Optional` **app**: readonly `string`[] - -If your feature exposes a client-side application (most of them do!), then you can control access to them here. - -**`example`** -```ts - { - app: ['my-app', 'kibana'] - } -``` - -#### Inherited from - -Omit.app - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:76 - -___ - -### cases - -• `Optional` **cases**: `Object` - -If your feature requires access to specific owners of cases (aka plugins that have created cases), then specify your access needs here. The values here should -be unique identifiers for the owners of cases you want access to. - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `all?` | readonly `string`[] | List of case owners which users should have full read/write access to when granted this privilege. **`example`** ```ts { all: ['securitySolution'] } ``` | -| `read?` | readonly `string`[] | List of case owners which users should have read-only access to when granted this privilege. **`example`** ```ts { read: ['securitySolution'] } ``` | - -#### Inherited from - -Omit.cases - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:132 - -___ - -### catalogue - -• `Optional` **catalogue**: readonly `string`[] - -If this feature includes a catalogue entry, you can specify them here to control visibility based on user permissions. - -#### Inherited from - -Omit.catalogue - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:37 - -___ - -### disabled - -• `Optional` **disabled**: `boolean` - -Whether or not this privilege should be hidden in the roles UI and disallowed on the API. Defaults to `false`. - -**`deprecated`** - -#### Inherited from - -Omit.disabled - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:18 - -___ - -### id - -• **id**: `string` - -Identifier for this privilege. Must be unique across all other privileges within a feature. - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:47 - -___ - -### includeIn - -• **includeIn**: ``"all"`` \| ``"none"`` \| ``"read"`` - -Denotes which Primary Feature Privilege this sub-feature privilege should be included in. -`read` is also included in `all` automatically. - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:56 - -___ - -### management - -• `Optional` **management**: `Object` - -If this feature includes management sections, you can specify them here to control visibility of those -pages based on user privileges. - -**`example`** -```ts - // Enables access to the "Advanced Settings" management page within the Kibana section - management: { - kibana: ['settings'] - } -``` - -#### Index signature - -▪ [sectionId: `string`]: readonly `string`[] - -#### Inherited from - -Omit.management - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:31 - -___ - -### minimumLicense - -• `Optional` **minimumLicense**: ``"basic"`` \| ``"standard"`` \| ``"gold"`` \| ``"platinum"`` \| ``"enterprise"`` \| ``"trial"`` - -The minimum supported license level for this sub-feature privilege. -If no license level is supplied, then this privilege will be available for all licences -that are valid for the overall feature. - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:62 - -___ - -### name - -• **name**: `string` - -The display name for this privilege. - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:51 - -___ - -### requireAllSpaces - -• `Optional` **requireAllSpaces**: `boolean` - -Whether or not this privilege should only be granted to `All Spaces *`. Should be used for features that do not -support Spaces. Defaults to `false`. - -#### Inherited from - -Omit.requireAllSpaces - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:13 - -___ - -### savedObject - -• **savedObject**: `Object` - -If your feature requires access to specific saved objects, then specify your access needs here. - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `all` | readonly `string`[] | List of saved object types which users should have full read/write access to when granted this privilege. **`example`** ```ts { all: ['my-saved-object-type'] } ``` | -| `read` | readonly `string`[] | List of saved object types which users should have read-only access to when granted this privilege. **`example`** ```ts { read: ['config'] } ``` | - -#### Inherited from - -Omit.savedObject - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:157 - -___ - -### ui - -• **ui**: readonly `string`[] - -A list of UI Capabilities that should be granted to users with this privilege. -These capabilities will automatically be namespaces within your feature id. - -**`example`** -```ts - { - ui: ['show', 'save'] - } - - This translates in the UI to the following (assuming a feature id of "foo"): - import { uiCapabilities } from 'ui/capabilities'; - - const canShowApp = uiCapabilities.foo.show; - const canSave = uiCapabilities.foo.save; -``` -Note: Since these are automatically namespaced, you are free to use generic names like "show" and "save". - -**`see`** UICapabilities - -#### Inherited from - -Omit.ui - -#### Defined in - -x-pack/plugins/features/target/types/common/feature_kibana_privileges.d.ts:199 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeaturePrivilegeGroupConfig.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeaturePrivilegeGroupConfig.md deleted file mode 100644 index 28dcebc6af10c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.SubFeaturePrivilegeGroupConfig.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / SubFeaturePrivilegeGroupConfig - -# Interface: SubFeaturePrivilegeGroupConfig - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).SubFeaturePrivilegeGroupConfig - -Configuration for a sub-feature privilege group. - -## Table of contents - -### Properties - -- [groupType](client._internal_namespace.SubFeaturePrivilegeGroupConfig.md#grouptype) -- [privileges](client._internal_namespace.SubFeaturePrivilegeGroupConfig.md#privileges) - -## Properties - -### groupType - -• **groupType**: [`SubFeaturePrivilegeGroupType`](../modules/client._internal_namespace.md#subfeatureprivilegegrouptype) - -The type of privilege group. -- `mutually_exclusive`:: - Users will be able to select at most one privilege within this group. - Privileges must be specified in descending order of permissiveness (e.g. `All`, `Read`, not `Read`, `All) -- `independent`:: - Users will be able to select any combination of privileges within this group. - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:34 - -___ - -### privileges - -• **privileges**: readonly [`SubFeaturePrivilegeConfig`](client._internal_namespace.SubFeaturePrivilegeConfig.md)[] - -The privileges which belong to this group. - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:38 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskInfo.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskInfo.md deleted file mode 100644 index 56843b1283c19..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskInfo.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / TaskInfo - -# Interface: TaskInfo - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).TaskInfo - -## Table of contents - -### Properties - -- [attempts](client._internal_namespace.TaskInfo.md#attempts) -- [scheduled](client._internal_namespace.TaskInfo.md#scheduled) - -## Properties - -### attempts - -• **attempts**: `number` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:22 - -___ - -### scheduled - -• **scheduled**: `Date` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:21 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskInstance.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskInstance.md deleted file mode 100644 index 4cea61eafbdb2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskInstance.md +++ /dev/null @@ -1,199 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / TaskInstance - -# Interface: TaskInstance - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).TaskInstance - -## Hierarchy - -- **`TaskInstance`** - - ↳ [`ConcreteTaskInstance`](client._internal_namespace.ConcreteTaskInstance.md) - -## Table of contents - -### Properties - -- [id](client._internal_namespace.TaskInstance.md#id) -- [ownerId](client._internal_namespace.TaskInstance.md#ownerid) -- [params](client._internal_namespace.TaskInstance.md#params) -- [retryAt](client._internal_namespace.TaskInstance.md#retryat) -- [runAt](client._internal_namespace.TaskInstance.md#runat) -- [schedule](client._internal_namespace.TaskInstance.md#schedule) -- [scheduledAt](client._internal_namespace.TaskInstance.md#scheduledat) -- [scope](client._internal_namespace.TaskInstance.md#scope) -- [startedAt](client._internal_namespace.TaskInstance.md#startedat) -- [state](client._internal_namespace.TaskInstance.md#state) -- [taskType](client._internal_namespace.TaskInstance.md#tasktype) -- [traceparent](client._internal_namespace.TaskInstance.md#traceparent) -- [user](client._internal_namespace.TaskInstance.md#user) - -## Properties - -### id - -• `Optional` **id**: `string` - -Optional ID that can be passed by the caller. When ID is undefined, ES -will auto-generate a unique id. Otherwise, ID will be used to either -create a new document, or update existing document - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:145 - -___ - -### ownerId - -• `Optional` **ownerId**: ``null`` \| `string` - -The random uuid of the Kibana instance which claimed ownership of the task last - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:205 - -___ - -### params - -• **params**: `Record`<`string`, `any`\> - -A task-specific set of parameters, used by the task's run function to tailor -its work. This is generally user-input, such as { sms: '333-444-2222' }. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:182 - -___ - -### retryAt - -• `Optional` **retryAt**: ``null`` \| `Date` - -The date and time that this task should re-execute if stuck in "running" / timeout -status. This value is only set when status is set to "running". - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:165 - -___ - -### runAt - -• `Optional` **runAt**: `Date` - -The date and time that this task is scheduled to be run. It is not -guaranteed to run at this time, but it is guaranteed not to run earlier -than this. Defaults to immediately. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:171 - -___ - -### schedule - -• `Optional` **schedule**: [`IntervalSchedule`](client._internal_namespace.IntervalSchedule.md) - -A TaskSchedule string, which specifies this as a recurring task. - -Currently, this supports a single format: an interval in minutes or seconds (e.g. '5m', '30s'). - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:177 - -___ - -### scheduledAt - -• `Optional` **scheduledAt**: `Date` - -The date and time that this task was originally scheduled. This is used -for convenience to task run functions, and for troubleshooting. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:154 - -___ - -### scope - -• `Optional` **scope**: `string`[] - -Used to group tasks for querying. So, reporting might schedule tasks with a scope of 'reporting', -and then query such tasks to provide a glimpse at only reporting tasks, rather than at all tasks. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:201 - -___ - -### startedAt - -• `Optional` **startedAt**: ``null`` \| `Date` - -The date and time that this task started execution. This is used to determine -the "real" runAt that ended up running the task. This value is only set -when status is set to "running". - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:160 - -___ - -### state - -• **state**: `Record`<`string`, `any`\> - -The state passed into the task's run function, and returned by the previous -run. If there was no previous run, or if the previous run did not return -any state, this will be the empy object: {} - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:188 - -___ - -### taskType - -• **taskType**: `string` - -The task definition type whose run function will execute this instance. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:149 - -___ - -### traceparent - -• `Optional` **traceparent**: `string` - -The serialized traceparent string of the current APM transaction or span. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:192 - -___ - -### user - -• `Optional` **user**: `string` - -The id of the user who scheduled this task. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:196 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskManagerSetupContract.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskManagerSetupContract.md deleted file mode 100644 index 15c8f2fe2b91e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskManagerSetupContract.md +++ /dev/null @@ -1,70 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / TaskManagerSetupContract - -# Interface: TaskManagerSetupContract - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).TaskManagerSetupContract - -## Table of contents - -### Properties - -- [index](client._internal_namespace.TaskManagerSetupContract.md#index) - -### Methods - -- [addMiddleware](client._internal_namespace.TaskManagerSetupContract.md#addmiddleware) -- [registerTaskDefinitions](client._internal_namespace.TaskManagerSetupContract.md#registertaskdefinitions) - -## Properties - -### index - -• **index**: `string` - -**`deprecated`** - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/plugin.d.ts:12 - -## Methods - -### addMiddleware - -▸ **addMiddleware**(`middleware`): `void` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `middleware` | [`Middleware`](client._internal_namespace.Middleware.md) | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/plugin.d.ts:13 - -___ - -### registerTaskDefinitions - -▸ **registerTaskDefinitions**(`taskDefinitions`): `void` - -Method for allowing consumers to register task definitions into the system. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `taskDefinitions` | [`TaskDefinitionRegistry`](../modules/client._internal_namespace.md#taskdefinitionregistry) | The Kibana task definitions dictionary | - -#### Returns - -`void` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/plugin.d.ts:18 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskRegisterDefinition.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskRegisterDefinition.md deleted file mode 100644 index f5d534feba600..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskRegisterDefinition.md +++ /dev/null @@ -1,130 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / TaskRegisterDefinition - -# Interface: TaskRegisterDefinition - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).TaskRegisterDefinition - -Defines a task which can be scheduled and run by the Kibana -task manager. - -## Table of contents - -### Properties - -- [createTaskRunner](client._internal_namespace.TaskRegisterDefinition.md#createtaskrunner) -- [description](client._internal_namespace.TaskRegisterDefinition.md#description) -- [maxAttempts](client._internal_namespace.TaskRegisterDefinition.md#maxattempts) -- [maxConcurrency](client._internal_namespace.TaskRegisterDefinition.md#maxconcurrency) -- [timeout](client._internal_namespace.TaskRegisterDefinition.md#timeout) -- [title](client._internal_namespace.TaskRegisterDefinition.md#title) - -### Methods - -- [getRetry](client._internal_namespace.TaskRegisterDefinition.md#getretry) - -## Properties - -### createTaskRunner - -• **createTaskRunner**: [`TaskRunCreatorFunction`](../modules/client._internal_namespace.md#taskruncreatorfunction) - -Creates an object that has a run function which performs the task's work, -and an optional cancel function which cancels the task. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_type_dictionary.d.ts:35 - -___ - -### description - -• `Optional` **description**: `string` - -An optional more detailed description of what this task does. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_type_dictionary.d.ts:22 - -___ - -### maxAttempts - -• `Optional` **maxAttempts**: `number` - -Up to how many times the task should retry when it fails to run. This will -default to the global variable. The default value, if not specified, is 1. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_type_dictionary.d.ts:40 - -___ - -### maxConcurrency - -• `Optional` **maxConcurrency**: `number` - -The maximum number tasks of this type that can be run concurrently per Kibana instance. -Setting this value will force Task Manager to poll for this task type separately from other task types -which can add significant load to the ES cluster, so please use this configuration only when absolutely necessary. -The default value, if not given, is 0. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_type_dictionary.d.ts:47 - -___ - -### timeout - -• `Optional` **timeout**: `string` - -How long, in minutes or seconds, the system should wait for the task to complete -before it is considered to be timed out. (e.g. '5m', the default). If -the task takes longer than this, Kibana will send it a kill command and -the task will be re-attempted. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_type_dictionary.d.ts:18 - -___ - -### title - -• `Optional` **title**: `string` - -A brief, human-friendly title for this task. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_type_dictionary.d.ts:11 - -## Methods - -### getRetry - -▸ `Optional` **getRetry**(`attempts`, `error`): `boolean` \| `Date` - -Function that customizes how the task should behave when the task fails. This -function can return `true`, `false` or a Date. True will tell task manager -to retry using default delay logic. False will tell task manager to stop retrying -this task. Date will suggest when to the task manager the task should retry. -This function isn't used for recurring tasks, those retry as per their configured recurring schedule. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `attempts` | `number` | -| `error` | `object` | - -#### Returns - -`boolean` \| `Date` - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_type_dictionary.d.ts:30 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskRunnerContext.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskRunnerContext.md deleted file mode 100644 index d79cef9c996c1..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TaskRunnerContext.md +++ /dev/null @@ -1,89 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / TaskRunnerContext - -# Interface: TaskRunnerContext - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).TaskRunnerContext - -## Table of contents - -### Properties - -- [actionTypeRegistry](client._internal_namespace.TaskRunnerContext.md#actiontyperegistry) -- [basePathService](client._internal_namespace.TaskRunnerContext.md#basepathservice) -- [encryptedSavedObjectsClient](client._internal_namespace.TaskRunnerContext.md#encryptedsavedobjectsclient) -- [logger](client._internal_namespace.TaskRunnerContext.md#logger) -- [spaceIdToNamespace](client._internal_namespace.TaskRunnerContext.md#spaceidtonamespace) - -### Methods - -- [getUnsecuredSavedObjectsClient](client._internal_namespace.TaskRunnerContext.md#getunsecuredsavedobjectsclient) - -## Properties - -### actionTypeRegistry - -• **actionTypeRegistry**: [`ActionTypeRegistryContract`](../modules/client._internal_namespace.md#actiontyperegistrycontract) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:8 - -___ - -### basePathService - -• **basePathService**: [`IBasePath`](../modules/client._internal_namespace.md#ibasepath) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:11 - -___ - -### encryptedSavedObjectsClient - -• **encryptedSavedObjectsClient**: [`EncryptedSavedObjectsClient`](client._internal_namespace.EncryptedSavedObjectsClient.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:9 - -___ - -### logger - -• **logger**: `Logger` - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:7 - -___ - -### spaceIdToNamespace - -• **spaceIdToNamespace**: [`SpaceIdToNamespaceFunction`](../modules/client._internal_namespace.md#spaceidtonamespacefunction) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:10 - -## Methods - -### getUnsecuredSavedObjectsClient - -▸ **getUnsecuredSavedObjectsClient**(`request`): [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)<`unknown`, `unknown`, `unknown`, `any`\> | - -#### Returns - -[`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/task_runner_factory.d.ts:12 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TranslatedUpdateAlertRequest.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TranslatedUpdateAlertRequest.md deleted file mode 100644 index 0a44beb8592e7..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.TranslatedUpdateAlertRequest.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / TranslatedUpdateAlertRequest - -# Interface: TranslatedUpdateAlertRequest - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).TranslatedUpdateAlertRequest - -## Table of contents - -### Properties - -- [id](client._internal_namespace.TranslatedUpdateAlertRequest.md#id) -- [index](client._internal_namespace.TranslatedUpdateAlertRequest.md#index) -- [status](client._internal_namespace.TranslatedUpdateAlertRequest.md#status) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:208](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L208) - -___ - -### index - -• **index**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:209](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L209) - -___ - -### status - -• **status**: `STATUS_VALUES` - -#### Defined in - -[x-pack/plugins/cases/server/services/alerts/index.ts:210](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/alerts/index.ts#L210) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateAlertRequest.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateAlertRequest.md deleted file mode 100644 index 53ee404bbf12a..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateAlertRequest.md +++ /dev/null @@ -1,45 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / UpdateAlertRequest - -# Interface: UpdateAlertRequest - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).UpdateAlertRequest - -Defines the fields necessary to update an alert's status. - -## Table of contents - -### Properties - -- [id](client._internal_namespace.UpdateAlertRequest.md#id) -- [index](client._internal_namespace.UpdateAlertRequest.md#index) -- [status](client._internal_namespace.UpdateAlertRequest.md#status) - -## Properties - -### id - -• **id**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/client/alerts/types.ts:28](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/alerts/types.ts#L28) - -___ - -### index - -• **index**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/client/alerts/types.ts:29](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/alerts/types.ts#L29) - -___ - -### status - -• **status**: [`CaseStatuses`](../enums/client._internal_namespace.CaseStatuses.md) - -#### Defined in - -[x-pack/plugins/cases/server/client/alerts/types.ts:30](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/alerts/types.ts#L30) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateArgs.md deleted file mode 100644 index c0f6cf3d0d1a2..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateArgs.md +++ /dev/null @@ -1,43 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / UpdateArgs - -# Interface: UpdateArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).UpdateArgs - -## Table of contents - -### Properties - -- [attachmentId](client._internal_namespace.UpdateArgs.md#attachmentid) -- [options](client._internal_namespace.UpdateArgs.md#options) -- [updatedAttributes](client._internal_namespace.UpdateArgs.md#updatedattributes) - -## Properties - -### attachmentId - -• **attachmentId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:54](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L54) - -___ - -### options - -• `Optional` **options**: [`SavedObjectsUpdateOptions`](client._internal_namespace.SavedObjectsUpdateOptions.md)<{ `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } \| { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } }\> - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:56](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L56) - -___ - -### updatedAttributes - -• **updatedAttributes**: { `created_at`: `undefined` \| `string` = rt.string; `created_by`: `undefined` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } = UserRT; `owner`: `undefined` \| `string` = rt.string; `pushed_at`: `undefined` \| ``null`` \| `string` ; `pushed_by`: `undefined` \| ``null`` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } ; `updated_at`: `undefined` \| ``null`` \| `string` ; `updated_by`: `undefined` \| ``null`` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } } & { `alertId`: `undefined` \| `string` \| `string`[] ; `index`: `undefined` \| `string` \| `string`[] ; `owner`: `undefined` \| `string` = rt.string; `rule`: `undefined` \| { `id`: ``null`` \| `string` ; `name`: ``null`` \| `string` } ; `type`: `undefined` \| [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `undefined` \| `string` = rt.string; `created_by`: `undefined` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } = UserRT; `owner`: `undefined` \| `string` = rt.string; `pushed_at`: `undefined` \| ``null`` \| `string` ; `pushed_by`: `undefined` \| ``null`` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } ; `updated_at`: `undefined` \| ``null`` \| `string` ; `updated_by`: `undefined` \| ``null`` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } } - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:55](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L55) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateConnectorMappingsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateConnectorMappingsArgs.md deleted file mode 100644 index 4af6344e575d6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateConnectorMappingsArgs.md +++ /dev/null @@ -1,64 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / UpdateConnectorMappingsArgs - -# Interface: UpdateConnectorMappingsArgs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).UpdateConnectorMappingsArgs - -## Hierarchy - -- [`ClientArgs`](client._internal_namespace.ClientArgs-2.md) - - ↳ **`UpdateConnectorMappingsArgs`** - -## Table of contents - -### Properties - -- [attributes](client._internal_namespace.UpdateConnectorMappingsArgs.md#attributes) -- [mappingId](client._internal_namespace.UpdateConnectorMappingsArgs.md#mappingid) -- [references](client._internal_namespace.UpdateConnectorMappingsArgs.md#references) -- [unsecuredSavedObjectsClient](client._internal_namespace.UpdateConnectorMappingsArgs.md#unsecuredsavedobjectsclient) - -## Properties - -### attributes - -• **attributes**: `Partial`<{ `mappings`: { action\_type: "append" \| "nothing" \| "overwrite"; source: "description" \| "title" \| "comments"; target: string; }[] ; `owner`: `string` = rt.string }\> - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:28](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L28) - -___ - -### mappingId - -• **mappingId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:27](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L27) - -___ - -### references - -• **references**: [`SavedObjectReference`](client._internal_namespace.SavedObjectReference.md)[] - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:29](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L29) - -___ - -### unsecuredSavedObjectsClient - -• **unsecuredSavedObjectsClient**: [`SavedObjectsClientContract`](../modules/client._internal_namespace.md#savedobjectsclientcontract) - -#### Inherited from - -[ClientArgs](client._internal_namespace.ClientArgs-2.md).[unsecuredSavedObjectsClient](client._internal_namespace.ClientArgs-2.md#unsecuredsavedobjectsclient) - -#### Defined in - -[x-pack/plugins/cases/server/services/connector_mappings/index.ts:15](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/connector_mappings/index.ts#L15) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateOptions-1.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateOptions-1.md deleted file mode 100644 index cd8125ed13bf5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateOptions-1.md +++ /dev/null @@ -1,54 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / UpdateOptions - -# Interface: UpdateOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).UpdateOptions - -## Table of contents - -### Properties - -- [expiresAtMillis](client._internal_namespace.UpdateOptions-1.md#expiresatmillis) -- [id](client._internal_namespace.UpdateOptions-1.md#id) -- [token](client._internal_namespace.UpdateOptions-1.md#token) -- [tokenType](client._internal_namespace.UpdateOptions-1.md#tokentype) - -## Properties - -### expiresAtMillis - -• **expiresAtMillis**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:19 - -___ - -### id - -• **id**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:17 - -___ - -### token - -• **token**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:18 - -___ - -### tokenType - -• `Optional` **tokenType**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/builtin_action_types/lib/connector_token_client.d.ts:20 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateOptions.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateOptions.md deleted file mode 100644 index f1bc374522175..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UpdateOptions.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / UpdateOptions - -# Interface: UpdateOptions - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).UpdateOptions - -## Table of contents - -### Properties - -- [action](client._internal_namespace.UpdateOptions.md#action) -- [id](client._internal_namespace.UpdateOptions.md#id) - -## Properties - -### action - -• **action**: [`ActionUpdate`](client._internal_namespace.ActionUpdate.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:41 - -___ - -### id - -• **id**: `string` - -#### Defined in - -x-pack/plugins/actions/target/types/server/actions_client.d.ts:40 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.User.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.User.md deleted file mode 100644 index 947805536297f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.User.md +++ /dev/null @@ -1,90 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / User - -# Interface: User - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).User - -## Hierarchy - -- **`User`** - - ↳ [`AuthenticatedUser`](client._internal_namespace.AuthenticatedUser.md) - -## Table of contents - -### Properties - -- [email](client._internal_namespace.User.md#email) -- [enabled](client._internal_namespace.User.md#enabled) -- [full\_name](client._internal_namespace.User.md#full_name) -- [metadata](client._internal_namespace.User.md#metadata) -- [roles](client._internal_namespace.User.md#roles) -- [username](client._internal_namespace.User.md#username) - -## Properties - -### email - -• `Optional` **email**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:3 - -___ - -### enabled - -• **enabled**: `boolean` - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:6 - -___ - -### full\_name - -• `Optional` **full\_name**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:4 - -___ - -### metadata - -• `Optional` **metadata**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `_deprecated?` | `boolean` | -| `_deprecated_reason?` | `string` | -| `_reserved` | `boolean` | - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:7 - -___ - -### roles - -• **roles**: readonly `string`[] - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:5 - -___ - -### username - -• **username**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/common/model/user.d.ts:2 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UserRealm.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UserRealm.md deleted file mode 100644 index 2d1d75692a0e0..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.UserRealm.md +++ /dev/null @@ -1,32 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / UserRealm - -# Interface: UserRealm - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).UserRealm - -## Table of contents - -### Properties - -- [name](client._internal_namespace.UserRealm.md#name) -- [type](client._internal_namespace.UserRealm.md#type) - -## Properties - -### name - -• **name**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/common/model/authenticated_user.d.ts:4 - -___ - -### type - -• **type**: `string` - -#### Defined in - -x-pack/plugins/security/target/types/common/model/authenticated_user.d.ts:5 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ValidatorType.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ValidatorType.md deleted file mode 100644 index c771a20cde115..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.ValidatorType.md +++ /dev/null @@ -1,37 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / ValidatorType - -# Interface: ValidatorType - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).ValidatorType - -## Type parameters - -| Name | -| :------ | -| `Type` | - -## Table of contents - -### Methods - -- [validate](client._internal_namespace.ValidatorType.md#validate) - -## Methods - -### validate - -▸ **validate**(`value`): `Type` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `value` | `unknown` | - -#### Returns - -`Type` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:64 diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Verbs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Verbs.md deleted file mode 100644 index 6234a71241e99..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/client._internal_namespace.Verbs.md +++ /dev/null @@ -1,45 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](../modules/client.md) / [\_internal\_namespace](../modules/client._internal_namespace.md) / Verbs - -# Interface: Verbs - -[client](../modules/client.md).[_internal_namespace](../modules/client._internal_namespace.md).Verbs - -The tenses for describing the action performed by a API route - -## Table of contents - -### Properties - -- [past](client._internal_namespace.Verbs.md#past) -- [present](client._internal_namespace.Verbs.md#present) -- [progressive](client._internal_namespace.Verbs.md#progressive) - -## Properties - -### past - -• **past**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:18](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L18) - -___ - -### present - -• **present**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:16](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L16) - -___ - -### progressive - -• **progressive**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:17](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L17) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.CreateMappingsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.CreateMappingsArgs.md deleted file mode 100644 index 14e3f0fc93459..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.CreateMappingsArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [configure/client](../modules/configure_client.md) / [\_internal\_namespace](../modules/configure_client._internal_namespace.md) / CreateMappingsArgs - -# Interface: CreateMappingsArgs - -[configure/client](../modules/configure_client.md).[_internal_namespace](../modules/configure_client._internal_namespace.md).CreateMappingsArgs - -## Hierarchy - -- [`MappingsArgs`](configure_client._internal_namespace.MappingsArgs.md) - - ↳ **`CreateMappingsArgs`** - -## Table of contents - -### Properties - -- [connector](configure_client._internal_namespace.CreateMappingsArgs.md#connector) -- [owner](configure_client._internal_namespace.CreateMappingsArgs.md#owner) - -## Properties - -### connector - -• **connector**: { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } - -#### Inherited from - -[MappingsArgs](configure_client._internal_namespace.MappingsArgs.md).[connector](configure_client._internal_namespace.MappingsArgs.md#connector) - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/types.ts:11](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/types.ts#L11) - -___ - -### owner - -• **owner**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/types.ts:15](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/types.ts#L15) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.MappingsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.MappingsArgs.md deleted file mode 100644 index b21de0e3f9018..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.MappingsArgs.md +++ /dev/null @@ -1,29 +0,0 @@ -[Cases Client API Interface](../README.md) / [configure/client](../modules/configure_client.md) / [\_internal\_namespace](../modules/configure_client._internal_namespace.md) / MappingsArgs - -# Interface: MappingsArgs - -[configure/client](../modules/configure_client.md).[_internal_namespace](../modules/configure_client._internal_namespace.md).MappingsArgs - -## Hierarchy - -- **`MappingsArgs`** - - ↳ [`CreateMappingsArgs`](configure_client._internal_namespace.CreateMappingsArgs.md) - - ↳ [`UpdateMappingsArgs`](configure_client._internal_namespace.UpdateMappingsArgs.md) - -## Table of contents - -### Properties - -- [connector](configure_client._internal_namespace.MappingsArgs.md#connector) - -## Properties - -### connector - -• **connector**: { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/types.ts:11](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/types.ts#L11) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.UpdateMappingsArgs.md b/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.UpdateMappingsArgs.md deleted file mode 100644 index e81c67f5bd4a0..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client._internal_namespace.UpdateMappingsArgs.md +++ /dev/null @@ -1,42 +0,0 @@ -[Cases Client API Interface](../README.md) / [configure/client](../modules/configure_client.md) / [\_internal\_namespace](../modules/configure_client._internal_namespace.md) / UpdateMappingsArgs - -# Interface: UpdateMappingsArgs - -[configure/client](../modules/configure_client.md).[_internal_namespace](../modules/configure_client._internal_namespace.md).UpdateMappingsArgs - -## Hierarchy - -- [`MappingsArgs`](configure_client._internal_namespace.MappingsArgs.md) - - ↳ **`UpdateMappingsArgs`** - -## Table of contents - -### Properties - -- [connector](configure_client._internal_namespace.UpdateMappingsArgs.md#connector) -- [mappingId](configure_client._internal_namespace.UpdateMappingsArgs.md#mappingid) - -## Properties - -### connector - -• **connector**: { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } - -#### Inherited from - -[MappingsArgs](configure_client._internal_namespace.MappingsArgs.md).[connector](configure_client._internal_namespace.MappingsArgs.md#connector) - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/types.ts:11](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/types.ts#L11) - -___ - -### mappingId - -• **mappingId**: `string` - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/types.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/types.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client.configuresubclient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client.configuresubclient.md deleted file mode 100644 index 393957ba1c7f5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/configure_client.configuresubclient.md +++ /dev/null @@ -1,100 +0,0 @@ -[Cases Client API Interface](../README.md) / [configure/client](../modules/configure_client.md) / ConfigureSubClient - -# Interface: ConfigureSubClient - -[configure/client](../modules/configure_client.md).ConfigureSubClient - -This is the public API for interacting with the connector configuration for cases. - -## Table of contents - -### Methods - -- [create](configure_client.ConfigureSubClient.md#create) -- [get](configure_client.ConfigureSubClient.md#get) -- [getConnectors](configure_client.ConfigureSubClient.md#getconnectors) -- [update](configure_client.ConfigureSubClient.md#update) - -## Methods - -### create - -▸ **create**(`configuration`): `Promise`<[`ICasesConfigureResponse`](typedoc_interfaces.ICasesConfigureResponse.md)\> - -Creates a configuration if one does not already exist. If one exists it is deleted and a new one is created. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `configuration` | [`ICasesConfigureRequest`](typedoc_interfaces.ICasesConfigureRequest.md) | - -#### Returns - -`Promise`<[`ICasesConfigureResponse`](typedoc_interfaces.ICasesConfigureResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/client.ts:93](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/client.ts#L93) - -___ - -### get - -▸ **get**(`params`): `Promise`<{} \| [`ICasesConfigureResponse`](typedoc_interfaces.ICasesConfigureResponse.md)\> - -Retrieves the external connector configuration for a particular case owner. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `Object` | -| `params.owner` | `undefined` \| `string` \| `string`[] | - -#### Returns - -`Promise`<{} \| [`ICasesConfigureResponse`](typedoc_interfaces.ICasesConfigureResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/client.ts:75](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/client.ts#L75) - -___ - -### getConnectors - -▸ **getConnectors**(): `Promise`<[`FindActionResult`](client._internal_namespace.FindActionResult.md)[]\> - -Retrieves the valid external connectors supported by the cases plugin. - -#### Returns - -`Promise`<[`FindActionResult`](client._internal_namespace.FindActionResult.md)[]\> - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/client.ts:79](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/client.ts#L79) - -___ - -### update - -▸ **update**(`configurationId`, `configurations`): `Promise`<[`ICasesConfigureResponse`](typedoc_interfaces.ICasesConfigureResponse.md)\> - -Updates a particular configuration with new values. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `configurationId` | `string` | the ID of the configuration to update | -| `configurations` | [`ICasesConfigurePatch`](typedoc_interfaces.ICasesConfigurePatch.md) | the new configuration parameters | - -#### Returns - -`Promise`<[`ICasesConfigureResponse`](typedoc_interfaces.ICasesConfigureResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/client.ts:86](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/client.ts#L86) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/metrics_client.MetricsSubClient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/metrics_client.MetricsSubClient.md deleted file mode 100644 index c59b437c7f23e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/metrics_client.MetricsSubClient.md +++ /dev/null @@ -1,33 +0,0 @@ -[Cases Client API Interface](../README.md) / [metrics/client](../modules/metrics_client.md) / MetricsSubClient - -# Interface: MetricsSubClient - -[metrics/client](../modules/metrics_client.md).MetricsSubClient - -API for interacting with the metrics. - -## Table of contents - -### Methods - -- [getCaseMetrics](metrics_client.MetricsSubClient.md#getcasemetrics) - -## Methods - -### getCaseMetrics - -▸ **getCaseMetrics**(`params`): `Promise`<{ `actions`: `undefined` \| { isolateHost?: { isolate: { total: number; }; unisolate: { total: number; }; } \| undefined; } ; `alerts`: `undefined` \| { count?: number \| undefined; hosts?: { total: number; values: { name: string \| undefined; id: string; count: number; }[]; } \| undefined; users?: { total: number; values: { name: string; count: number; }[]; } \| undefined; } ; `connectors`: `undefined` \| { `total`: `number` = rt.number } ; `lifespan`: `undefined` \| { `closeDate`: ``null`` \| `string` ; `creationDate`: `string` = rt.string; `statusInfo`: { openDuration: number; inProgressDuration: number; reopenDates: string[]; } = StatusInfoRt } }\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | [`CaseMetricsParams`](metrics_client._internal_namespace.CaseMetricsParams.md) | - -#### Returns - -`Promise`<{ `actions`: `undefined` \| { isolateHost?: { isolate: { total: number; }; unisolate: { total: number; }; } \| undefined; } ; `alerts`: `undefined` \| { count?: number \| undefined; hosts?: { total: number; values: { name: string \| undefined; id: string; count: number; }[]; } \| undefined; users?: { total: number; values: { name: string; count: number; }[]; } \| undefined; } ; `connectors`: `undefined` \| { `total`: `number` = rt.number } ; `lifespan`: `undefined` \| { `closeDate`: ``null`` \| `string` ; `creationDate`: `string` = rt.string; `statusInfo`: { openDuration: number; inProgressDuration: number; reopenDates: string[]; } = StatusInfoRt } }\> - -#### Defined in - -[x-pack/plugins/cases/server/client/metrics/client.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/metrics/client.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/metrics_client._internal_namespace.CaseMetricsParams.md b/x-pack/plugins/cases/docs/cases_client/interfaces/metrics_client._internal_namespace.CaseMetricsParams.md deleted file mode 100644 index 8f03bed67e646..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/metrics_client._internal_namespace.CaseMetricsParams.md +++ /dev/null @@ -1,36 +0,0 @@ -[Cases Client API Interface](../README.md) / [metrics/client](../modules/metrics_client.md) / [\_internal\_namespace](../modules/metrics_client._internal_namespace.md) / CaseMetricsParams - -# Interface: CaseMetricsParams - -[metrics/client](../modules/metrics_client.md).[_internal_namespace](../modules/metrics_client._internal_namespace.md).CaseMetricsParams - -## Table of contents - -### Properties - -- [caseId](metrics_client._internal_namespace.CaseMetricsParams.md#caseid) -- [features](metrics_client._internal_namespace.CaseMetricsParams.md#features) - -## Properties - -### caseId - -• **caseId**: `string` - -The ID of the case. - -#### Defined in - -[x-pack/plugins/cases/server/client/metrics/get_case_metrics.ts:26](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/metrics/get_case_metrics.ts#L26) - -___ - -### features - -• **features**: `string`[] - -The metrics to retrieve. - -#### Defined in - -[x-pack/plugins/cases/server/client/metrics/get_case_metrics.ts:30](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/metrics/get_case_metrics.ts#L30) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/stats_client.statssubclient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/stats_client.statssubclient.md deleted file mode 100644 index 37dab1782ee06..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/stats_client.statssubclient.md +++ /dev/null @@ -1,36 +0,0 @@ -[Cases Client API Interface](../README.md) / [stats/client](../modules/stats_client.md) / StatsSubClient - -# Interface: StatsSubClient - -[stats/client](../modules/stats_client.md).StatsSubClient - -Statistics API contract. - -## Table of contents - -### Methods - -- [getStatusTotalsByType](stats_client.StatsSubClient.md#getstatustotalsbytype) - -## Methods - -### getStatusTotalsByType - -▸ **getStatusTotalsByType**(`params`): `Promise`<{ `count_closed_cases`: `number` = rt.number; `count_in_progress_cases`: `number` = rt.number; `count_open_cases`: `number` = rt.number }\> - -Retrieves the total number of open, closed, and in-progress cases. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `Object` | -| `params.owner` | `undefined` \| `string` \| `string`[] | - -#### Returns - -`Promise`<{ `count_closed_cases`: `number` = rt.number; `count_in_progress_cases`: `number` = rt.number; `count_open_cases`: `number` = rt.number }\> - -#### Defined in - -[x-pack/plugins/cases/server/client/stats/client.ts:34](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/stats/client.ts#L34) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.ICaseResolveResponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.ICaseResolveResponse.md deleted file mode 100644 index a428247ab70ba..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.ICaseResolveResponse.md +++ /dev/null @@ -1,49 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICaseResolveResponse - -# Interface: ICaseResolveResponse - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICaseResolveResponse - -## Hierarchy - -- [`CaseResolveResponse`](../modules/typedoc_interfaces._internal_namespace.md#caseresolveresponse) - - ↳ **`ICaseResolveResponse`** - -## Table of contents - -### Properties - -- [alias\_target\_id](typedoc_interfaces.ICaseResolveResponse.md#alias_target_id) -- [case](typedoc_interfaces.ICaseResolveResponse.md#case) -- [outcome](typedoc_interfaces.ICaseResolveResponse.md#outcome) - -## Properties - -### alias\_target\_id - -• **alias\_target\_id**: `undefined` \| `string` = `rt.string` - -#### Inherited from - -CaseResolveResponse.alias\_target\_id - -___ - -### case - -• **case**: { `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `totalAlerts`: `number` = rt.number; `totalComment`: `number` = rt.number; `version`: `string` = rt.string } & { `comments`: `undefined` \| { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string }[] } = `CaseResponseRt` - -#### Inherited from - -CaseResolveResponse.case - -___ - -### outcome - -• **outcome**: ``"exactMatch"`` \| ``"aliasMatch"`` \| ``"conflict"`` - -#### Inherited from - -CaseResolveResponse.outcome diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.iallcommentsresponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.iallcommentsresponse.md deleted file mode 100644 index e4d0d7cdaa594..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.iallcommentsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / IAllCommentsResponse - -# Interface: IAllCommentsResponse - -[typedoc_interfaces](../modules/typedoc_interfaces.md).IAllCommentsResponse - -## Hierarchy - -- [`AllCommentsResponse`](../modules/typedoc_interfaces._internal_namespace.md#allcommentsresponse) - - ↳ **`IAllCommentsResponse`** diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasepostrequest.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasepostrequest.md deleted file mode 100644 index bcca7301539f5..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasepostrequest.md +++ /dev/null @@ -1,91 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICasePostRequest - -# Interface: ICasePostRequest - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICasePostRequest - -These are simply to make typedoc not attempt to expand the type aliases. If it attempts to expand them -the docs are huge. - -## Hierarchy - -- [`CasePostRequest`](../modules/typedoc_interfaces._internal_namespace.md#casepostrequest) - - ↳ **`ICasePostRequest`** - -## Table of contents - -### Properties - -- [connector](typedoc_interfaces.ICasePostRequest.md#connector) -- [description](typedoc_interfaces.ICasePostRequest.md#description) -- [owner](typedoc_interfaces.ICasePostRequest.md#owner) -- [settings](typedoc_interfaces.ICasePostRequest.md#settings) -- [tags](typedoc_interfaces.ICasePostRequest.md#tags) -- [title](typedoc_interfaces.ICasePostRequest.md#title) - -## Properties - -### connector - -• **connector**: { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } = `CaseConnectorRt` - -#### Inherited from - -CasePostRequest.connector - -___ - -### description - -• **description**: `string` = `rt.string` - -#### Inherited from - -CasePostRequest.description - -___ - -### owner - -• **owner**: `string` = `rt.string` - -#### Inherited from - -CasePostRequest.owner - -___ - -### settings - -• **settings**: `Object` = `SettingsRt` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `syncAlerts` | `boolean` | - -#### Inherited from - -CasePostRequest.settings - -___ - -### tags - -• **tags**: `string`[] - -#### Inherited from - -CasePostRequest.tags - -___ - -### title - -• **title**: `string` = `rt.string` - -#### Inherited from - -CasePostRequest.title diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icaseresponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icaseresponse.md deleted file mode 100644 index 5a323c8095768..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icaseresponse.md +++ /dev/null @@ -1,239 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICaseResponse - -# Interface: ICaseResponse - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICaseResponse - -## Hierarchy - -- [`CaseResponse`](../modules/typedoc_interfaces._internal_namespace.md#caseresponse) - - ↳ **`ICaseResponse`** - -## Table of contents - -### Properties - -- [closed\_at](typedoc_interfaces.ICaseResponse.md#closed_at) -- [closed\_by](typedoc_interfaces.ICaseResponse.md#closed_by) -- [comments](typedoc_interfaces.ICaseResponse.md#comments) -- [connector](typedoc_interfaces.ICaseResponse.md#connector) -- [created\_at](typedoc_interfaces.ICaseResponse.md#created_at) -- [created\_by](typedoc_interfaces.ICaseResponse.md#created_by) -- [description](typedoc_interfaces.ICaseResponse.md#description) -- [external\_service](typedoc_interfaces.ICaseResponse.md#external_service) -- [id](typedoc_interfaces.ICaseResponse.md#id) -- [owner](typedoc_interfaces.ICaseResponse.md#owner) -- [settings](typedoc_interfaces.ICaseResponse.md#settings) -- [status](typedoc_interfaces.ICaseResponse.md#status) -- [tags](typedoc_interfaces.ICaseResponse.md#tags) -- [title](typedoc_interfaces.ICaseResponse.md#title) -- [totalAlerts](typedoc_interfaces.ICaseResponse.md#totalalerts) -- [totalComment](typedoc_interfaces.ICaseResponse.md#totalcomment) -- [updated\_at](typedoc_interfaces.ICaseResponse.md#updated_at) -- [updated\_by](typedoc_interfaces.ICaseResponse.md#updated_by) -- [version](typedoc_interfaces.ICaseResponse.md#version) - -## Properties - -### closed\_at - -• **closed\_at**: ``null`` \| `string` - -#### Inherited from - -CaseResponse.closed\_at - -___ - -### closed\_by - -• **closed\_by**: ``null`` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } - -#### Inherited from - -CaseResponse.closed\_by - -___ - -### comments - -• **comments**: `undefined` \| { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string }[] - -#### Inherited from - -CaseResponse.comments - -___ - -### connector - -• **connector**: { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } = `CaseConnectorRt` - -#### Inherited from - -CaseResponse.connector - -___ - -### created\_at - -• **created\_at**: `string` = `rt.string` - -#### Inherited from - -CaseResponse.created\_at - -___ - -### created\_by - -• **created\_by**: `Object` = `UserRT` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Inherited from - -CaseResponse.created\_by - -___ - -### description - -• **description**: `string` = `rt.string` - -#### Inherited from - -CaseResponse.description - -___ - -### external\_service - -• **external\_service**: ``null`` \| { `connector_id`: `string` = rt.string } & { `connector_name`: `string` = rt.string; `external_id`: `string` = rt.string; `external_title`: `string` = rt.string; `external_url`: `string` = rt.string; `pushed_at`: `string` = rt.string; `pushed_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT } = `CaseFullExternalServiceRt` - -#### Inherited from - -CaseResponse.external\_service - -___ - -### id - -• **id**: `string` = `rt.string` - -#### Inherited from - -CaseResponse.id - -___ - -### owner - -• **owner**: `string` = `rt.string` - -#### Inherited from - -CaseResponse.owner - -___ - -### settings - -• **settings**: `Object` = `SettingsRt` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `syncAlerts` | `boolean` | - -#### Inherited from - -CaseResponse.settings - -___ - -### status - -• **status**: `CaseStatuses` = `CaseStatusRt` - -#### Inherited from - -CaseResponse.status - -___ - -### tags - -• **tags**: `string`[] - -#### Inherited from - -CaseResponse.tags - -___ - -### title - -• **title**: `string` = `rt.string` - -#### Inherited from - -CaseResponse.title - -___ - -### totalAlerts - -• **totalAlerts**: `number` = `rt.number` - -#### Inherited from - -CaseResponse.totalAlerts - -___ - -### totalComment - -• **totalComment**: `number` = `rt.number` - -#### Inherited from - -CaseResponse.totalComment - -___ - -### updated\_at - -• **updated\_at**: ``null`` \| `string` - -#### Inherited from - -CaseResponse.updated\_at - -___ - -### updated\_by - -• **updated\_by**: ``null`` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } - -#### Inherited from - -CaseResponse.updated\_by - -___ - -### version - -• **version**: `string` = `rt.string` - -#### Inherited from - -CaseResponse.version diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigurepatch.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigurepatch.md deleted file mode 100644 index b645740febc08..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigurepatch.md +++ /dev/null @@ -1,49 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICasesConfigurePatch - -# Interface: ICasesConfigurePatch - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICasesConfigurePatch - -## Hierarchy - -- [`CasesConfigurePatch`](../modules/typedoc_interfaces._internal_namespace.md#casesconfigurepatch) - - ↳ **`ICasesConfigurePatch`** - -## Table of contents - -### Properties - -- [closure\_type](typedoc_interfaces.ICasesConfigurePatch.md#closure_type) -- [connector](typedoc_interfaces.ICasesConfigurePatch.md#connector) -- [version](typedoc_interfaces.ICasesConfigurePatch.md#version) - -## Properties - -### closure\_type - -• **closure\_type**: `undefined` \| ``"close-by-user"`` \| ``"close-by-pushing"`` = `ClosureTypeRT` - -#### Inherited from - -CasesConfigurePatch.closure\_type - -___ - -### connector - -• **connector**: `undefined` \| { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } = `CaseConnectorRt` - -#### Inherited from - -CasesConfigurePatch.connector - -___ - -### version - -• **version**: `string` = `rt.string` - -#### Inherited from - -CasesConfigurePatch.version diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigurerequest.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigurerequest.md deleted file mode 100644 index 5dc7249d20f57..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigurerequest.md +++ /dev/null @@ -1,49 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICasesConfigureRequest - -# Interface: ICasesConfigureRequest - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICasesConfigureRequest - -## Hierarchy - -- [`CasesConfigureRequest`](../modules/typedoc_interfaces._internal_namespace.md#casesconfigurerequest) - - ↳ **`ICasesConfigureRequest`** - -## Table of contents - -### Properties - -- [closure\_type](typedoc_interfaces.ICasesConfigureRequest.md#closure_type) -- [connector](typedoc_interfaces.ICasesConfigureRequest.md#connector) -- [owner](typedoc_interfaces.ICasesConfigureRequest.md#owner) - -## Properties - -### closure\_type - -• **closure\_type**: ``"close-by-user"`` \| ``"close-by-pushing"`` = `ClosureTypeRT` - -#### Inherited from - -CasesConfigureRequest.closure\_type - -___ - -### connector - -• **connector**: { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } = `CaseConnectorRt` - -#### Inherited from - -CasesConfigureRequest.connector - -___ - -### owner - -• **owner**: `string` = `rt.string` - -#### Inherited from - -CasesConfigureRequest.owner diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigureresponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigureresponse.md deleted file mode 100644 index 20754bcaa22b6..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesconfigureresponse.md +++ /dev/null @@ -1,145 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICasesConfigureResponse - -# Interface: ICasesConfigureResponse - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICasesConfigureResponse - -## Hierarchy - -- [`CasesConfigureResponse`](../modules/typedoc_interfaces._internal_namespace.md#casesconfigureresponse) - - ↳ **`ICasesConfigureResponse`** - -## Table of contents - -### Properties - -- [closure\_type](typedoc_interfaces.ICasesConfigureResponse.md#closure_type) -- [connector](typedoc_interfaces.ICasesConfigureResponse.md#connector) -- [created\_at](typedoc_interfaces.ICasesConfigureResponse.md#created_at) -- [created\_by](typedoc_interfaces.ICasesConfigureResponse.md#created_by) -- [error](typedoc_interfaces.ICasesConfigureResponse.md#error) -- [id](typedoc_interfaces.ICasesConfigureResponse.md#id) -- [mappings](typedoc_interfaces.ICasesConfigureResponse.md#mappings) -- [owner](typedoc_interfaces.ICasesConfigureResponse.md#owner) -- [updated\_at](typedoc_interfaces.ICasesConfigureResponse.md#updated_at) -- [updated\_by](typedoc_interfaces.ICasesConfigureResponse.md#updated_by) -- [version](typedoc_interfaces.ICasesConfigureResponse.md#version) - -## Properties - -### closure\_type - -• **closure\_type**: ``"close-by-user"`` \| ``"close-by-pushing"`` = `ClosureTypeRT` - -#### Inherited from - -CasesConfigureResponse.closure\_type - -___ - -### connector - -• **connector**: { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } = `CaseConnectorRt` - -#### Inherited from - -CasesConfigureResponse.connector - -___ - -### created\_at - -• **created\_at**: `string` = `rt.string` - -#### Inherited from - -CasesConfigureResponse.created\_at - -___ - -### created\_by - -• **created\_by**: `Object` = `UserRT` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `email` | `undefined` \| ``null`` \| `string` | -| `full_name` | `undefined` \| ``null`` \| `string` | -| `username` | `undefined` \| ``null`` \| `string` | - -#### Inherited from - -CasesConfigureResponse.created\_by - -___ - -### error - -• **error**: ``null`` \| `string` - -#### Inherited from - -CasesConfigureResponse.error - -___ - -### id - -• **id**: `string` = `rt.string` - -#### Inherited from - -CasesConfigureResponse.id - -___ - -### mappings - -• **mappings**: { `action_type`: ``"append"`` \| ``"nothing"`` \| ``"overwrite"`` = ActionTypeRT; `source`: ``"description"`` \| ``"title"`` \| ``"comments"`` = CaseFieldRT; `target`: `string` = ThirdPartyFieldRT }[] - -#### Inherited from - -CasesConfigureResponse.mappings - -___ - -### owner - -• **owner**: `string` = `rt.string` - -#### Inherited from - -CasesConfigureResponse.owner - -___ - -### updated\_at - -• **updated\_at**: ``null`` \| `string` - -#### Inherited from - -CasesConfigureResponse.updated\_at - -___ - -### updated\_by - -• **updated\_by**: ``null`` \| { `email`: `undefined` \| ``null`` \| `string` ; `full_name`: `undefined` \| ``null`` \| `string` ; `username`: `undefined` \| ``null`` \| `string` } - -#### Inherited from - -CasesConfigureResponse.updated\_by - -___ - -### version - -• **version**: `string` = `rt.string` - -#### Inherited from - -CasesConfigureResponse.version diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesfindrequest.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesfindrequest.md deleted file mode 100644 index b9cc22c6eee44..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesfindrequest.md +++ /dev/null @@ -1,148 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICasesFindRequest - -# Interface: ICasesFindRequest - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICasesFindRequest - -## Hierarchy - -- [`CasesFindRequest`](../modules/client._internal_namespace.md#casesfindrequest) - - ↳ **`ICasesFindRequest`** - -## Table of contents - -### Properties - -- [defaultSearchOperator](typedoc_interfaces.ICasesFindRequest.md#defaultsearchoperator) -- [fields](typedoc_interfaces.ICasesFindRequest.md#fields) -- [owner](typedoc_interfaces.ICasesFindRequest.md#owner) -- [page](typedoc_interfaces.ICasesFindRequest.md#page) -- [perPage](typedoc_interfaces.ICasesFindRequest.md#perpage) -- [reporters](typedoc_interfaces.ICasesFindRequest.md#reporters) -- [search](typedoc_interfaces.ICasesFindRequest.md#search) -- [searchFields](typedoc_interfaces.ICasesFindRequest.md#searchfields) -- [sortField](typedoc_interfaces.ICasesFindRequest.md#sortfield) -- [sortOrder](typedoc_interfaces.ICasesFindRequest.md#sortorder) -- [status](typedoc_interfaces.ICasesFindRequest.md#status) -- [tags](typedoc_interfaces.ICasesFindRequest.md#tags) - -## Properties - -### defaultSearchOperator - -• **defaultSearchOperator**: `undefined` \| ``"AND"`` \| ``"OR"`` - -#### Inherited from - -CasesFindRequest.defaultSearchOperator - -___ - -### fields - -• **fields**: `undefined` \| `string`[] - -#### Inherited from - -CasesFindRequest.fields - -___ - -### owner - -• **owner**: `undefined` \| `string` \| `string`[] - -#### Inherited from - -CasesFindRequest.owner - -___ - -### page - -• **page**: `undefined` \| `number` = `NumberFromString` - -#### Inherited from - -CasesFindRequest.page - -___ - -### perPage - -• **perPage**: `undefined` \| `number` = `NumberFromString` - -#### Inherited from - -CasesFindRequest.perPage - -___ - -### reporters - -• **reporters**: `undefined` \| `string` \| `string`[] - -#### Inherited from - -CasesFindRequest.reporters - -___ - -### search - -• **search**: `undefined` \| `string` = `rt.string` - -#### Inherited from - -CasesFindRequest.search - -___ - -### searchFields - -• **searchFields**: `undefined` \| `string` \| `string`[] - -#### Inherited from - -CasesFindRequest.searchFields - -___ - -### sortField - -• **sortField**: `undefined` \| `string` = `rt.string` - -#### Inherited from - -CasesFindRequest.sortField - -___ - -### sortOrder - -• **sortOrder**: `undefined` \| ``"desc"`` \| ``"asc"`` - -#### Inherited from - -CasesFindRequest.sortOrder - -___ - -### status - -• **status**: `undefined` \| [`open`](../enums/client._internal_namespace.CaseStatuses.md#open) \| `any`[`any`] \| [`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed) = `CaseStatusRt` - -#### Inherited from - -CasesFindRequest.status - -___ - -### tags - -• **tags**: `undefined` \| `string` \| `string`[] - -#### Inherited from - -CasesFindRequest.tags diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesfindresponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesfindresponse.md deleted file mode 100644 index 16b88c29d4d8e..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesfindresponse.md +++ /dev/null @@ -1,93 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICasesFindResponse - -# Interface: ICasesFindResponse - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICasesFindResponse - -## Hierarchy - -- [`CasesFindResponse`](../modules/typedoc_interfaces._internal_namespace.md#casesfindresponse) - - ↳ **`ICasesFindResponse`** - -## Table of contents - -### Properties - -- [cases](typedoc_interfaces.ICasesFindResponse.md#cases) -- [count\_closed\_cases](typedoc_interfaces.ICasesFindResponse.md#count_closed_cases) -- [count\_in\_progress\_cases](typedoc_interfaces.ICasesFindResponse.md#count_in_progress_cases) -- [count\_open\_cases](typedoc_interfaces.ICasesFindResponse.md#count_open_cases) -- [page](typedoc_interfaces.ICasesFindResponse.md#page) -- [per\_page](typedoc_interfaces.ICasesFindResponse.md#per_page) -- [total](typedoc_interfaces.ICasesFindResponse.md#total) - -## Properties - -### cases - -• **cases**: { `connector`: { id: string; } & { type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.none; fields: null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.resilient; fields: { incidentTypes: string[] \| null; severityCode: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowITSM; fields: { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.serviceNowSIR; fields: { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } \| null; } & { name: string; } & { id: string; } & { type: ConnectorTypes.swimlane; fields: { caseId: string \| null; } \| null; } & { name: string; } = CaseConnectorRt; `description`: `string` = rt.string; `owner`: `string` = rt.string; `settings`: { syncAlerts: boolean; } = SettingsRt; `status`: `CaseStatuses` = CaseStatusRt; `tags`: `string`[] ; `title`: `string` = rt.string } & { `closed_at`: ``null`` \| `string` ; `closed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `external_service`: ``null`` \| { connector\_id: string; } & { connector\_name: string; external\_id: string; external\_title: string; external\_url: string; pushed\_at: string; pushed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| ... 1 more ... \| undefined; }; } = CaseFullExternalServiceRt; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `totalAlerts`: `number` = rt.number; `totalComment`: `number` = rt.number; `version`: `string` = rt.string } & { `comments`: `undefined` \| { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string }[] }[] - -#### Inherited from - -CasesFindResponse.cases - -___ - -### count\_closed\_cases - -• **count\_closed\_cases**: `number` = `rt.number` - -#### Inherited from - -CasesFindResponse.count\_closed\_cases - -___ - -### count\_in\_progress\_cases - -• **count\_in\_progress\_cases**: `number` = `rt.number` - -#### Inherited from - -CasesFindResponse.count\_in\_progress\_cases - -___ - -### count\_open\_cases - -• **count\_open\_cases**: `number` = `rt.number` - -#### Inherited from - -CasesFindResponse.count\_open\_cases - -___ - -### page - -• **page**: `number` = `rt.number` - -#### Inherited from - -CasesFindResponse.page - -___ - -### per\_page - -• **per\_page**: `number` = `rt.number` - -#### Inherited from - -CasesFindResponse.per\_page - -___ - -### total - -• **total**: `number` = `rt.number` - -#### Inherited from - -CasesFindResponse.total diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasespatchrequest.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasespatchrequest.md deleted file mode 100644 index 5cf299204ef13..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasespatchrequest.md +++ /dev/null @@ -1,27 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICasesPatchRequest - -# Interface: ICasesPatchRequest - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICasesPatchRequest - -## Hierarchy - -- [`CasesPatchRequest`](../modules/typedoc_interfaces._internal_namespace.md#casespatchrequest) - - ↳ **`ICasesPatchRequest`** - -## Table of contents - -### Properties - -- [cases](typedoc_interfaces.ICasesPatchRequest.md#cases) - -## Properties - -### cases - -• **cases**: { `connector`: `undefined` \| { `id`: `string` = rt.string } & { `fields`: ``null`` \| { issueType: string \| null; priority: string \| null; parent: string \| null; } ; `type`: [`jira`](../modules/client._internal_namespace.md#jira) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` = rt.null; `type`: [`none`](../modules/client._internal_namespace.md#none) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { incidentTypes: string[] \| null; severityCode: string \| null; } ; `type`: [`resilient`](../modules/client._internal_namespace.md#resilient) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { impact: string \| null; severity: string \| null; urgency: string \| null; category: string \| null; subcategory: string \| null; } ; `type`: [`serviceNowITSM`](../modules/client._internal_namespace.md#servicenowitsm) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { category: string \| null; destIp: boolean \| null; malwareHash: boolean \| null; malwareUrl: boolean \| null; priority: string \| null; sourceIp: boolean \| null; subcategory: string \| null; } ; `type`: [`serviceNowSIR`](../modules/client._internal_namespace.md#servicenowsir) } & { `name`: `string` = rt.string } & { `id`: `string` = rt.string } & { `fields`: ``null`` \| { caseId: string \| null; } ; `type`: [`swimlane`](../modules/client._internal_namespace.md#swimlane) } & { `name`: `string` = rt.string } = CaseConnectorRt; `description`: `undefined` \| `string` = rt.string; `owner`: `undefined` \| `string` = rt.string; `settings`: `undefined` \| { `syncAlerts`: `boolean` = rt.boolean } = SettingsRt; `status`: `undefined` \| [`open`](../enums/client._internal_namespace.CaseStatuses.md#open) \| `any`[`any`] \| [`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed) = CaseStatusRt; `tags`: `undefined` \| `string`[] ; `title`: `undefined` \| `string` = rt.string } & { `id`: `string` = rt.string; `version`: `string` = rt.string }[] - -#### Inherited from - -CasesPatchRequest.cases diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesresponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesresponse.md deleted file mode 100644 index 250ac66e4a680..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icasesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICasesResponse - -# Interface: ICasesResponse - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICasesResponse - -## Hierarchy - -- [`CasesResponse`](../modules/typedoc_interfaces._internal_namespace.md#casesresponse) - - ↳ **`ICasesResponse`** diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icaseuseractionsresponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icaseuseractionsresponse.md deleted file mode 100644 index d3b936903e42c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icaseuseractionsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICaseUserActionsResponse - -# Interface: ICaseUserActionsResponse - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICaseUserActionsResponse - -## Hierarchy - -- [`CaseUserActionsResponse`](../modules/typedoc_interfaces._internal_namespace.md#caseuseractionsresponse) - - ↳ **`ICaseUserActionsResponse`** diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icommentsresponse.md b/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icommentsresponse.md deleted file mode 100644 index 012b28393f5b9..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/typedoc_interfaces.icommentsresponse.md +++ /dev/null @@ -1,60 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](../modules/typedoc_interfaces.md) / ICommentsResponse - -# Interface: ICommentsResponse - -[typedoc_interfaces](../modules/typedoc_interfaces.md).ICommentsResponse - -## Hierarchy - -- [`CommentsResponse`](../modules/typedoc_interfaces._internal_namespace.md#commentsresponse) - - ↳ **`ICommentsResponse`** - -## Table of contents - -### Properties - -- [comments](typedoc_interfaces.ICommentsResponse.md#comments) -- [page](typedoc_interfaces.ICommentsResponse.md#page) -- [per\_page](typedoc_interfaces.ICommentsResponse.md#per_page) -- [total](typedoc_interfaces.ICommentsResponse.md#total) - -## Properties - -### comments - -• **comments**: { `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`user`](../modules/client._internal_namespace.md#user) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `alertId`: `string` \| `string`[] ; `index`: `string` \| `string`[] ; `owner`: `string` = rt.string; `rule`: { id: string \| null; name: string \| null; } ; `type`: [`alert`](../modules/client._internal_namespace.md#alert) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string } & { `actions`: { targets: { hostname: string; endpointId: string; }[]; type: string; } ; `comment`: `string` = rt.string; `owner`: `string` = rt.string; `type`: [`actions`](../modules/client._internal_namespace.md#actions) } & { `created_at`: `string` = rt.string; `created_by`: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } = UserRT; `owner`: `string` = rt.string; `pushed_at`: ``null`` \| `string` ; `pushed_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } ; `updated_at`: ``null`` \| `string` ; `updated_by`: ``null`` \| { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } } & { `id`: `string` = rt.string; `version`: `string` = rt.string }[] - -#### Inherited from - -CommentsResponse.comments - -___ - -### page - -• **page**: `number` = `rt.number` - -#### Inherited from - -CommentsResponse.page - -___ - -### per\_page - -• **per\_page**: `number` = `rt.number` - -#### Inherited from - -CommentsResponse.per\_page - -___ - -### total - -• **total**: `number` = `rt.number` - -#### Inherited from - -CommentsResponse.total diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/user_actions_client.useractionget.md b/x-pack/plugins/cases/docs/cases_client/interfaces/user_actions_client.useractionget.md deleted file mode 100644 index 8650aed9753f1..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/user_actions_client.useractionget.md +++ /dev/null @@ -1,25 +0,0 @@ -[Cases Client API Interface](../README.md) / [user\_actions/client](../modules/user_actions_client.md) / UserActionGet - -# Interface: UserActionGet - -[user_actions/client](../modules/user_actions_client.md).UserActionGet - -Parameters for retrieving user actions for a particular case - -## Table of contents - -### Properties - -- [caseId](user_actions_client.UserActionGet.md#caseid) - -## Properties - -### caseId - -• **caseId**: `string` - -The ID of the case - -#### Defined in - -[x-pack/plugins/cases/server/client/user_actions/client.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/user_actions/client.ts#L19) diff --git a/x-pack/plugins/cases/docs/cases_client/interfaces/user_actions_client.useractionssubclient.md b/x-pack/plugins/cases/docs/cases_client/interfaces/user_actions_client.useractionssubclient.md deleted file mode 100644 index 0cf541f5cc445..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/interfaces/user_actions_client.useractionssubclient.md +++ /dev/null @@ -1,35 +0,0 @@ -[Cases Client API Interface](../README.md) / [user\_actions/client](../modules/user_actions_client.md) / UserActionsSubClient - -# Interface: UserActionsSubClient - -[user_actions/client](../modules/user_actions_client.md).UserActionsSubClient - -API for interacting the actions performed by a user when interacting with the cases entities. - -## Table of contents - -### Methods - -- [getAll](user_actions_client.UserActionsSubClient.md#getall) - -## Methods - -### getAll - -▸ **getAll**(`clientArgs`): `Promise`<[`ICaseUserActionsResponse`](typedoc_interfaces.ICaseUserActionsResponse.md)\> - -Retrieves all user actions for a particular case. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `clientArgs` | [`UserActionGet`](user_actions_client.UserActionGet.md) | - -#### Returns - -`Promise`<[`ICaseUserActionsResponse`](typedoc_interfaces.ICaseUserActionsResponse.md)\> - -#### Defined in - -[x-pack/plugins/cases/server/client/user_actions/client.ts:29](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/user_actions/client.ts#L29) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/attachments_client._internal_namespace.md b/x-pack/plugins/cases/docs/cases_client/modules/attachments_client._internal_namespace.md deleted file mode 100644 index 953648379c08f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/attachments_client._internal_namespace.md +++ /dev/null @@ -1,18 +0,0 @@ -[Cases Client API Interface](../README.md) / [attachments/client](attachments_client.md) / \_internal\_namespace - -# Namespace: \_internal\_namespace - -[attachments/client](attachments_client.md)._internal_namespace - -## Table of contents - -### Interfaces - -- [AddArgs](../interfaces/attachments_client._internal_namespace.AddArgs.md) -- [DeleteAllArgs](../interfaces/attachments_client._internal_namespace.DeleteAllArgs.md) -- [DeleteArgs](../interfaces/attachments_client._internal_namespace.DeleteArgs.md) -- [FindArgs](../interfaces/attachments_client._internal_namespace.FindArgs.md) -- [GetAllAlertsAttachToCase](../interfaces/attachments_client._internal_namespace.GetAllAlertsAttachToCase.md) -- [GetAllArgs](../interfaces/attachments_client._internal_namespace.GetAllArgs.md) -- [GetArgs](../interfaces/attachments_client._internal_namespace.GetArgs.md) -- [UpdateArgs](../interfaces/attachments_client._internal_namespace.UpdateArgs.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/attachments_client.md b/x-pack/plugins/cases/docs/cases_client/modules/attachments_client.md deleted file mode 100644 index 2463e2c654e93..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/attachments_client.md +++ /dev/null @@ -1,13 +0,0 @@ -[Cases Client API Interface](../README.md) / attachments/client - -# Module: attachments/client - -## Table of contents - -### Namespaces - -- [\_internal\_namespace](attachments_client._internal_namespace.md) - -### Interfaces - -- [AttachmentsSubClient](../interfaces/attachments_client.AttachmentsSubClient.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/cases_client.md b/x-pack/plugins/cases/docs/cases_client/modules/cases_client.md deleted file mode 100644 index daf591f75c1f8..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/cases_client.md +++ /dev/null @@ -1,9 +0,0 @@ -[Cases Client API Interface](../README.md) / cases/client - -# Module: cases/client - -## Table of contents - -### Interfaces - -- [CasesSubClient](../interfaces/cases_client.CasesSubClient.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/cases_get._internal_namespace.md b/x-pack/plugins/cases/docs/cases_client/modules/cases_get._internal_namespace.md deleted file mode 100644 index a43b25f69372f..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/cases_get._internal_namespace.md +++ /dev/null @@ -1,35 +0,0 @@ -[Cases Client API Interface](../README.md) / [cases/get](cases_get.md) / \_internal\_namespace - -# Namespace: \_internal\_namespace - -[cases/get](cases_get.md)._internal_namespace - -## Table of contents - -### Type aliases - -- [User](cases_get._internal_namespace.md#user) - -### Variables - -- [UserRT](cases_get._internal_namespace.md#userrt) - -## Type aliases - -### User - -Ƭ **User**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/user.ts:18](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/user.ts#L18) - -## Variables - -### UserRT - -• **UserRT**: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> - -#### Defined in - -[x-pack/plugins/cases/common/api/user.ts:10](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/user.ts#L10) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/cases_get.md b/x-pack/plugins/cases/docs/cases_client/modules/cases_get.md deleted file mode 100644 index 6dbf7bb10d0a3..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/cases_get.md +++ /dev/null @@ -1,93 +0,0 @@ -[Cases Client API Interface](../README.md) / cases/get - -# Module: cases/get - -## Table of contents - -### Namespaces - -- [\_internal\_namespace](cases_get._internal_namespace.md) - -### Interfaces - -- [CasesByAlertIDParams](../interfaces/cases_get.CasesByAlertIDParams.md) -- [GetParams](../interfaces/cases_get.GetParams.md) - -### Functions - -- [getReporters](cases_get.md#getreporters) -- [getTags](cases_get.md#gettags) -- [resolve](cases_get.md#resolve) - -## Functions - -### getReporters - -▸ **getReporters**(`params`, `clientArgs`): `Promise`<[`User`](cases_get._internal_namespace.md#user)[]\> - -Retrieves the reporters from all the cases. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `Object` | -| `params.owner` | `undefined` \| `string` \| `string`[] | -| `clientArgs` | [`CasesClientArgs`](../interfaces/client._internal_namespace.CasesClientArgs.md) | - -#### Returns - -`Promise`<[`User`](cases_get._internal_namespace.md#user)[]\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/get.ts:301](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/get.ts#L301) - -___ - -### getTags - -▸ **getTags**(`params`, `clientArgs`): `Promise`<`string`[]\> - -Retrieves the tags from all the cases. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `Object` | -| `params.owner` | `undefined` \| `string` \| `string`[] | -| `clientArgs` | [`CasesClientArgs`](../interfaces/client._internal_namespace.CasesClientArgs.md) | - -#### Returns - -`Promise`<`string`[]\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/get.ts:269](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/get.ts#L269) - -___ - -### resolve - -▸ `Const` **resolve**(`__namedParameters`, `clientArgs`): `Promise`<{ `case`: { description: string; status: CaseStatuses; tags: string[]; title: string; connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { ...; }) \| ... 4 more ... \| ({ ...; } & { ...; })); settings: { ...; }; owner: str... & { closed\_at: string \| null; closed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } \| null; created\_at: string; created\_by: { ...; }; external\_service: ({ ...; } & { ...; }) \| null; updated\_at: string \| null; updated\_by: { ...; } \| null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { `comments`: `undefined` \| { comment: string; type: CommentType.user; owner: string; } & { created\_at: string; created\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; }; owner: string; pushed\_at: string \| null; pushed\_by: { ...; } \| null; updated\_at: string \| null; updated\_by: { ...; } \| null; } & { id: string; version: string; } & { type: CommentType.alert; alertId: string \| string[]; index: string \| string[]; rule: { id: string \| null; name: string \| null; }; owner: string; } & { created\_at: string; created\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; }; owner: string; pushed\_at: string \| null; pushed\_by: { ...; } \| null; updated\_at: string \| null; updated\_by: { ...; } \| null; } & { id: string; version: string; } & { type: CommentType.actions; comment: string; actions: { targets: { hostname: string; endpointId: string; }[]; type: string; }; owner: string; } & { created\_at: string; created\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; }; owner: string; pushed\_at: string \| null; pushed\_by: { ...; } \| null; updated\_at: string \| null; updated\_by: { ...; } \| null; } & { id: string; version: string; }[] } = CaseResponseRt; `outcome`: ``"exactMatch"`` \| ``"aliasMatch"`` \| ``"conflict"`` } & { `alias_target_id`: `undefined` \| `string` = rt.string }\> - -Retrieves a case resolving its ID and optionally loading its comments. - -**`experimental`** - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`GetParams`](../interfaces/cases_get.GetParams.md) | -| `clientArgs` | [`CasesClientArgs`](../interfaces/client._internal_namespace.CasesClientArgs.md) | - -#### Returns - -`Promise`<{ `case`: { description: string; status: CaseStatuses; tags: string[]; title: string; connector: { id: string; } & (({ type: ConnectorTypes.jira; fields: { issueType: string \| null; priority: string \| null; parent: string \| null; } \| null; } & { ...; }) \| ... 4 more ... \| ({ ...; } & { ...; })); settings: { ...; }; owner: str... & { closed\_at: string \| null; closed\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; } \| null; created\_at: string; created\_by: { ...; }; external\_service: ({ ...; } & { ...; }) \| null; updated\_at: string \| null; updated\_by: { ...; } \| null; } & { id: string; totalComment: number; totalAlerts: number; version: string; } & { `comments`: `undefined` \| { comment: string; type: CommentType.user; owner: string; } & { created\_at: string; created\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; }; owner: string; pushed\_at: string \| null; pushed\_by: { ...; } \| null; updated\_at: string \| null; updated\_by: { ...; } \| null; } & { id: string; version: string; } & { type: CommentType.alert; alertId: string \| string[]; index: string \| string[]; rule: { id: string \| null; name: string \| null; }; owner: string; } & { created\_at: string; created\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; }; owner: string; pushed\_at: string \| null; pushed\_by: { ...; } \| null; updated\_at: string \| null; updated\_by: { ...; } \| null; } & { id: string; version: string; } & { type: CommentType.actions; comment: string; actions: { targets: { hostname: string; endpointId: string; }[]; type: string; }; owner: string; } & { created\_at: string; created\_by: { email: string \| null \| undefined; full\_name: string \| null \| undefined; username: string \| null \| undefined; }; owner: string; pushed\_at: string \| null; pushed\_by: { ...; } \| null; updated\_at: string \| null; updated\_by: { ...; } \| null; } & { id: string; version: string; }[] } = CaseResponseRt; `outcome`: ``"exactMatch"`` \| ``"aliasMatch"`` \| ``"conflict"`` } & { `alias_target_id`: `undefined` \| `string` = rt.string }\> - -#### Defined in - -[x-pack/plugins/cases/server/client/cases/get.ts:208](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/cases/get.ts#L208) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/cases_push.md b/x-pack/plugins/cases/docs/cases_client/modules/cases_push.md deleted file mode 100644 index bb9667b3308db..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/cases_push.md +++ /dev/null @@ -1,9 +0,0 @@ -[Cases Client API Interface](../README.md) / cases/push - -# Module: cases/push - -## Table of contents - -### Interfaces - -- [PushParams](../interfaces/cases_push.PushParams.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/client._internal_namespace.md b/x-pack/plugins/cases/docs/cases_client/modules/client._internal_namespace.md deleted file mode 100644 index 4489106b370d1..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/client._internal_namespace.md +++ /dev/null @@ -1,2213 +0,0 @@ -[Cases Client API Interface](../README.md) / [client](client.md) / \_internal\_namespace - -# Namespace: \_internal\_namespace - -[client](client.md)._internal_namespace - -## Table of contents - -### Enumerations - -- [ActionExecutionSourceType](../enums/client._internal_namespace.ActionExecutionSourceType.md) -- [AuthorizationMode](../enums/client._internal_namespace.AuthorizationMode.md) -- [CaseStatuses](../enums/client._internal_namespace.CaseStatuses.md) -- [TaskStatus](../enums/client._internal_namespace.TaskStatus.md) -- [ViewMode](../enums/client._internal_namespace.ViewMode.md) - -### Enumeration members - -- [actions](client._internal_namespace.md#actions) -- [alert](client._internal_namespace.md#alert) -- [jira](client._internal_namespace.md#jira) -- [none](client._internal_namespace.md#none) -- [resilient](client._internal_namespace.md#resilient) -- [serviceNowITSM](client._internal_namespace.md#servicenowitsm) -- [serviceNowSIR](client._internal_namespace.md#servicenowsir) -- [swimlane](client._internal_namespace.md#swimlane) -- [user](client._internal_namespace.md#user) - -### Classes - -- [ActionExecutor](../classes/client._internal_namespace.ActionExecutor.md) -- [ActionTypeRegistry](../classes/client._internal_namespace.ActionTypeRegistry.md) -- [Actions](../classes/client._internal_namespace.Actions.md) -- [ActionsAuthorization](../classes/client._internal_namespace.ActionsAuthorization.md) -- [ActionsClient](../classes/client._internal_namespace.ActionsClient.md) -- [AlertService](../classes/client._internal_namespace.AlertService.md) -- [AlertingActions](../classes/client._internal_namespace.AlertingActions.md) -- [ApiActions](../classes/client._internal_namespace.ApiActions.md) -- [AppActions](../classes/client._internal_namespace.AppActions.md) -- [AttachmentService](../classes/client._internal_namespace.AttachmentService.md) -- [Authorization](../classes/client._internal_namespace.Authorization.md) -- [AuthorizationAuditLogger](../classes/client._internal_namespace.AuthorizationAuditLogger.md) -- [BasePath](../classes/client._internal_namespace.BasePath.md) -- [BuilderFactory](../classes/client._internal_namespace.BuilderFactory.md) -- [CaseConfigureService](../classes/client._internal_namespace.CaseConfigureService.md) -- [CaseUserActionService](../classes/client._internal_namespace.CaseUserActionService.md) -- [CasesActions](../classes/client._internal_namespace.CasesActions.md) -- [CasesClientInternal](../classes/client._internal_namespace.CasesClientInternal.md) -- [CasesService](../classes/client._internal_namespace.CasesService.md) -- [ConnectorMappingsService](../classes/client._internal_namespace.ConnectorMappingsService.md) -- [ConnectorTokenClient](../classes/client._internal_namespace.ConnectorTokenClient.md) -- [ElasticsearchFeature](../classes/client._internal_namespace.ElasticsearchFeature.md) -- [KibanaFeature](../classes/client._internal_namespace.KibanaFeature.md) -- [KibanaMigrator](../classes/client._internal_namespace.KibanaMigrator.md) -- [KibanaRequest](../classes/client._internal_namespace.KibanaRequest.md) -- [LicenseState](../classes/client._internal_namespace.LicenseState.md) -- [RouteValidationError](../classes/client._internal_namespace.RouteValidationError.md) -- [RouteValidator](../classes/client._internal_namespace.RouteValidator.md) -- [SavedObjectActions](../classes/client._internal_namespace.SavedObjectActions.md) -- [SavedObjectTypeRegistry](../classes/client._internal_namespace.SavedObjectTypeRegistry.md) -- [SavedObjectsClient](../classes/client._internal_namespace.SavedObjectsClient.md) -- [SavedObjectsErrorHelpers](../classes/client._internal_namespace.SavedObjectsErrorHelpers.md) -- [SavedObjectsRepository](../classes/client._internal_namespace.SavedObjectsRepository.md) -- [SpaceActions](../classes/client._internal_namespace.SpaceActions.md) -- [SubFeature](../classes/client._internal_namespace.SubFeature.md) -- [TaskRunnerFactory](../classes/client._internal_namespace.TaskRunnerFactory.md) -- [UIActions](../classes/client._internal_namespace.UIActions.md) -- [UserActionBuilder](../classes/client._internal_namespace.UserActionBuilder.md) - -### Interfaces - -- [Action](../interfaces/client._internal_namespace.Action.md) -- [ActionExecutionSource](../interfaces/client._internal_namespace.ActionExecutionSource.md) -- [ActionExecutorContext](../interfaces/client._internal_namespace.ActionExecutorContext.md) -- [ActionResult](../interfaces/client._internal_namespace.ActionResult.md) -- [ActionType](../interfaces/client._internal_namespace.ActionType.md) -- [ActionType](../interfaces/client._internal_namespace.ActionType-1.md) -- [ActionTypeExecutorOptions](../interfaces/client._internal_namespace.ActionTypeExecutorOptions.md) -- [ActionTypeExecutorResult](../interfaces/client._internal_namespace.ActionTypeExecutorResult.md) -- [ActionTypeRegistryOpts](../interfaces/client._internal_namespace.ActionTypeRegistryOpts.md) -- [ActionUpdate](../interfaces/client._internal_namespace.ActionUpdate.md) -- [ActionsConfigurationUtilities](../interfaces/client._internal_namespace.ActionsConfigurationUtilities.md) -- [ActionsLicenseInformation](../interfaces/client._internal_namespace.ActionsLicenseInformation.md) -- [AggregationBuilder](../interfaces/client._internal_namespace.AggregationBuilder.md) -- [Alert](../interfaces/client._internal_namespace.Alert.md) -- [AlertIdIndex](../interfaces/client._internal_namespace.AlertIdIndex.md) -- [AlertInfo](../interfaces/client._internal_namespace.AlertInfo.md) -- [AlertsResponse](../interfaces/client._internal_namespace.AlertsResponse.md) -- [AppCategory](../interfaces/client._internal_namespace.AppCategory.md) -- [AttachedToCaseArgs](../interfaces/client._internal_namespace.AttachedToCaseArgs.md) -- [Attributes](../interfaces/client._internal_namespace.Attributes.md) -- [AuditEvent](../interfaces/client._internal_namespace.AuditEvent.md) -- [AuditLogger](../interfaces/client._internal_namespace.AuditLogger.md) -- [AuthFilterHelpers](../interfaces/client._internal_namespace.AuthFilterHelpers.md) -- [AuthenticatedUser](../interfaces/client._internal_namespace.AuthenticatedUser.md) -- [AuthenticationProvider](../interfaces/client._internal_namespace.AuthenticationProvider.md) -- [AuthorizationMode](../interfaces/client._internal_namespace.AuthorizationMode-1.md) -- [AuthorizationServiceSetup](../interfaces/client._internal_namespace.AuthorizationServiceSetup.md) -- [BeforeSaveContext](../interfaces/client._internal_namespace.BeforeSaveContext.md) -- [BuilderParameters](../interfaces/client._internal_namespace.BuilderParameters.md) -- [BuilderReturnValue](../interfaces/client._internal_namespace.BuilderReturnValue.md) -- [BulkCreateAttachmentDeletionUserAction](../interfaces/client._internal_namespace.BulkCreateAttachmentDeletionUserAction.md) -- [BulkCreateBulkUpdateCaseUserActions](../interfaces/client._internal_namespace.BulkCreateBulkUpdateCaseUserActions.md) -- [BulkCreateCaseDeletionUserAction](../interfaces/client._internal_namespace.BulkCreateCaseDeletionUserAction.md) -- [BulkUpdateAttachmentArgs](../interfaces/client._internal_namespace.BulkUpdateAttachmentArgs.md) -- [CancellableTask](../interfaces/client._internal_namespace.CancellableTask.md) -- [Capabilities](../interfaces/client._internal_namespace.Capabilities.md) -- [CaseCommentStats](../interfaces/client._internal_namespace.CaseCommentStats.md) -- [CasesClientArgs](../interfaces/client._internal_namespace.CasesClientArgs.md) -- [CasesMapWithPageInfo](../interfaces/client._internal_namespace.CasesMapWithPageInfo.md) -- [CheckPrivileges](../interfaces/client._internal_namespace.CheckPrivileges.md) -- [CheckPrivilegesOptions](../interfaces/client._internal_namespace.CheckPrivilegesOptions.md) -- [CheckPrivilegesPayload](../interfaces/client._internal_namespace.CheckPrivilegesPayload.md) -- [CheckPrivilegesResponse](../interfaces/client._internal_namespace.CheckPrivilegesResponse.md) -- [ClientArgs](../interfaces/client._internal_namespace.ClientArgs.md) -- [ClientArgs](../interfaces/client._internal_namespace.ClientArgs-1.md) -- [ClientArgs](../interfaces/client._internal_namespace.ClientArgs-2.md) -- [CommonArguments](../interfaces/client._internal_namespace.CommonArguments.md) -- [ConcreteTaskInstance](../interfaces/client._internal_namespace.ConcreteTaskInstance.md) -- [ConnectorToken](../interfaces/client._internal_namespace.ConnectorToken.md) -- [ConstructorOptions](../interfaces/client._internal_namespace.ConstructorOptions.md) -- [ConstructorOptions](../interfaces/client._internal_namespace.ConstructorOptions-1.md) -- [ConstructorOptions](../interfaces/client._internal_namespace.ConstructorOptions-2.md) -- [CountActionsAttachedToCaseArgs](../interfaces/client._internal_namespace.CountActionsAttachedToCaseArgs.md) -- [CreateAttachmentArgs](../interfaces/client._internal_namespace.CreateAttachmentArgs.md) -- [CreateAuditMsgParams](../interfaces/client._internal_namespace.CreateAuditMsgParams.md) -- [CreateOptions](../interfaces/client._internal_namespace.CreateOptions.md) -- [CreateOptions](../interfaces/client._internal_namespace.CreateOptions-1.md) -- [CreateUserAction](../interfaces/client._internal_namespace.CreateUserAction.md) -- [CreateUserActionES](../interfaces/client._internal_namespace.CreateUserActionES.md) -- [DecoratedError](../interfaces/client._internal_namespace.DecoratedError.md) -- [ElasticsearchFeatureConfig](../interfaces/client._internal_namespace.ElasticsearchFeatureConfig.md) -- [EmbeddableRegistryDefinition](../interfaces/client._internal_namespace.EmbeddableRegistryDefinition.md) -- [EncryptedSavedObjectsClient](../interfaces/client._internal_namespace.EncryptedSavedObjectsClient.md) -- [ExecuteOptions](../interfaces/client._internal_namespace.ExecuteOptions.md) -- [ExecuteOptions](../interfaces/client._internal_namespace.ExecuteOptions-1.md) -- [FeatureElasticsearchPrivileges](../interfaces/client._internal_namespace.FeatureElasticsearchPrivileges.md) -- [FeatureKibanaPrivileges](../interfaces/client._internal_namespace.FeatureKibanaPrivileges.md) -- [FeatureUsageServiceSetup](../interfaces/client._internal_namespace.FeatureUsageServiceSetup.md) -- [FindActionResult](../interfaces/client._internal_namespace.FindActionResult.md) -- [FindCaseCommentsArgs](../interfaces/client._internal_namespace.FindCaseCommentsArgs.md) -- [FindCaseConfigureArgs](../interfaces/client._internal_namespace.FindCaseConfigureArgs.md) -- [FindCasesArgs](../interfaces/client._internal_namespace.FindCasesArgs.md) -- [FindCommentsArgs](../interfaces/client._internal_namespace.FindCommentsArgs.md) -- [FindConnectorMappingsArgs](../interfaces/client._internal_namespace.FindConnectorMappingsArgs.md) -- [GetAllSpacesOptions](../interfaces/client._internal_namespace.GetAllSpacesOptions.md) -- [GetAttachmentArgs](../interfaces/client._internal_namespace.GetAttachmentArgs.md) -- [GetCaseArgs](../interfaces/client._internal_namespace.GetCaseArgs.md) -- [GetCaseConfigureArgs](../interfaces/client._internal_namespace.GetCaseConfigureArgs.md) -- [GetCaseIdsByAlertIdArgs](../interfaces/client._internal_namespace.GetCaseIdsByAlertIdArgs.md) -- [GetCaseUserActionArgs](../interfaces/client._internal_namespace.GetCaseUserActionArgs.md) -- [GetCasesArgs](../interfaces/client._internal_namespace.GetCasesArgs.md) -- [GetReportersArgs](../interfaces/client._internal_namespace.GetReportersArgs.md) -- [GetSpaceResult](../interfaces/client._internal_namespace.GetSpaceResult.md) -- [GetTagsArgs](../interfaces/client._internal_namespace.GetTagsArgs.md) -- [GetUserActionItemByDifference](../interfaces/client._internal_namespace.GetUserActionItemByDifference.md) -- [GetUserArgs](../interfaces/client._internal_namespace.GetUserArgs.md) -- [IEventLogger](../interfaces/client._internal_namespace.IEventLogger.md) -- [IKibanaSocket](../interfaces/client._internal_namespace.IKibanaSocket.md) -- [ILicense](../interfaces/client._internal_namespace.ILicense.md) -- [ISavedObjectsPointInTimeFinder](../interfaces/client._internal_namespace.ISavedObjectsPointInTimeFinder.md) -- [IScopedClusterClient](../interfaces/client._internal_namespace.IScopedClusterClient.md) -- [ISpacesClient](../interfaces/client._internal_namespace.ISpacesClient.md) -- [IUsageCounter](../interfaces/client._internal_namespace.IUsageCounter.md) -- [IncrementCounterParams](../interfaces/client._internal_namespace.IncrementCounterParams.md) -- [IndexMapping](../interfaces/client._internal_namespace.IndexMapping.md) -- [IndexMappingMeta](../interfaces/client._internal_namespace.IndexMappingMeta.md) -- [IntervalSchedule](../interfaces/client._internal_namespace.IntervalSchedule.md) -- [KibanaFeatureConfig](../interfaces/client._internal_namespace.KibanaFeatureConfig.md) -- [KibanaMigratorOptions](../interfaces/client._internal_namespace.KibanaMigratorOptions.md) -- [KibanaMigratorStatus](../interfaces/client._internal_namespace.KibanaMigratorStatus.md) -- [KibanaRequestEvents](../interfaces/client._internal_namespace.KibanaRequestEvents.md) -- [LegacyUrlAliasTarget](../interfaces/client._internal_namespace.LegacyUrlAliasTarget.md) -- [LicenseCheck](../interfaces/client._internal_namespace.LicenseCheck.md) -- [LicenseFeature](../interfaces/client._internal_namespace.LicenseFeature.md) -- [LicensingPluginSetup](../interfaces/client._internal_namespace.LicensingPluginSetup.md) -- [Middleware](../interfaces/client._internal_namespace.Middleware.md) -- [OperationDetails](../interfaces/client._internal_namespace.OperationDetails.md) -- [OwnerEntity](../interfaces/client._internal_namespace.OwnerEntity.md) -- [PatchCase](../interfaces/client._internal_namespace.PatchCase.md) -- [PatchCaseConfigureArgs](../interfaces/client._internal_namespace.PatchCaseConfigureArgs.md) -- [PatchCasesArgs](../interfaces/client._internal_namespace.PatchCasesArgs.md) -- [PersistableState](../interfaces/client._internal_namespace.PersistableState.md) -- [PluginStartContract](../interfaces/client._internal_namespace.PluginStartContract.md) -- [PostCaseArgs](../interfaces/client._internal_namespace.PostCaseArgs.md) -- [PostCaseConfigureArgs](../interfaces/client._internal_namespace.PostCaseConfigureArgs.md) -- [PostCaseUserActionArgs](../interfaces/client._internal_namespace.PostCaseUserActionArgs.md) -- [PostConnectorMappingsArgs](../interfaces/client._internal_namespace.PostConnectorMappingsArgs.md) -- [PreConfiguredAction](../interfaces/client._internal_namespace.PreConfiguredAction.md) -- [ProxySettings](../interfaces/client._internal_namespace.ProxySettings.md) -- [PublicLicense](../interfaces/client._internal_namespace.PublicLicense.md) -- [PublicLicenseJSON](../interfaces/client._internal_namespace.PublicLicenseJSON.md) -- [PushedArgs](../interfaces/client._internal_namespace.PushedArgs.md) -- [Referencable](../interfaces/client._internal_namespace.Referencable.md) -- [ReservedKibanaPrivilege](../interfaces/client._internal_namespace.ReservedKibanaPrivilege.md) -- [ResponseSettings](../interfaces/client._internal_namespace.ResponseSettings.md) -- [RouteConfigOptions](../interfaces/client._internal_namespace.RouteConfigOptions.md) -- [RouteConfigOptionsBody](../interfaces/client._internal_namespace.RouteConfigOptionsBody.md) -- [RouteValidationResultFactory](../interfaces/client._internal_namespace.RouteValidationResultFactory.md) -- [RouteValidatorConfig](../interfaces/client._internal_namespace.RouteValidatorConfig.md) -- [RouteValidatorOptions](../interfaces/client._internal_namespace.RouteValidatorOptions.md) -- [RunContext](../interfaces/client._internal_namespace.RunContext.md) -- [RunNowResult](../interfaces/client._internal_namespace.RunNowResult.md) -- [SSLSettings](../interfaces/client._internal_namespace.SSLSettings.md) -- [SavedObject](../interfaces/client._internal_namespace.SavedObject.md) -- [SavedObjectAttributes](../interfaces/client._internal_namespace.SavedObjectAttributes.md) -- [SavedObjectDoc](../interfaces/client._internal_namespace.SavedObjectDoc.md) -- [SavedObjectError](../interfaces/client._internal_namespace.SavedObjectError.md) -- [SavedObjectMigrationContext](../interfaces/client._internal_namespace.SavedObjectMigrationContext.md) -- [SavedObjectMigrationMap](../interfaces/client._internal_namespace.SavedObjectMigrationMap.md) -- [SavedObjectReference](../interfaces/client._internal_namespace.SavedObjectReference.md) -- [SavedObjectReferenceWithContext](../interfaces/client._internal_namespace.SavedObjectReferenceWithContext.md) -- [SavedObjectsBaseOptions](../interfaces/client._internal_namespace.SavedObjectsBaseOptions.md) -- [SavedObjectsBulkCreateObject](../interfaces/client._internal_namespace.SavedObjectsBulkCreateObject.md) -- [SavedObjectsBulkGetObject](../interfaces/client._internal_namespace.SavedObjectsBulkGetObject.md) -- [SavedObjectsBulkResolveObject](../interfaces/client._internal_namespace.SavedObjectsBulkResolveObject.md) -- [SavedObjectsBulkResolveResponse](../interfaces/client._internal_namespace.SavedObjectsBulkResolveResponse.md) -- [SavedObjectsBulkResponse](../interfaces/client._internal_namespace.SavedObjectsBulkResponse.md) -- [SavedObjectsBulkUpdateObject](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateObject.md) -- [SavedObjectsBulkUpdateOptions](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateOptions.md) -- [SavedObjectsBulkUpdateResponse](../interfaces/client._internal_namespace.SavedObjectsBulkUpdateResponse.md) -- [SavedObjectsCheckConflictsObject](../interfaces/client._internal_namespace.SavedObjectsCheckConflictsObject.md) -- [SavedObjectsCheckConflictsResponse](../interfaces/client._internal_namespace.SavedObjectsCheckConflictsResponse.md) -- [SavedObjectsClosePointInTimeResponse](../interfaces/client._internal_namespace.SavedObjectsClosePointInTimeResponse.md) -- [SavedObjectsCollectMultiNamespaceReferencesObject](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesObject.md) -- [SavedObjectsCollectMultiNamespaceReferencesOptions](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesOptions.md) -- [SavedObjectsCollectMultiNamespaceReferencesResponse](../interfaces/client._internal_namespace.SavedObjectsCollectMultiNamespaceReferencesResponse.md) -- [SavedObjectsCreateOptions](../interfaces/client._internal_namespace.SavedObjectsCreateOptions.md) -- [SavedObjectsCreatePointInTimeFinderDependencies](../interfaces/client._internal_namespace.SavedObjectsCreatePointInTimeFinderDependencies.md) -- [SavedObjectsDeleteByNamespaceOptions](../interfaces/client._internal_namespace.SavedObjectsDeleteByNamespaceOptions.md) -- [SavedObjectsDeleteOptions](../interfaces/client._internal_namespace.SavedObjectsDeleteOptions.md) -- [SavedObjectsExportTransformContext](../interfaces/client._internal_namespace.SavedObjectsExportTransformContext.md) -- [SavedObjectsFindOptions](../interfaces/client._internal_namespace.SavedObjectsFindOptions.md) -- [SavedObjectsFindOptionsReference](../interfaces/client._internal_namespace.SavedObjectsFindOptionsReference.md) -- [SavedObjectsFindResponse](../interfaces/client._internal_namespace.SavedObjectsFindResponse.md) -- [SavedObjectsFindResult](../interfaces/client._internal_namespace.SavedObjectsFindResult.md) -- [SavedObjectsImportActionRequiredWarning](../interfaces/client._internal_namespace.SavedObjectsImportActionRequiredWarning.md) -- [SavedObjectsImportHookResult](../interfaces/client._internal_namespace.SavedObjectsImportHookResult.md) -- [SavedObjectsImportSimpleWarning](../interfaces/client._internal_namespace.SavedObjectsImportSimpleWarning.md) -- [SavedObjectsIncrementCounterField](../interfaces/client._internal_namespace.SavedObjectsIncrementCounterField.md) -- [SavedObjectsIncrementCounterOptions](../interfaces/client._internal_namespace.SavedObjectsIncrementCounterOptions.md) -- [SavedObjectsMappingProperties](../interfaces/client._internal_namespace.SavedObjectsMappingProperties.md) -- [SavedObjectsMigrationLogger](../interfaces/client._internal_namespace.SavedObjectsMigrationLogger.md) -- [SavedObjectsMigrationVersion](../interfaces/client._internal_namespace.SavedObjectsMigrationVersion.md) -- [SavedObjectsOpenPointInTimeOptions](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeOptions.md) -- [SavedObjectsOpenPointInTimeResponse](../interfaces/client._internal_namespace.SavedObjectsOpenPointInTimeResponse.md) -- [SavedObjectsPitParams](../interfaces/client._internal_namespace.SavedObjectsPitParams.md) -- [SavedObjectsRemoveReferencesToOptions](../interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToOptions.md) -- [SavedObjectsRemoveReferencesToResponse](../interfaces/client._internal_namespace.SavedObjectsRemoveReferencesToResponse.md) -- [SavedObjectsResolveResponse](../interfaces/client._internal_namespace.SavedObjectsResolveResponse.md) -- [SavedObjectsType](../interfaces/client._internal_namespace.SavedObjectsType.md) -- [SavedObjectsTypeManagementDefinition](../interfaces/client._internal_namespace.SavedObjectsTypeManagementDefinition.md) -- [SavedObjectsTypeMappingDefinition](../interfaces/client._internal_namespace.SavedObjectsTypeMappingDefinition.md) -- [SavedObjectsUpdateObjectsSpacesObject](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesObject.md) -- [SavedObjectsUpdateObjectsSpacesOptions](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesOptions.md) -- [SavedObjectsUpdateObjectsSpacesResponse](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponse.md) -- [SavedObjectsUpdateObjectsSpacesResponseObject](../interfaces/client._internal_namespace.SavedObjectsUpdateObjectsSpacesResponseObject.md) -- [SavedObjectsUpdateOptions](../interfaces/client._internal_namespace.SavedObjectsUpdateOptions.md) -- [SavedObjectsUpdateResponse](../interfaces/client._internal_namespace.SavedObjectsUpdateResponse.md) -- [SavedObjectsValidationMap](../interfaces/client._internal_namespace.SavedObjectsValidationMap.md) -- [Services](../interfaces/client._internal_namespace.Services.md) -- [Space](../interfaces/client._internal_namespace.Space.md) -- [SpacesServiceStart](../interfaces/client._internal_namespace.SpacesServiceStart.md) -- [SubFeatureConfig](../interfaces/client._internal_namespace.SubFeatureConfig.md) -- [SubFeaturePrivilegeConfig](../interfaces/client._internal_namespace.SubFeaturePrivilegeConfig.md) -- [SubFeaturePrivilegeGroupConfig](../interfaces/client._internal_namespace.SubFeaturePrivilegeGroupConfig.md) -- [TaskInfo](../interfaces/client._internal_namespace.TaskInfo.md) -- [TaskInstance](../interfaces/client._internal_namespace.TaskInstance.md) -- [TaskManagerSetupContract](../interfaces/client._internal_namespace.TaskManagerSetupContract.md) -- [TaskRegisterDefinition](../interfaces/client._internal_namespace.TaskRegisterDefinition.md) -- [TaskRunnerContext](../interfaces/client._internal_namespace.TaskRunnerContext.md) -- [TranslatedUpdateAlertRequest](../interfaces/client._internal_namespace.TranslatedUpdateAlertRequest.md) -- [UpdateAlertRequest](../interfaces/client._internal_namespace.UpdateAlertRequest.md) -- [UpdateArgs](../interfaces/client._internal_namespace.UpdateArgs.md) -- [UpdateConnectorMappingsArgs](../interfaces/client._internal_namespace.UpdateConnectorMappingsArgs.md) -- [UpdateOptions](../interfaces/client._internal_namespace.UpdateOptions.md) -- [UpdateOptions](../interfaces/client._internal_namespace.UpdateOptions-1.md) -- [User](../interfaces/client._internal_namespace.User.md) -- [UserRealm](../interfaces/client._internal_namespace.UserRealm.md) -- [ValidatorType](../interfaces/client._internal_namespace.ValidatorType.md) -- [Verbs](../interfaces/client._internal_namespace.Verbs.md) - -### Type aliases - -- [ActionExecutorContract](client._internal_namespace.md#actionexecutorcontract) -- [ActionTypeConfig](client._internal_namespace.md#actiontypeconfig) -- [ActionTypeParams](client._internal_namespace.md#actiontypeparams) -- [ActionTypeRegistryContract](client._internal_namespace.md#actiontyperegistrycontract) -- [ActionTypeSecrets](client._internal_namespace.md#actiontypesecrets) -- [ActionsClient](client._internal_namespace.md#actionsclient) -- [AggregationResponse](client._internal_namespace.md#aggregationresponse) -- [BeforeRunContextFunction](client._internal_namespace.md#beforeruncontextfunction) -- [BeforeSaveContextFunction](client._internal_namespace.md#beforesavecontextfunction) -- [CancelFunction](client._internal_namespace.md#cancelfunction) -- [CasesFindRequest](client._internal_namespace.md#casesfindrequest) -- [CheckPrivilegesDynamically](client._internal_namespace.md#checkprivilegesdynamically) -- [CheckPrivilegesDynamicallyWithRequest](client._internal_namespace.md#checkprivilegesdynamicallywithrequest) -- [CheckPrivilegesWithRequest](client._internal_namespace.md#checkprivilegeswithrequest) -- [CheckSavedObjectsPrivileges](client._internal_namespace.md#checksavedobjectsprivileges) -- [CheckSavedObjectsPrivilegesWithRequest](client._internal_namespace.md#checksavedobjectsprivilegeswithrequest) -- [CommonBuilderArguments](client._internal_namespace.md#commonbuilderarguments) -- [CommonUserActionArgs](client._internal_namespace.md#commonuseractionargs) -- [ConnectorTokenClientContract](client._internal_namespace.md#connectortokenclientcontract) -- [CreateUserActionClient](client._internal_namespace.md#createuseractionclient) -- [DeepPartial](client._internal_namespace.md#deeppartial) -- [DeepWriteable](client._internal_namespace.md#deepwriteable) -- [DestructiveRouteMethod](client._internal_namespace.md#destructiveroutemethod) -- [ElasticsearchClient](client._internal_namespace.md#elasticsearchclient) -- [EmbeddableInput](client._internal_namespace.md#embeddableinput) -- [EmbeddableStateWithType](client._internal_namespace.md#embeddablestatewithtype) -- [EnsureSOAuthCallback](client._internal_namespace.md#ensuresoauthcallback) -- [ExecutionEnqueuer](client._internal_namespace.md#executionenqueuer) -- [ExecutorType](client._internal_namespace.md#executortype) -- [FailedRunResult](client._internal_namespace.md#failedrunresult) -- [FindCaseOptions](client._internal_namespace.md#findcaseoptions) -- [GetAllSpacesPurpose](client._internal_namespace.md#getallspacespurpose) -- [GetMigrationFunctionObjectFn](client._internal_namespace.md#getmigrationfunctionobjectfn) -- [GetServicesFunction](client._internal_namespace.md#getservicesfunction) -- [GetSpaceFn](client._internal_namespace.md#getspacefn) -- [Headers](client._internal_namespace.md#headers) -- [IBasePath](client._internal_namespace.md#ibasepath) -- [IEvent](client._internal_namespace.md#ievent) -- [IKibanaMigrator](client._internal_namespace.md#ikibanamigrator) -- [ILicenseState](client._internal_namespace.md#ilicensestate) -- [ISavedObjectTypeRegistry](client._internal_namespace.md#isavedobjecttyperegistry) -- [ISavedObjectsRepository](client._internal_namespace.md#isavedobjectsrepository) -- [IValidatedEvent](client._internal_namespace.md#ivalidatedevent) -- [KibanaExecutionContext](client._internal_namespace.md#kibanaexecutioncontext) -- [KibanaRequestRouteOptions](client._internal_namespace.md#kibanarequestrouteoptions) -- [KnownHeaders](client._internal_namespace.md#knownheaders) -- [KnownKeys](client._internal_namespace.md#knownkeys) -- [LicenseCheckState](client._internal_namespace.md#licensecheckstate) -- [LicenseStatus](client._internal_namespace.md#licensestatus) -- [Mapper](client._internal_namespace.md#mapper) -- [MigrateFunction](client._internal_namespace.md#migratefunction) -- [MigrateFunctionsObject](client._internal_namespace.md#migratefunctionsobject) -- [MigrationResult](client._internal_namespace.md#migrationresult) -- [MigrationStatus](client._internal_namespace.md#migrationstatus) -- [MutatingOperationRefreshSetting](client._internal_namespace.md#mutatingoperationrefreshsetting) -- [PatchCaseArgs](client._internal_namespace.md#patchcaseargs) -- [PersistableStateDefinition](client._internal_namespace.md#persistablestatedefinition) -- [PublicFeatures](client._internal_namespace.md#publicfeatures) -- [RouteContentType](client._internal_namespace.md#routecontenttype) -- [RouteMethod](client._internal_namespace.md#routemethod) -- [RouteValidationFunction](client._internal_namespace.md#routevalidationfunction) -- [RouteValidationSpec](client._internal_namespace.md#routevalidationspec) -- [RouteValidatorFullConfig](client._internal_namespace.md#routevalidatorfullconfig) -- [RunFunction](client._internal_namespace.md#runfunction) -- [RunResult](client._internal_namespace.md#runresult) -- [SafeRouteMethod](client._internal_namespace.md#saferoutemethod) -- [SavedObjectAttribute](client._internal_namespace.md#savedobjectattribute) -- [SavedObjectAttributeSingle](client._internal_namespace.md#savedobjectattributesingle) -- [SavedObjectFindOptions](client._internal_namespace.md#savedobjectfindoptions) -- [SavedObjectFindOptionsKueryNode](client._internal_namespace.md#savedobjectfindoptionskuerynode) -- [SavedObjectMigrationFn](client._internal_namespace.md#savedobjectmigrationfn) -- [SavedObjectTypeExcludeFromUpgradeFilterHook](client._internal_namespace.md#savedobjecttypeexcludefromupgradefilterhook) -- [SavedObjectUnsanitizedDoc](client._internal_namespace.md#savedobjectunsanitizeddoc) -- [SavedObjectsClientContract](client._internal_namespace.md#savedobjectsclientcontract) -- [SavedObjectsCreatePointInTimeFinderOptions](client._internal_namespace.md#savedobjectscreatepointintimefinderoptions) -- [SavedObjectsExportTransform](client._internal_namespace.md#savedobjectsexporttransform) -- [SavedObjectsExportablePredicate](client._internal_namespace.md#savedobjectsexportablepredicate) -- [SavedObjectsFieldMapping](client._internal_namespace.md#savedobjectsfieldmapping) -- [SavedObjectsImportHook](client._internal_namespace.md#savedobjectsimporthook) -- [SavedObjectsImportWarning](client._internal_namespace.md#savedobjectsimportwarning) -- [SavedObjectsNamespaceType](client._internal_namespace.md#savedobjectsnamespacetype) -- [SavedObjectsValidationSpec](client._internal_namespace.md#savedobjectsvalidationspec) -- [SpaceIdToNamespaceFunction](client._internal_namespace.md#spaceidtonamespacefunction) -- [StringKeysAsVals](client._internal_namespace.md#stringkeysasvals) -- [SubFeaturePrivilegeGroupType](client._internal_namespace.md#subfeatureprivilegegrouptype) -- [SuccessfulRunResult](client._internal_namespace.md#successfulrunresult) -- [TaskDefinitionRegistry](client._internal_namespace.md#taskdefinitionregistry) -- [TaskRunCreatorFunction](client._internal_namespace.md#taskruncreatorfunction) -- [UpdateAttachmentArgs](client._internal_namespace.md#updateattachmentargs) -- [UserAction](client._internal_namespace.md#useraction) -- [UserActionParameters](client._internal_namespace.md#useractionparameters) -- [UserActionTypes](client._internal_namespace.md#useractiontypes) - -### Variables - -- [ActionTypesRt](client._internal_namespace.md#actiontypesrt) -- [ActionsRt](client._internal_namespace.md#actionsrt) -- [CasesFindRequestRt](client._internal_namespace.md#casesfindrequestrt) -- [EventSchema](client._internal_namespace.md#eventschema) -- [SavedObjectFindOptionsRt](client._internal_namespace.md#savedobjectfindoptionsrt) - -## Enumeration members - -### actions - -• **actions**: `Object` = `"actions"` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/comment.ts:26](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/comment.ts#L26) - -___ - -### alert - -• **alert**: `Object` = `"alert"` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/comment.ts:25](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/comment.ts#L25) - -___ - -### jira - -• **jira**: `Object` = `".jira"` - -#### Defined in - -[x-pack/plugins/cases/common/api/connectors/index.ts:36](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/connectors/index.ts#L36) - -___ - -### none - -• **none**: `Object` = `".none"` - -#### Defined in - -[x-pack/plugins/cases/common/api/connectors/index.ts:37](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/connectors/index.ts#L37) - -___ - -### resilient - -• **resilient**: `Object` = `".resilient"` - -#### Defined in - -[x-pack/plugins/cases/common/api/connectors/index.ts:38](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/connectors/index.ts#L38) - -___ - -### serviceNowITSM - -• **serviceNowITSM**: `Object` = `".servicenow"` - -#### Defined in - -[x-pack/plugins/cases/common/api/connectors/index.ts:39](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/connectors/index.ts#L39) - -___ - -### serviceNowSIR - -• **serviceNowSIR**: `Object` = `".servicenow-sir"` - -#### Defined in - -[x-pack/plugins/cases/common/api/connectors/index.ts:40](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/connectors/index.ts#L40) - -___ - -### swimlane - -• **swimlane**: `Object` = `".swimlane"` - -#### Defined in - -[x-pack/plugins/cases/common/api/connectors/index.ts:41](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/connectors/index.ts#L41) - -___ - -### user - -• **user**: `Object` = `"user"` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/comment.ts:24](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/comment.ts#L24) - -## Type aliases - -### ActionExecutorContract - -Ƭ **ActionExecutorContract**: `PublicMethodsOf`<[`ActionExecutor`](../classes/client._internal_namespace.ActionExecutor.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/action_executor.d.ts:34 - -___ - -### ActionTypeConfig - -Ƭ **ActionTypeConfig**: `Record`<`string`, `unknown`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:19 - -___ - -### ActionTypeParams - -Ƭ **ActionTypeParams**: `Record`<`string`, `unknown`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:21 - -___ - -### ActionTypeRegistryContract - -Ƭ **ActionTypeRegistryContract**: `PublicMethodsOf`<[`ActionTypeRegistry`](../classes/client._internal_namespace.ActionTypeRegistry.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:17 - -___ - -### ActionTypeSecrets - -Ƭ **ActionTypeSecrets**: `Record`<`string`, `unknown`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:20 - -___ - -### ActionsClient - -Ƭ **ActionsClient**: `PublicMethodsOf`<[`ActionsClient`](../classes/client._internal_namespace.ActionsClient.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/index.d.ts:7 - -___ - -### AggregationResponse - -Ƭ **AggregationResponse**: `Record`<`string`, `estypes.AggregationsAggregate`\> \| `undefined` - -#### Defined in - -[x-pack/plugins/cases/server/client/metrics/types.ts:25](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/metrics/types.ts#L25) - -___ - -### BeforeRunContextFunction - -Ƭ **BeforeRunContextFunction**: [`Mapper`](client._internal_namespace.md#mapper)<[`RunContext`](../interfaces/client._internal_namespace.RunContext.md)\> - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/lib/middleware.d.ts:7 - -___ - -### BeforeSaveContextFunction - -Ƭ **BeforeSaveContextFunction**: [`Mapper`](client._internal_namespace.md#mapper)<[`BeforeSaveContext`](../interfaces/client._internal_namespace.BeforeSaveContext.md)\> - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/lib/middleware.d.ts:6 - -___ - -### CancelFunction - -Ƭ **CancelFunction**: () => `Promise`<[`RunResult`](client._internal_namespace.md#runresult) \| `undefined` \| `void`\> - -#### Type declaration - -▸ (): `Promise`<[`RunResult`](client._internal_namespace.md#runresult) \| `undefined` \| `void`\> - -##### Returns - -`Promise`<[`RunResult`](client._internal_namespace.md#runresult) \| `undefined` \| `void`\> - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:65 - -___ - -### CasesFindRequest - -Ƭ **CasesFindRequest**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:284](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L284) - -___ - -### CheckPrivilegesDynamically - -Ƭ **CheckPrivilegesDynamically**: (`privileges`: [`CheckPrivilegesPayload`](../interfaces/client._internal_namespace.CheckPrivilegesPayload.md), `options?`: [`CheckPrivilegesOptions`](../interfaces/client._internal_namespace.CheckPrivilegesOptions.md)) => `Promise`<[`CheckPrivilegesResponse`](../interfaces/client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Type declaration - -▸ (`privileges`, `options?`): `Promise`<[`CheckPrivilegesResponse`](../interfaces/client._internal_namespace.CheckPrivilegesResponse.md)\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `privileges` | [`CheckPrivilegesPayload`](../interfaces/client._internal_namespace.CheckPrivilegesPayload.md) | -| `options?` | [`CheckPrivilegesOptions`](../interfaces/client._internal_namespace.CheckPrivilegesOptions.md) | - -##### Returns - -`Promise`<[`CheckPrivilegesResponse`](../interfaces/client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/check_privileges_dynamically.d.ts:4 - -___ - -### CheckPrivilegesDynamicallyWithRequest - -Ƭ **CheckPrivilegesDynamicallyWithRequest**: (`request`: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)) => [`CheckPrivilegesDynamically`](client._internal_namespace.md#checkprivilegesdynamically) - -#### Type declaration - -▸ (`request`): [`CheckPrivilegesDynamically`](client._internal_namespace.md#checkprivilegesdynamically) - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md) | - -##### Returns - -[`CheckPrivilegesDynamically`](client._internal_namespace.md#checkprivilegesdynamically) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/check_privileges_dynamically.d.ts:5 - -___ - -### CheckPrivilegesWithRequest - -Ƭ **CheckPrivilegesWithRequest**: (`request`: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)) => [`CheckPrivileges`](../interfaces/client._internal_namespace.CheckPrivileges.md) - -#### Type declaration - -▸ (`request`): [`CheckPrivileges`](../interfaces/client._internal_namespace.CheckPrivileges.md) - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md) | - -##### Returns - -[`CheckPrivileges`](../interfaces/client._internal_namespace.CheckPrivileges.md) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/types.d.ts:59 - -___ - -### CheckSavedObjectsPrivileges - -Ƭ **CheckSavedObjectsPrivileges**: (`actions`: `string` \| `string`[], `namespaceOrNamespaces?`: `string` \| (`undefined` \| `string`)[]) => `Promise`<[`CheckPrivilegesResponse`](../interfaces/client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Type declaration - -▸ (`actions`, `namespaceOrNamespaces?`): `Promise`<[`CheckPrivilegesResponse`](../interfaces/client._internal_namespace.CheckPrivilegesResponse.md)\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `actions` | `string` \| `string`[] | -| `namespaceOrNamespaces?` | `string` \| (`undefined` \| `string`)[] | - -##### Returns - -`Promise`<[`CheckPrivilegesResponse`](../interfaces/client._internal_namespace.CheckPrivilegesResponse.md)\> - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/check_saved_objects_privileges.d.ts:5 - -___ - -### CheckSavedObjectsPrivilegesWithRequest - -Ƭ **CheckSavedObjectsPrivilegesWithRequest**: (`request`: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)) => [`CheckSavedObjectsPrivileges`](client._internal_namespace.md#checksavedobjectsprivileges) - -#### Type declaration - -▸ (`request`): [`CheckSavedObjectsPrivileges`](client._internal_namespace.md#checksavedobjectsprivileges) - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md) | - -##### Returns - -[`CheckSavedObjectsPrivileges`](client._internal_namespace.md#checksavedobjectsprivileges) - -#### Defined in - -x-pack/plugins/security/target/types/server/authorization/check_saved_objects_privileges.d.ts:4 - -___ - -### CommonBuilderArguments - -Ƭ **CommonBuilderArguments**: [`CommonArguments`](../interfaces/client._internal_namespace.CommonArguments.md) & { `action`: [`UserAction`](client._internal_namespace.md#useraction) ; `type`: [`UserActionTypes`](client._internal_namespace.md#useractiontypes) ; `value`: `unknown` ; `valueKey`: `string` } - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:97](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L97) - -___ - -### CommonUserActionArgs - -Ƭ **CommonUserActionArgs**: [`ClientArgs`](../interfaces/client._internal_namespace.ClientArgs-1.md) & [`CommonArguments`](../interfaces/client._internal_namespace.CommonArguments.md) - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:75](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L75) - -___ - -### ConnectorTokenClientContract - -Ƭ **ConnectorTokenClientContract**: `PublicMethodsOf`<[`ConnectorTokenClient`](../classes/client._internal_namespace.ConnectorTokenClient.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:22 - -___ - -### CreateUserActionClient - -Ƭ **CreateUserActionClient**<`T`\>: [`CreateUserAction`](../interfaces/client._internal_namespace.CreateUserAction.md)<`T`\> & [`CommonUserActionArgs`](client._internal_namespace.md#commonuseractionargs) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | extends keyof [`BuilderParameters`](../interfaces/client._internal_namespace.BuilderParameters.md) | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/index.ts:98](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/index.ts#L98) - -___ - -### DeepPartial - -Ƭ **DeepPartial**<`T`\>: { [P in keyof T]?: T[P] extends infer U[] ? DeepPartial[] : DeepPartial } - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Defined in - -x-pack/plugins/event_log/target/types/generated/schemas.d.ts:5 - -___ - -### DeepWriteable - -Ƭ **DeepWriteable**<`T`\>: { -readonly [P in keyof T]: DeepWriteable } - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Defined in - -x-pack/plugins/event_log/target/types/generated/schemas.d.ts:2 - -___ - -### DestructiveRouteMethod - -Ƭ **DestructiveRouteMethod**: ``"post"`` \| ``"put"`` \| ``"delete"`` \| ``"patch"`` - -Set of HTTP methods changing the state of the server. - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:7 - -___ - -### ElasticsearchClient - -Ƭ **ElasticsearchClient**: `Omit`<`KibanaClient`, ``"connectionPool"`` \| ``"transport"`` \| ``"serializer"`` \| ``"extend"`` \| ``"child"`` \| ``"close"`` \| ``"diagnostic"``\> & { `transport`: { `request`: (`params`: `TransportRequestParams`, `options?`: `TransportRequestOptions`) => `Promise`<`TransportResult`<`TResponse`, `unknown`\>\> } } - -Client used to query the elasticsearch cluster. - -#### Defined in - -src/core/target/types/server/elasticsearch/client/types.d.ts:8 - -___ - -### EmbeddableInput - -Ƭ **EmbeddableInput**: `Object` - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `disableTriggers?` | `boolean` | Whether this embeddable should not execute triggers. | -| `disabledActions?` | `string`[] | List of action IDs that this embeddable should not render. | -| `enhancements?` | `SerializableRecord` | Reserved key for enhancements added by other plugins. | -| `executionContext?` | [`KibanaExecutionContext`](client._internal_namespace.md#kibanaexecutioncontext) | - | -| `hidePanelTitles?` | `boolean` | - | -| `id` | `string` | Note this is not a saved object id. It is used to uniquely identify this Embeddable instance from others (e.g. inside a container). It's possible to have two Embeddables where everything else is the same but the id. | -| `lastReloadRequestTime?` | `number` | - | -| `searchSessionId?` | `string` | Search session id to group searches | -| `syncColors?` | `boolean` | Flag whether colors should be synced with other panels | -| `title?` | `string` | - | -| `viewMode?` | [`ViewMode`](../enums/client._internal_namespace.ViewMode.md) | - | - -#### Defined in - -src/plugins/embeddable/target/types/common/types.d.ts:10 - -___ - -### EmbeddableStateWithType - -Ƭ **EmbeddableStateWithType**: [`EmbeddableInput`](client._internal_namespace.md#embeddableinput) & { `type`: `string` } - -#### Defined in - -src/plugins/embeddable/target/types/common/types.d.ts:53 - -___ - -### EnsureSOAuthCallback - -Ƭ **EnsureSOAuthCallback**: (`entities`: [`OwnerEntity`](../interfaces/client._internal_namespace.OwnerEntity.md)[]) => `void` - -#### Type declaration - -▸ (`entities`): `void` - -Function callback for making sure the found saved objects are of the authorized owner - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `entities` | [`OwnerEntity`](../interfaces/client._internal_namespace.OwnerEntity.md)[] | - -##### Returns - -`void` - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:110](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L110) - -___ - -### ExecutionEnqueuer - -Ƭ **ExecutionEnqueuer**<`T`\>: (`unsecuredSavedObjectsClient`: [`SavedObjectsClientContract`](client._internal_namespace.md#savedobjectsclientcontract), `options`: [`ExecuteOptions`](../interfaces/client._internal_namespace.ExecuteOptions-1.md)) => `Promise`<`T`\> - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Type declaration - -▸ (`unsecuredSavedObjectsClient`, `options`): `Promise`<`T`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `unsecuredSavedObjectsClient` | [`SavedObjectsClientContract`](client._internal_namespace.md#savedobjectsclientcontract) | -| `options` | [`ExecuteOptions`](../interfaces/client._internal_namespace.ExecuteOptions-1.md) | - -##### Returns - -`Promise`<`T`\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/create_execute_function.d.ts:19 - -___ - -### ExecutorType - -Ƭ **ExecutorType**<`Config`, `Secrets`, `Params`, `ResultData`\>: (`options`: [`ActionTypeExecutorOptions`](../interfaces/client._internal_namespace.ActionTypeExecutorOptions.md)<`Config`, `Secrets`, `Params`\>) => `Promise`<[`ActionTypeExecutorResult`](../interfaces/client._internal_namespace.ActionTypeExecutorResult.md)<`ResultData`\>\> - -#### Type parameters - -| Name | -| :------ | -| `Config` | -| `Secrets` | -| `Params` | -| `ResultData` | - -#### Type declaration - -▸ (`options`): `Promise`<[`ActionTypeExecutorResult`](../interfaces/client._internal_namespace.ActionTypeExecutorResult.md)<`ResultData`\>\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `options` | [`ActionTypeExecutorOptions`](../interfaces/client._internal_namespace.ActionTypeExecutorOptions.md)<`Config`, `Secrets`, `Params`\> | - -##### Returns - -`Promise`<[`ActionTypeExecutorResult`](../interfaces/client._internal_namespace.ActionTypeExecutorResult.md)<`ResultData`\>\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:62 - -___ - -### FailedRunResult - -Ƭ **FailedRunResult**: [`SuccessfulRunResult`](client._internal_namespace.md#successfulrunresult) & { `error`: `Error` } - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:52 - -___ - -### FindCaseOptions - -Ƭ **FindCaseOptions**: [`CasesFindRequest`](client._internal_namespace.md#casesfindrequest) & [`SavedObjectFindOptionsKueryNode`](client._internal_namespace.md#savedobjectfindoptionskuerynode) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:125](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L125) - -___ - -### GetAllSpacesPurpose - -Ƭ **GetAllSpacesPurpose**: ``"any"`` \| ``"copySavedObjectsIntoSpace"`` \| ``"findSavedObjects"`` \| ``"shareSavedObjectsIntoSpace"`` - -The set of purposes to retrieve spaces: -- `any`: retrieves all spaces the user is authorized to see. -- `copySavedObjectsIntoSpace`: retrieves all spaces the user is authorized to copy saved objects into. -- `findSavedObjects`: retrieves all spaces the user is authorized to search within. -- `shareSavedObjectsIntoSpace`: retrieves all spaces the user is authorized to share saved objects into. - -#### Defined in - -x-pack/plugins/spaces/target/types/common/types.d.ts:74 - -___ - -### GetMigrationFunctionObjectFn - -Ƭ **GetMigrationFunctionObjectFn**: () => [`MigrateFunctionsObject`](client._internal_namespace.md#migratefunctionsobject) - -#### Type declaration - -▸ (): [`MigrateFunctionsObject`](client._internal_namespace.md#migratefunctionsobject) - -##### Returns - -[`MigrateFunctionsObject`](client._internal_namespace.md#migratefunctionsobject) - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:77 - -___ - -### GetServicesFunction - -Ƭ **GetServicesFunction**: (`request`: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)) => [`Services`](../interfaces/client._internal_namespace.Services.md) - -#### Type declaration - -▸ (`request`): [`Services`](../interfaces/client._internal_namespace.Services.md) - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md) | - -##### Returns - -[`Services`](../interfaces/client._internal_namespace.Services.md) - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:16 - -___ - -### GetSpaceFn - -Ƭ **GetSpaceFn**: (`request`: [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md)) => `Promise`<[`Space`](../interfaces/client._internal_namespace.Space.md) \| `undefined`\> - -#### Type declaration - -▸ (`request`): `Promise`<[`Space`](../interfaces/client._internal_namespace.Space.md) \| `undefined`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `request` | [`KibanaRequest`](../classes/client._internal_namespace.KibanaRequest.md) | - -##### Returns - -`Promise`<[`Space`](../interfaces/client._internal_namespace.Space.md) \| `undefined`\> - -#### Defined in - -[x-pack/plugins/cases/server/authorization/types.ts:21](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/authorization/types.ts#L21) - -___ - -### Headers - -Ƭ **Headers**: { [header in KnownHeaders]?: string \| string[] } & { [header: string]: `string` \| `string`[] \| `undefined`; } - -Http request headers to read. - -#### Defined in - -src/core/target/types/server/http/router/headers.d.ts:36 - -___ - -### IBasePath - -Ƭ **IBasePath**: `Pick`<[`BasePath`](../classes/client._internal_namespace.BasePath.md), keyof [`BasePath`](../classes/client._internal_namespace.BasePath.md)\> - -Access or manipulate the Kibana base path - -[BasePath](../classes/client._internal_namespace.BasePath.md) - -#### Defined in - -src/core/target/types/server/http/base_path_service.d.ts:50 - -___ - -### IEvent - -Ƭ **IEvent**: [`DeepPartial`](client._internal_namespace.md#deeppartial)<[`DeepWriteable`](client._internal_namespace.md#deepwriteable)<[`IValidatedEvent`](client._internal_namespace.md#ivalidatedevent)\>\> - -#### Defined in - -x-pack/plugins/event_log/target/types/generated/schemas.d.ts:10 - -___ - -### IKibanaMigrator - -Ƭ **IKibanaMigrator**: `Pick`<[`KibanaMigrator`](../classes/client._internal_namespace.KibanaMigrator.md), keyof [`KibanaMigrator`](../classes/client._internal_namespace.KibanaMigrator.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/kibana_migrator.d.ts:17 - -___ - -### ILicenseState - -Ƭ **ILicenseState**: `PublicMethodsOf`<[`LicenseState`](../classes/client._internal_namespace.LicenseState.md)\> - -#### Defined in - -x-pack/plugins/actions/target/types/server/lib/license_state.d.ts:6 - -___ - -### ISavedObjectTypeRegistry - -Ƭ **ISavedObjectTypeRegistry**: `Omit`<[`SavedObjectTypeRegistry`](../classes/client._internal_namespace.SavedObjectTypeRegistry.md), ``"registerType"``\> - -See [SavedObjectTypeRegistry](../classes/client._internal_namespace.SavedObjectTypeRegistry.md) for documentation. - -#### Defined in - -src/core/target/types/server/saved_objects/saved_objects_type_registry.d.ts:7 - -___ - -### ISavedObjectsRepository - -Ƭ **ISavedObjectsRepository**: `Pick`<[`SavedObjectsRepository`](../classes/client._internal_namespace.SavedObjectsRepository.md), keyof [`SavedObjectsRepository`](../classes/client._internal_namespace.SavedObjectsRepository.md)\> - -See [SavedObjectsRepository](../classes/client._internal_namespace.SavedObjectsRepository.md) - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/repository.d.ts:57 - -___ - -### IValidatedEvent - -Ƭ **IValidatedEvent**: `TypeOf` - -#### Defined in - -x-pack/plugins/event_log/target/types/generated/schemas.d.ts:9 - -___ - -### KibanaExecutionContext - -Ƭ **KibanaExecutionContext**: `Object` - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `description` | `string` | human readable description. For example, a vis title, action name | -| `id` | `string` | unique value to identify the source | -| `name` | `string` | public name of a user-facing feature | -| `parent?` | [`KibanaExecutionContext`](client._internal_namespace.md#kibanaexecutioncontext) | a context that spawned the current context. | -| `type` | `string` | Kibana application initated an operation. | -| `url?` | `string` | in browser - url to navigate to a current page, on server - endpoint path, for task: task SO url | - -#### Defined in - -src/core/target/types/types/execution_context.d.ts:5 - -___ - -### KibanaRequestRouteOptions - -Ƭ **KibanaRequestRouteOptions**<`Method`\>: `Method` extends ``"get"`` \| ``"options"`` ? `Required`<`Omit`<[`RouteConfigOptions`](../interfaces/client._internal_namespace.RouteConfigOptions.md)<`Method`\>, ``"body"``\>\> : `Required`<[`RouteConfigOptions`](../interfaces/client._internal_namespace.RouteConfigOptions.md)<`Method`\>\> - -Route options: If 'GET' or 'OPTIONS' method, body options won't be returned. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Method` | extends [`RouteMethod`](client._internal_namespace.md#routemethod) | - -#### Defined in - -src/core/target/types/server/http/router/request.d.ts:30 - -___ - -### KnownHeaders - -Ƭ **KnownHeaders**: [`KnownKeys`](client._internal_namespace.md#knownkeys)<`IncomingHttpHeaders`\> - -Set of well-known HTTP headers. - -#### Defined in - -src/core/target/types/server/http/router/headers.d.ts:31 - -___ - -### KnownKeys - -Ƭ **KnownKeys**<`T`\>: [`StringKeysAsVals`](client._internal_namespace.md#stringkeysasvals)<`T`\> extends { [\_ in keyof T]: infer U } ? `U` : `never` - -Creates a Union type of all known keys of a given interface. - -**`example`** -```ts -interface Person { - name: string; - age: number; - [attributes: string]: string | number; -} -type PersonKnownKeys = KnownKeys; // "age" | "name" -``` - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Defined in - -src/core/target/types/server/http/router/headers.d.ts:24 - -___ - -### LicenseCheckState - -Ƭ **LicenseCheckState**: ``"unavailable"`` \| ``"invalid"`` \| ``"valid"`` \| ``"expired"`` - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:1 - -___ - -### LicenseStatus - -Ƭ **LicenseStatus**: ``"active"`` \| ``"invalid"`` \| ``"expired"`` - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:13 - -___ - -### Mapper - -Ƭ **Mapper**<`T`\>: (`params`: `T`) => `Promise`<`T`\> - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Type declaration - -▸ (`params`): `Promise`<`T`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `T` | - -##### Returns - -`Promise`<`T`\> - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/lib/middleware.d.ts:2 - -___ - -### MigrateFunction - -Ƭ **MigrateFunction**<`FromVersion`, `ToVersion`\>: (`state`: `FromVersion`) => `ToVersion` - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `FromVersion` | extends `Serializable` = `SerializableRecord` | -| `ToVersion` | extends `Serializable` = `SerializableRecord` | - -#### Type declaration - -▸ (`state`): `ToVersion` - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `state` | `FromVersion` | - -##### Returns - -`ToVersion` - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:86 - -___ - -### MigrateFunctionsObject - -Ƭ **MigrateFunctionsObject**: `Object` - -Collection of migrations that a given type of persistable state object has -accumulated over time. Migration functions are keyed using semver version -of Kibana releases. - -#### Index signature - -▪ [semver: `string`]: [`MigrateFunction`](client._internal_namespace.md#migratefunction)<`any`, `any`\> - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:83 - -___ - -### MigrationResult - -Ƭ **MigrationResult**: { `status`: ``"skipped"`` } \| { `status`: ``"patched"`` } \| { `destIndex`: `string` ; `elapsedMs`: `number` ; `sourceIndex`: `string` ; `status`: ``"migrated"`` } - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/core/types.d.ts:2 - -___ - -### MigrationStatus - -Ƭ **MigrationStatus**: ``"waiting_to_start"`` \| ``"waiting_for_other_nodes"`` \| ``"running"`` \| ``"completed"`` - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/core/types.d.ts:1 - -___ - -### MutatingOperationRefreshSetting - -Ƭ **MutatingOperationRefreshSetting**: `boolean` \| ``"wait_for"`` - -Elasticsearch Refresh setting for mutating operation - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:132 - -___ - -### PatchCaseArgs - -Ƭ **PatchCaseArgs**: [`PatchCase`](../interfaces/client._internal_namespace.PatchCase.md) & [`ClientArgs`](../interfaces/client._internal_namespace.ClientArgs-1.md) - -#### Defined in - -[x-pack/plugins/cases/server/services/cases/index.ts:103](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/cases/index.ts#L103) - -___ - -### PersistableStateDefinition - -Ƭ **PersistableStateDefinition**<`P`\>: `Partial`<[`PersistableState`](../interfaces/client._internal_namespace.PersistableState.md)<`P`\>\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `P` | extends `SerializableRecord` = `SerializableRecord` | - -#### Defined in - -src/plugins/kibana_utils/target/types/common/persistable_state/types.d.ts:93 - -___ - -### PublicFeatures - -Ƭ **PublicFeatures**: `Record`<`string`, [`LicenseFeature`](../interfaces/client._internal_namespace.LicenseFeature.md)\> - -Provides information about feature availability for the current license. - -#### Defined in - -x-pack/plugins/licensing/target/types/common/types.d.ts:51 - -___ - -### RouteContentType - -Ƭ **RouteContentType**: ``"application/json"`` \| ``"application/*+json"`` \| ``"application/octet-stream"`` \| ``"application/x-www-form-urlencoded"`` \| ``"multipart/form-data"`` \| ``"text/*"`` - -The set of supported parseable Content-Types - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:27 - -___ - -### RouteMethod - -Ƭ **RouteMethod**: [`SafeRouteMethod`](client._internal_namespace.md#saferoutemethod) \| [`DestructiveRouteMethod`](client._internal_namespace.md#destructiveroutemethod) - -The set of common HTTP methods supported by Kibana routing. - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:17 - -___ - -### RouteValidationFunction - -Ƭ **RouteValidationFunction**<`T`\>: (`data`: `any`, `validationResult`: [`RouteValidationResultFactory`](../interfaces/client._internal_namespace.RouteValidationResultFactory.md)) => { `error?`: `never` ; `value`: `T` } \| { `error`: [`RouteValidationError`](../classes/client._internal_namespace.RouteValidationError.md) ; `value?`: `never` } - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Type declaration - -▸ (`data`, `validationResult`): { `error?`: `never` ; `value`: `T` } \| { `error`: [`RouteValidationError`](../classes/client._internal_namespace.RouteValidationError.md) ; `value?`: `never` } - -The custom validation function if @kbn/config-schema is not a valid solution for your specific plugin requirements. - -**`example`** - -The validation should look something like: -```typescript -interface MyExpectedBody { - bar: string; - baz: number; -} - -const myBodyValidation: RouteValidationFunction = (data, validationResult) => { - const { ok, badRequest } = validationResult; - const { bar, baz } = data || {}; - if (typeof bar === 'string' && typeof baz === 'number') { - return ok({ bar, baz }); - } else { - return badRequest('Wrong payload', ['body']); - } -} -``` - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `any` | -| `validationResult` | [`RouteValidationResultFactory`](../interfaces/client._internal_namespace.RouteValidationResultFactory.md) | - -##### Returns - -{ `error?`: `never` ; `value`: `T` } \| { `error`: [`RouteValidationError`](../classes/client._internal_namespace.RouteValidationError.md) ; `value?`: `never` } - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:43 - -___ - -### RouteValidationSpec - -Ƭ **RouteValidationSpec**<`T`\>: `ObjectType` \| `Type`<`T`\> \| [`RouteValidationFunction`](client._internal_namespace.md#routevalidationfunction)<`T`\> - -Allowed property validation options: either @kbn/config-schema validations or custom validation functions - -See [RouteValidationFunction](client._internal_namespace.md#routevalidationfunction) for custom validation. - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:57 - -___ - -### RouteValidatorFullConfig - -Ƭ **RouteValidatorFullConfig**<`P`, `Q`, `B`\>: [`RouteValidatorConfig`](../interfaces/client._internal_namespace.RouteValidatorConfig.md)<`P`, `Q`, `B`\> & [`RouteValidatorOptions`](../interfaces/client._internal_namespace.RouteValidatorOptions.md) - -Route validations config and options merged into one object - -#### Type parameters - -| Name | -| :------ | -| `P` | -| `Q` | -| `B` | - -#### Defined in - -src/core/target/types/server/http/router/validator/validator.d.ts:101 - -___ - -### RunFunction - -Ƭ **RunFunction**: () => `Promise`<[`RunResult`](client._internal_namespace.md#runresult) \| `undefined` \| `void`\> - -#### Type declaration - -▸ (): `Promise`<[`RunResult`](client._internal_namespace.md#runresult) \| `undefined` \| `void`\> - -##### Returns - -`Promise`<[`RunResult`](client._internal_namespace.md#runresult) \| `undefined` \| `void`\> - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:64 - -___ - -### RunResult - -Ƭ **RunResult**: [`FailedRunResult`](client._internal_namespace.md#failedrunresult) \| [`SuccessfulRunResult`](client._internal_namespace.md#successfulrunresult) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:59 - -___ - -### SafeRouteMethod - -Ƭ **SafeRouteMethod**: ``"get"`` \| ``"options"`` - -Set of HTTP methods not changing the state of the server. - -#### Defined in - -src/core/target/types/server/http/router/route.d.ts:12 - -___ - -### SavedObjectAttribute - -Ƭ **SavedObjectAttribute**: [`SavedObjectAttributeSingle`](client._internal_namespace.md#savedobjectattributesingle) \| [`SavedObjectAttributeSingle`](client._internal_namespace.md#savedobjectattributesingle)[] - -Type definition for a Saved Object attribute value - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:12 - -___ - -### SavedObjectAttributeSingle - -Ƭ **SavedObjectAttributeSingle**: `string` \| `number` \| `boolean` \| ``null`` \| `undefined` \| [`SavedObjectAttributes`](../interfaces/client._internal_namespace.SavedObjectAttributes.md) - -Don't use this type, it's simply a helper type for [SavedObjectAttribute](client._internal_namespace.md#savedobjectattribute) - -#### Defined in - -src/core/target/types/types/saved_objects.d.ts:6 - -___ - -### SavedObjectFindOptions - -Ƭ **SavedObjectFindOptions**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/saved_object.ts:72](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/saved_object.ts#L72) - -___ - -### SavedObjectFindOptionsKueryNode - -Ƭ **SavedObjectFindOptionsKueryNode**: `Omit`<[`SavedObjectFindOptions`](client._internal_namespace.md#savedobjectfindoptions), ``"filter"``\> & { `filter?`: `KueryNode` } - -#### Defined in - -[x-pack/plugins/cases/server/common/types.ts:19](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/common/types.ts#L19) - -___ - -### SavedObjectMigrationFn - -Ƭ **SavedObjectMigrationFn**<`InputAttributes`, `MigratedAttributes`\>: (`doc`: [`SavedObjectUnsanitizedDoc`](client._internal_namespace.md#savedobjectunsanitizeddoc)<`InputAttributes`\>, `context`: [`SavedObjectMigrationContext`](../interfaces/client._internal_namespace.SavedObjectMigrationContext.md)) => [`SavedObjectUnsanitizedDoc`](client._internal_namespace.md#savedobjectunsanitizeddoc)<`MigratedAttributes`\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `InputAttributes` | `unknown` | -| `MigratedAttributes` | `unknown` | - -#### Type declaration - -▸ (`doc`, `context`): [`SavedObjectUnsanitizedDoc`](client._internal_namespace.md#savedobjectunsanitizeddoc)<`MigratedAttributes`\> - -A migration function for a [saved object type](../interfaces/client._internal_namespace.SavedObjectsType.md) -used to migrate it to a given version - -**`example`** -```typescript -interface TypeV1Attributes { - someKey: string; - obsoleteProperty: number; -} - -interface TypeV2Attributes { - someKey: string; - newProperty: string; -} - -const migrateToV2: SavedObjectMigrationFn = (doc, { log }) => { - const { obsoleteProperty, ...otherAttributes } = doc.attributes; - // instead of mutating `doc` we make a shallow copy so that we can use separate types for the input - // and output attributes. We don't need to make a deep copy, we just need to ensure that obsolete - // attributes are not present on the returned doc. - return { - ...doc, - attributes: { - ...otherAttributes, - newProperty: migrate(obsoleteProperty), - }, - }; -}; -``` - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `doc` | [`SavedObjectUnsanitizedDoc`](client._internal_namespace.md#savedobjectunsanitizeddoc)<`InputAttributes`\> | -| `context` | [`SavedObjectMigrationContext`](../interfaces/client._internal_namespace.SavedObjectMigrationContext.md) | - -##### Returns - -[`SavedObjectUnsanitizedDoc`](client._internal_namespace.md#savedobjectunsanitizeddoc)<`MigratedAttributes`\> - -#### Defined in - -src/core/target/types/server/saved_objects/migrations/types.d.ts:39 - -___ - -### SavedObjectTypeExcludeFromUpgradeFilterHook - -Ƭ **SavedObjectTypeExcludeFromUpgradeFilterHook**: (`toolkit`: { `readonlyEsClient`: `Pick`<[`ElasticsearchClient`](client._internal_namespace.md#elasticsearchclient), ``"search"``\> }) => `estypes.QueryDslQueryContainer` \| `Promise`<`estypes.QueryDslQueryContainer`\> - -#### Type declaration - -▸ (`toolkit`): `estypes.QueryDslQueryContainer` \| `Promise`<`estypes.QueryDslQueryContainer`\> - -If defined, allows a type to run a search query and return a query filter that may match any documents which may -be excluded from the next migration upgrade process. Useful for cleaning up large numbers of old documents which -are no longer needed and may slow the migration process. - -If this hook fails, the migration will proceed without these documents having been filtered out, so this -should not be used as a guarantee that these documents have been deleted. - -**`alpha`** Experimental and subject to change - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `toolkit` | `Object` | -| `toolkit.readonlyEsClient` | `Pick`<[`ElasticsearchClient`](client._internal_namespace.md#elasticsearchclient), ``"search"``\> | - -##### Returns - -`estypes.QueryDslQueryContainer` \| `Promise`<`estypes.QueryDslQueryContainer`\> - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:479 - -___ - -### SavedObjectUnsanitizedDoc - -Ƭ **SavedObjectUnsanitizedDoc**<`T`\>: [`SavedObjectDoc`](../interfaces/client._internal_namespace.SavedObjectDoc.md)<`T`\> & `Partial`<[`Referencable`](../interfaces/client._internal_namespace.Referencable.md)\> - -Describes Saved Object documents from Kibana < 7.0.0 which don't have a -`references` root property defined. This type should only be used in -migrations. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Defined in - -src/core/target/types/server/saved_objects/serialization/types.d.ts:49 - -___ - -### SavedObjectsClientContract - -Ƭ **SavedObjectsClientContract**: `Pick`<[`SavedObjectsClient`](../classes/client._internal_namespace.SavedObjectsClient.md), keyof [`SavedObjectsClient`](../classes/client._internal_namespace.SavedObjectsClient.md)\> - -Saved Objects is Kibana's data persisentence mechanism allowing plugins to -use Elasticsearch for storing plugin state. - -## SavedObjectsClient errors - -Since the SavedObjectsClient has its hands in everything we -are a little paranoid about the way we present errors back to -to application code. Ideally, all errors will be either: - - 1. Caused by bad implementation (ie. undefined is not a function) and - as such unpredictable - 2. An error that has been classified and decorated appropriately - by the decorators in [SavedObjectsErrorHelpers](../classes/client._internal_namespace.SavedObjectsErrorHelpers.md) - -Type 1 errors are inevitable, but since all expected/handle-able errors -should be Type 2 the `isXYZError()` helpers exposed at -`SavedObjectsErrorHelpers` should be used to understand and manage error -responses from the `SavedObjectsClient`. - -Type 2 errors are decorated versions of the source error, so if -the elasticsearch client threw an error it will be decorated based -on its type. That means that rather than looking for `error.body.error.type` or -doing substring checks on `error.body.error.reason`, just use the helpers to -understand the meaning of the error: - - ```js - if (SavedObjectsErrorHelpers.isNotFoundError(error)) { - // handle 404 - } - - if (SavedObjectsErrorHelpers.isNotAuthorizedError(error)) { - // 401 handling should be automatic, but in case you wanted to know - } - - // always rethrow the error unless you handle it - throw error; - ``` - -### 404s from missing index - -From the perspective of application code and APIs the SavedObjectsClient is -a black box that persists objects. One of the internal details that users have -no control over is that we use an elasticsearch index for persistence and that -index might be missing. - -At the time of writing we are in the process of transitioning away from the -operating assumption that the SavedObjects index is always available. Part of -this transition is handling errors resulting from an index missing. These used -to trigger a 500 error in most cases, and in others cause 404s with different -error messages. - -From my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The -object the request/call was targeting could not be found. This is why #14141 -takes special care to ensure that 404 errors are generic and don't distinguish -between index missing or document missing. - -See [SavedObjectsClient](../classes/client._internal_namespace.SavedObjectsClient.md) -See [SavedObjectsErrorHelpers](../classes/client._internal_namespace.SavedObjectsErrorHelpers.md) - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:195 - -___ - -### SavedObjectsCreatePointInTimeFinderOptions - -Ƭ **SavedObjectsCreatePointInTimeFinderOptions**: `Omit`<[`SavedObjectsFindOptions`](../interfaces/client._internal_namespace.SavedObjectsFindOptions.md), ``"page"`` \| ``"pit"`` \| ``"searchAfter"``\> - -#### Defined in - -src/core/target/types/server/saved_objects/service/lib/point_in_time_finder.d.ts:7 - -___ - -### SavedObjectsExportTransform - -Ƭ **SavedObjectsExportTransform**<`T`\>: (`context`: [`SavedObjectsExportTransformContext`](../interfaces/client._internal_namespace.SavedObjectsExportTransformContext.md), `objects`: [`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>[]) => [`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)[] \| `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)[]\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Type declaration - -▸ (`context`, `objects`): [`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)[] \| `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)[]\> - -Transformation function used to mutate the exported objects of the associated type. - -A type's export transform function will be executed once per user-initiated export, -for all objects of that type. - -**`example`** -Registering a transform function changing the object's attributes during the export -```ts -// src/plugins/my_plugin/server/plugin.ts -import { myType } from './saved_objects'; - -export class Plugin() { - setup: (core: CoreSetup) => { - core.savedObjects.registerType({ - ...myType, - management: { - ...myType.management, - onExport: (ctx, objects) => { - return objects.map((obj) => ({ - ...obj, - attributes: { - ...obj.attributes, - enabled: false, - } - }) - } - }, - }); - } -} -``` - -**`example`** -Registering a transform function adding additional objects to the export -```ts -// src/plugins/my_plugin/server/plugin.ts -import { myType } from './saved_objects'; - -export class Plugin() { - setup: (core: CoreSetup) => { - const savedObjectStartContractPromise = getStartServices().then( - ([{ savedObjects: savedObjectsStart }]) => savedObjectsStart - ); - - core.savedObjects.registerType({ - ...myType, - management: { - ...myType.management, - onExport: async (ctx, objects) => { - const { getScopedClient } = await savedObjectStartContractPromise; - const client = getScopedClient(ctx.request); - - const depResponse = await client.find({ - type: 'my-nested-object', - hasReference: objs.map(({ id, type }) => ({ id, type })), - }); - - return [...objs, ...depResponse.saved_objects]; - } - }, - }); - } -} -``` - -**`remarks`** Trying to change an object's id or type during the transform will result in - a runtime error during the export process. - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `context` | [`SavedObjectsExportTransformContext`](../interfaces/client._internal_namespace.SavedObjectsExportTransformContext.md) | -| `objects` | [`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>[] | - -##### Returns - -[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)[] \| `Promise`<[`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)[]\> - -#### Defined in - -src/core/target/types/server/saved_objects/export/types.d.ts:160 - -___ - -### SavedObjectsExportablePredicate - -Ƭ **SavedObjectsExportablePredicate**<`Attributes`\>: (`obj`: [`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`Attributes`\>) => `boolean` - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Attributes` | `unknown` | - -#### Type declaration - -▸ (`obj`): `boolean` - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `obj` | [`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`Attributes`\> | - -##### Returns - -`boolean` - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:467 - -___ - -### SavedObjectsFieldMapping - -Ƭ **SavedObjectsFieldMapping**: `estypes.MappingProperty` & { `dynamic?`: ``false`` \| ``"strict"`` } - -Describe a [saved object type mapping](../interfaces/client._internal_namespace.SavedObjectsTypeMappingDefinition.md) field. - -Please refer to [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html) -For the mapping documentation - -#### Defined in - -src/core/target/types/server/saved_objects/mappings/types.d.ts:89 - -___ - -### SavedObjectsImportHook - -Ƭ **SavedObjectsImportHook**<`T`\>: (`objects`: [`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>[]) => [`SavedObjectsImportHookResult`](../interfaces/client._internal_namespace.SavedObjectsImportHookResult.md) \| `Promise`<[`SavedObjectsImportHookResult`](../interfaces/client._internal_namespace.SavedObjectsImportHookResult.md)\> - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `unknown` | - -#### Type declaration - -▸ (`objects`): [`SavedObjectsImportHookResult`](../interfaces/client._internal_namespace.SavedObjectsImportHookResult.md) \| `Promise`<[`SavedObjectsImportHookResult`](../interfaces/client._internal_namespace.SavedObjectsImportHookResult.md)\> - -A hook associated with a specific saved object type, that will be invoked during -the import process. The hook will have access to the objects of the registered type. - -Currently, the only supported feature for import hooks is to return warnings to be displayed -in the UI when the import succeeds. - -**`remark`** The only interactions the hook can have with the import process is via the hook's - response. Mutating the objects inside the hook's code will have no effect. - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `objects` | [`SavedObject`](../interfaces/client._internal_namespace.SavedObject.md)<`T`\>[] | - -##### Returns - -[`SavedObjectsImportHookResult`](../interfaces/client._internal_namespace.SavedObjectsImportHookResult.md) \| `Promise`<[`SavedObjectsImportHookResult`](../interfaces/client._internal_namespace.SavedObjectsImportHookResult.md)\> - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:227 - -___ - -### SavedObjectsImportWarning - -Ƭ **SavedObjectsImportWarning**: [`SavedObjectsImportSimpleWarning`](../interfaces/client._internal_namespace.SavedObjectsImportSimpleWarning.md) \| [`SavedObjectsImportActionRequiredWarning`](../interfaces/client._internal_namespace.SavedObjectsImportActionRequiredWarning.md) - -Composite type of all the possible types of import warnings. - -See [SavedObjectsImportSimpleWarning](../interfaces/client._internal_namespace.SavedObjectsImportSimpleWarning.md) and [SavedObjectsImportActionRequiredWarning](../interfaces/client._internal_namespace.SavedObjectsImportActionRequiredWarning.md) -for more details. - -#### Defined in - -src/core/target/types/server/saved_objects/import/types.d.ts:203 - -___ - -### SavedObjectsNamespaceType - -Ƭ **SavedObjectsNamespaceType**: ``"single"`` \| ``"multiple"`` \| ``"multiple-isolated"`` \| ``"agnostic"`` - -The namespace type dictates how a saved object can be interacted in relation to namespaces. Each type is mutually exclusive: - * single (default): This type of saved object is namespace-isolated, e.g., it exists in only one namespace. - * multiple: This type of saved object is shareable, e.g., it can exist in one or more namespaces. - * multiple-isolated: This type of saved object is namespace-isolated, e.g., it exists in only one namespace, but object IDs must be - unique across all namespaces. This is intended to be an intermediate step when objects with a "single" namespace type are being - converted to a "multiple" namespace type. In other words, objects with a "multiple-isolated" namespace type will be *share-capable*, - but will not actually be shareable until the namespace type is changed to "multiple". - * agnostic: This type of saved object is global. - -#### Defined in - -src/core/target/types/server/saved_objects/types.d.ts:208 - -___ - -### SavedObjectsValidationSpec - -Ƭ **SavedObjectsValidationSpec**: `ObjectType` - -Allows for validating properties using @kbn/config-schema validations. - -#### Defined in - -src/core/target/types/server/saved_objects/validation/types.d.ts:7 - -___ - -### SpaceIdToNamespaceFunction - -Ƭ **SpaceIdToNamespaceFunction**: (`spaceId?`: `string`) => `string` \| `undefined` - -#### Type declaration - -▸ (`spaceId?`): `string` \| `undefined` - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `spaceId?` | `string` | - -##### Returns - -`string` \| `undefined` - -#### Defined in - -x-pack/plugins/actions/target/types/server/types.d.ts:18 - -___ - -### StringKeysAsVals - -Ƭ **StringKeysAsVals**<`T`\>: { [K in keyof T]: string extends K ? never : number extends K ? never : K } - -Converts an object type to a new object type where each string -key is copied to the values of the object, and non string keys are -given a `never` value. This allows us to map over the values and -get the list of all string keys on a type in `KnownKeys` - -#### Type parameters - -| Name | -| :------ | -| `T` | - -#### Defined in - -src/core/target/types/server/http/router/headers.d.ts:9 - -___ - -### SubFeaturePrivilegeGroupType - -Ƭ **SubFeaturePrivilegeGroupType**: ``"mutually_exclusive"`` \| ``"independent"`` - -The type of privilege group. -- `mutually_exclusive`:: - Users will be able to select at most one privilege within this group. - Privileges must be specified in descending order of permissiveness (e.g. `All`, `Read`, not `Read`, `All) -- `independent`:: - Users will be able to select any combination of privileges within this group. - -#### Defined in - -x-pack/plugins/features/target/types/common/sub_feature.d.ts:21 - -___ - -### SuccessfulRunResult - -Ƭ **SuccessfulRunResult**: { `state`: `Record`<`string`, `unknown`\> } & { `runAt?`: `Date` ; `schedule?`: `never` } \| { `runAt?`: `never` ; `schedule?`: [`IntervalSchedule`](../interfaces/client._internal_namespace.IntervalSchedule.md) } - -The return value of a task's run function should be a promise of RunResult. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:28 - -___ - -### TaskDefinitionRegistry - -Ƭ **TaskDefinitionRegistry**: `Record`<`string`, [`TaskRegisterDefinition`](../interfaces/client._internal_namespace.TaskRegisterDefinition.md)\> - -A mapping of task type id to the task definition. - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task_type_dictionary.d.ts:52 - -___ - -### TaskRunCreatorFunction - -Ƭ **TaskRunCreatorFunction**: (`context`: [`RunContext`](../interfaces/client._internal_namespace.RunContext.md)) => [`CancellableTask`](../interfaces/client._internal_namespace.CancellableTask.md) - -#### Type declaration - -▸ (`context`): [`CancellableTask`](../interfaces/client._internal_namespace.CancellableTask.md) - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `context` | [`RunContext`](../interfaces/client._internal_namespace.RunContext.md) | - -##### Returns - -[`CancellableTask`](../interfaces/client._internal_namespace.CancellableTask.md) - -#### Defined in - -x-pack/plugins/task_manager/target/types/server/task.d.ts:70 - -___ - -### UpdateAttachmentArgs - -Ƭ **UpdateAttachmentArgs**: [`UpdateArgs`](../interfaces/client._internal_namespace.UpdateArgs.md) & [`ClientArgs`](../interfaces/client._internal_namespace.ClientArgs-1.md) - -#### Defined in - -[x-pack/plugins/cases/server/services/attachments/index.ts:59](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/attachments/index.ts#L59) - -___ - -### UserAction - -Ƭ **UserAction**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/user_actions/index.ts:85](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/user_actions/index.ts#L85) - -___ - -### UserActionParameters - -Ƭ **UserActionParameters**<`T`\>: [`BuilderParameters`](../interfaces/client._internal_namespace.BuilderParameters.md)[`T`][``"parameters"``] & [`CommonArguments`](../interfaces/client._internal_namespace.CommonArguments.md) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | extends keyof [`BuilderParameters`](../interfaces/client._internal_namespace.BuilderParameters.md) | - -#### Defined in - -[x-pack/plugins/cases/server/services/user_actions/types.ts:71](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/services/user_actions/types.ts#L71) - -___ - -### UserActionTypes - -Ƭ **UserActionTypes**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/user_actions/index.ts:86](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/user_actions/index.ts#L86) - -## Variables - -### ActionTypesRt - -• **ActionTypesRt**: `KeyofC`<{ `comment`: ``"comment"`` = 'comment'; `connector`: ``"connector"`` = 'connector'; `create_case`: ``"create_case"`` = 'create\_case'; `delete_case`: ``"delete_case"`` = 'delete\_case'; `description`: ``"description"`` = 'description'; `pushed`: ``"pushed"`` = 'pushed'; `settings`: ``"settings"`` = 'settings'; `status`: ``"status"`` = 'status'; `tags`: ``"tags"`` = 'tags'; `title`: ``"title"`` = 'title' }\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/user_actions/common.ts:35](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/user_actions/common.ts#L35) - -___ - -### ActionsRt - -• **ActionsRt**: `KeyofC`<{ `add`: ``"add"`` = 'add'; `create`: ``"create"`` = 'create'; `delete`: ``"delete"`` = 'delete'; `push_to_service`: ``"push_to_service"`` = 'push\_to\_service'; `update`: ``"update"`` = 'update' }\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/user_actions/common.ts:36](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/user_actions/common.ts#L36) - -___ - -### CasesFindRequestRt - -• **CasesFindRequestRt**: `PartialC`<{ `defaultSearchOperator`: `UnionC`<[`LiteralC`<``"AND"``\>, `LiteralC`<``"OR"``\>]\> ; `fields`: `ArrayC`<`StringC`\> ; `owner`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `page`: `Type`<`number`, `string`, `unknown`\> = NumberFromString; `perPage`: `Type`<`number`, `string`, `unknown`\> = NumberFromString; `reporters`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `search`: `StringC` = rt.string; `searchFields`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `sortField`: `StringC` = rt.string; `sortOrder`: `UnionC`<[`LiteralC`<``"desc"``\>, `LiteralC`<``"asc"``\>]\> ; `status`: `UnionC`<[`LiteralC`<[`open`](../enums/client._internal_namespace.CaseStatuses.md#open)\>, `LiteralC`<`any`[`any`]\>, `LiteralC`<[`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed)\>]\> = CaseStatusRt; `tags`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> }\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:136](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L136) - -___ - -### EventSchema - -• **EventSchema**: `Type` - -#### Defined in - -x-pack/plugins/event_log/target/types/generated/schemas.d.ts:11 - -___ - -### SavedObjectFindOptionsRt - -• **SavedObjectFindOptionsRt**: `PartialC`<{ `defaultSearchOperator`: `UnionC`<[`LiteralC`<``"AND"``\>, `LiteralC`<``"OR"``\>]\> ; `fields`: `ArrayC`<`StringC`\> ; `filter`: `StringC` = rt.string; `hasReference`: `UnionC`<[`ArrayC`<`TypeC`<{ `id`: `StringC` = rt.string; `type`: `StringC` = rt.string }\>\>, `TypeC`<{ `id`: `StringC` = rt.string; `type`: `StringC` = rt.string }\>]\> ; `hasReferenceOperator`: `UnionC`<[`LiteralC`<``"AND"``\>, `LiteralC`<``"OR"``\>]\> ; `page`: `Type`<`number`, `string`, `unknown`\> = NumberFromString; `perPage`: `Type`<`number`, `string`, `unknown`\> = NumberFromString; `search`: `StringC` = rt.string; `searchFields`: `ArrayC`<`StringC`\> ; `sortField`: `StringC` = rt.string; `sortOrder`: `UnionC`<[`LiteralC`<``"desc"``\>, `LiteralC`<``"asc"``\>]\> }\> - -#### Defined in - -[x-pack/plugins/cases/common/api/saved_object.ts:25](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/saved_object.ts#L25) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/client.md b/x-pack/plugins/cases/docs/cases_client/modules/client.md deleted file mode 100644 index b03a7ba7673bb..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/client.md +++ /dev/null @@ -1,13 +0,0 @@ -[Cases Client API Interface](../README.md) / client - -# Module: client - -## Table of contents - -### Namespaces - -- [\_internal\_namespace](client._internal_namespace.md) - -### Classes - -- [CasesClient](../classes/client.CasesClient.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/configure_client._internal_namespace.md b/x-pack/plugins/cases/docs/cases_client/modules/configure_client._internal_namespace.md deleted file mode 100644 index cb22acb5a298c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/configure_client._internal_namespace.md +++ /dev/null @@ -1,13 +0,0 @@ -[Cases Client API Interface](../README.md) / [configure/client](configure_client.md) / \_internal\_namespace - -# Namespace: \_internal\_namespace - -[configure/client](configure_client.md)._internal_namespace - -## Table of contents - -### Interfaces - -- [CreateMappingsArgs](../interfaces/configure_client._internal_namespace.CreateMappingsArgs.md) -- [MappingsArgs](../interfaces/configure_client._internal_namespace.MappingsArgs.md) -- [UpdateMappingsArgs](../interfaces/configure_client._internal_namespace.UpdateMappingsArgs.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/configure_client.md b/x-pack/plugins/cases/docs/cases_client/modules/configure_client.md deleted file mode 100644 index 690afd51a4f65..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/configure_client.md +++ /dev/null @@ -1,37 +0,0 @@ -[Cases Client API Interface](../README.md) / configure/client - -# Module: configure/client - -## Table of contents - -### Namespaces - -- [\_internal\_namespace](configure_client._internal_namespace.md) - -### Interfaces - -- [ConfigureSubClient](../interfaces/configure_client.ConfigureSubClient.md) - -### Functions - -- [getConnectors](configure_client.md#getconnectors) - -## Functions - -### getConnectors - -▸ **getConnectors**(`__namedParameters`): `Promise`<[`FindActionResult`](../interfaces/client._internal_namespace.FindActionResult.md)[]\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | [`CasesClientArgs`](../interfaces/client._internal_namespace.CasesClientArgs.md) | - -#### Returns - -`Promise`<[`FindActionResult`](../interfaces/client._internal_namespace.FindActionResult.md)[]\> - -#### Defined in - -[x-pack/plugins/cases/server/client/configure/client.ts:206](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/server/client/configure/client.ts#L206) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/metrics_client._internal_namespace.md b/x-pack/plugins/cases/docs/cases_client/modules/metrics_client._internal_namespace.md deleted file mode 100644 index 318b517747494..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/metrics_client._internal_namespace.md +++ /dev/null @@ -1,11 +0,0 @@ -[Cases Client API Interface](../README.md) / [metrics/client](metrics_client.md) / \_internal\_namespace - -# Namespace: \_internal\_namespace - -[metrics/client](metrics_client.md)._internal_namespace - -## Table of contents - -### Interfaces - -- [CaseMetricsParams](../interfaces/metrics_client._internal_namespace.CaseMetricsParams.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/metrics_client.md b/x-pack/plugins/cases/docs/cases_client/modules/metrics_client.md deleted file mode 100644 index c4c7354ba5afe..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/metrics_client.md +++ /dev/null @@ -1,13 +0,0 @@ -[Cases Client API Interface](../README.md) / metrics/client - -# Module: metrics/client - -## Table of contents - -### Namespaces - -- [\_internal\_namespace](metrics_client._internal_namespace.md) - -### Interfaces - -- [MetricsSubClient](../interfaces/metrics_client.MetricsSubClient.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/stats_client.md b/x-pack/plugins/cases/docs/cases_client/modules/stats_client.md deleted file mode 100644 index f0632f6ca0069..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/stats_client.md +++ /dev/null @@ -1,9 +0,0 @@ -[Cases Client API Interface](../README.md) / stats/client - -# Module: stats/client - -## Table of contents - -### Interfaces - -- [StatsSubClient](../interfaces/stats_client.StatsSubClient.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/typedoc_interfaces._internal_namespace.md b/x-pack/plugins/cases/docs/cases_client/modules/typedoc_interfaces._internal_namespace.md deleted file mode 100644 index 38b2fc2ea5150..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/typedoc_interfaces._internal_namespace.md +++ /dev/null @@ -1,277 +0,0 @@ -[Cases Client API Interface](../README.md) / [typedoc\_interfaces](typedoc_interfaces.md) / \_internal\_namespace - -# Namespace: \_internal\_namespace - -[typedoc_interfaces](typedoc_interfaces.md)._internal_namespace - -## Table of contents - -### Type aliases - -- [AllCommentsResponse](typedoc_interfaces._internal_namespace.md#allcommentsresponse) -- [CasePostRequest](typedoc_interfaces._internal_namespace.md#casepostrequest) -- [CaseResolveResponse](typedoc_interfaces._internal_namespace.md#caseresolveresponse) -- [CaseResponse](typedoc_interfaces._internal_namespace.md#caseresponse) -- [CaseUserActionsResponse](typedoc_interfaces._internal_namespace.md#caseuseractionsresponse) -- [CasesConfigurePatch](typedoc_interfaces._internal_namespace.md#casesconfigurepatch) -- [CasesConfigureRequest](typedoc_interfaces._internal_namespace.md#casesconfigurerequest) -- [CasesConfigureResponse](typedoc_interfaces._internal_namespace.md#casesconfigureresponse) -- [CasesFindResponse](typedoc_interfaces._internal_namespace.md#casesfindresponse) -- [CasesPatchRequest](typedoc_interfaces._internal_namespace.md#casespatchrequest) -- [CasesResponse](typedoc_interfaces._internal_namespace.md#casesresponse) -- [CommentsResponse](typedoc_interfaces._internal_namespace.md#commentsresponse) - -### Variables - -- [AllCommentsResponseRt](typedoc_interfaces._internal_namespace.md#allcommentsresponsert) -- [CaseConfigureResponseRt](typedoc_interfaces._internal_namespace.md#caseconfigureresponsert) -- [CasePostRequestRt](typedoc_interfaces._internal_namespace.md#casepostrequestrt) -- [CaseResolveResponseRt](typedoc_interfaces._internal_namespace.md#caseresolveresponsert) -- [CaseResponseRt](typedoc_interfaces._internal_namespace.md#caseresponsert) -- [CaseUserActionsResponseRt](typedoc_interfaces._internal_namespace.md#caseuseractionsresponsert) -- [CasesConfigurePatchRt](typedoc_interfaces._internal_namespace.md#casesconfigurepatchrt) -- [CasesConfigureRequestRt](typedoc_interfaces._internal_namespace.md#casesconfigurerequestrt) -- [CasesFindResponseRt](typedoc_interfaces._internal_namespace.md#casesfindresponsert) -- [CasesPatchRequestRt](typedoc_interfaces._internal_namespace.md#casespatchrequestrt) -- [CasesResponseRt](typedoc_interfaces._internal_namespace.md#casesresponsert) -- [CommentsResponseRt](typedoc_interfaces._internal_namespace.md#commentsresponsert) - -## Type aliases - -### AllCommentsResponse - -Ƭ **AllCommentsResponse**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/comment.ts:166](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/comment.ts#L166) - -___ - -### CasePostRequest - -Ƭ **CasePostRequest**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:280](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L280) - -___ - -### CaseResolveResponse - -Ƭ **CaseResolveResponse**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:282](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L282) - -___ - -### CaseResponse - -Ƭ **CaseResponse**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:281](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L281) - -___ - -### CaseUserActionsResponse - -Ƭ **CaseUserActionsResponse**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/user_actions/index.ts:82](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/user_actions/index.ts#L82) - -___ - -### CasesConfigurePatch - -Ƭ **CasesConfigurePatch**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/configure.ts:81](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/configure.ts#L81) - -___ - -### CasesConfigureRequest - -Ƭ **CasesConfigureRequest**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/configure.ts:80](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/configure.ts#L80) - -___ - -### CasesConfigureResponse - -Ƭ **CasesConfigureResponse**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/configure.ts:83](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/configure.ts#L83) - -___ - -### CasesFindResponse - -Ƭ **CasesFindResponse**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:286](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L286) - -___ - -### CasesPatchRequest - -Ƭ **CasesPatchRequest**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:288](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L288) - -___ - -### CasesResponse - -Ƭ **CasesResponse**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:283](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L283) - -___ - -### CommentsResponse - -Ƭ **CommentsResponse**: `rt.TypeOf` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/comment.ts:167](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/comment.ts#L167) - -## Variables - -### AllCommentsResponseRt - -• **AllCommentsResponseRt**: `ArrayC`<`IntersectionC`<[`UnionC`<[`IntersectionC`<[`TypeC`<{ `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`user`](client._internal_namespace.md#user)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `alertId`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `index`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `owner`: `StringC` = rt.string; `rule`: `TypeC`<{ `id`: `UnionC`<[`StringC`, `NullC`]\> ; `name`: `UnionC`<[`StringC`, `NullC`]\> }\> ; `type`: `LiteralC`<[`alert`](client._internal_namespace.md#alert)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `actions`: `TypeC`<{ `targets`: `ArrayC`<`TypeC`<{ `endpointId`: `StringC` = rt.string; `hostname`: `StringC` = rt.string }\>\> ; `type`: `StringC` = rt.string }\> ; `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`actions`](client._internal_namespace.md#actions)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `version`: `StringC` = rt.string }\>]\>\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/comment.ts:150](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/comment.ts#L150) - -___ - -### CaseConfigureResponseRt - -• **CaseConfigureResponseRt**: `IntersectionC`<[`IntersectionC`<[`IntersectionC`<[`TypeC`<{ `closure_type`: `UnionC`<[`LiteralC`<``"close-by-user"``\>, `LiteralC`<``"close-by-pushing"``\>]\> = ClosureTypeRT; `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt }\>, `TypeC`<{ `owner`: `StringC` = rt.string }\>]\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `TypeC`<{ `mappings`: `ArrayC`<`TypeC`<{ `action_type`: `UnionC`<[`LiteralC`<``"append"``\>, `LiteralC`<``"nothing"``\>, `LiteralC`<``"overwrite"``\>]\> = ActionTypeRT; `source`: `UnionC`<[`LiteralC`<``"title"``\>, `LiteralC`<``"description"``\>, `LiteralC`<``"comments"``\>]\> = CaseFieldRT; `target`: `UnionC`<[`StringC`, `LiteralC`<``"not_mapped"``\>]\> = ThirdPartyFieldRT }\>\> ; `owner`: `StringC` = rt.string }\>, `TypeC`<{ `error`: `UnionC`<[`StringC`, `NullC`]\> ; `id`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `version`: `StringC` = rt.string }\>]\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/configure.ts:53](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/configure.ts#L53) - -___ - -### CasePostRequestRt - -• **CasePostRequestRt**: `TypeC`<{ `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt; `description`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `settings`: `TypeC`<{ `syncAlerts`: `BooleanC` = rt.boolean }\> = SettingsRt; `tags`: `ArrayC`<`StringC`\> ; `title`: `StringC` = rt.string }\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:108](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L108) - -___ - -### CaseResolveResponseRt - -• **CaseResolveResponseRt**: `IntersectionC`<[`TypeC`<{ `case`: `IntersectionC`<[`IntersectionC`<[`TypeC`<{ `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt; `description`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `settings`: `TypeC`<{ `syncAlerts`: `BooleanC` = rt.boolean }\> = SettingsRt; `status`: `UnionC`<[`LiteralC`<[`open`](../enums/client._internal_namespace.CaseStatuses.md#open)\>, `LiteralC`<`any`[`any`]\>, `LiteralC`<[`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed)\>]\> = CaseStatusRt; `tags`: `ArrayC`<`StringC`\> ; `title`: `StringC` = rt.string }\>, `TypeC`<{ `closed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `closed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `external_service`: `UnionC`<[`IntersectionC`<[`TypeC`<{ `connector_id`: `StringC` = rt.string }\>, `TypeC`<{ `connector_name`: `StringC` = rt.string; `external_id`: `StringC` = rt.string; `external_title`: `StringC` = rt.string; `external_url`: `StringC` = rt.string; `pushed_at`: `StringC` = rt.string; `pushed_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT }\>]\>, `NullC`]\> = CaseFullExternalServiceRt; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `totalAlerts`: `NumberC` = rt.number; `totalComment`: `NumberC` = rt.number; `version`: `StringC` = rt.string }\>, `PartialC`<{ `comments`: `ArrayC`<`IntersectionC`<[`UnionC`<[`IntersectionC`<[`TypeC`<{ `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`user`](client._internal_namespace.md#user)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `alertId`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `index`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `owner`: `StringC` = rt.string; `rule`: `TypeC`<{ `id`: `UnionC`<[`StringC`, `NullC`]\> ; `name`: `UnionC`<[`StringC`, `NullC`]\> }\> ; `type`: `LiteralC`<[`alert`](client._internal_namespace.md#alert)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `actions`: `TypeC`<{ `targets`: `ArrayC`<`TypeC`<{ `endpointId`: `StringC` = rt.string; `hostname`: `StringC` = rt.string }\>\> ; `type`: `StringC` = rt.string }\> ; `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`actions`](client._internal_namespace.md#actions)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `version`: `StringC` = rt.string }\>]\>\> }\>]\> = CaseResponseRt; `outcome`: `UnionC`<[`LiteralC`<``"exactMatch"``\>, `LiteralC`<``"aliasMatch"``\>, `LiteralC`<``"conflict"``\>]\> }\>, `PartialC`<{ `alias_target_id`: `StringC` = rt.string }\>]\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:212](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L212) - -___ - -### CaseResponseRt - -• **CaseResponseRt**: `IntersectionC`<[`IntersectionC`<[`TypeC`<{ `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt; `description`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `settings`: `TypeC`<{ `syncAlerts`: `BooleanC` = rt.boolean }\> = SettingsRt; `status`: `UnionC`<[`LiteralC`<[`open`](../enums/client._internal_namespace.CaseStatuses.md#open)\>, `LiteralC`<`any`[`any`]\>, `LiteralC`<[`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed)\>]\> = CaseStatusRt; `tags`: `ArrayC`<`StringC`\> ; `title`: `StringC` = rt.string }\>, `TypeC`<{ `closed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `closed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `external_service`: `UnionC`<[`IntersectionC`<[`TypeC`<{ `connector_id`: `StringC` = rt.string }\>, `TypeC`<{ `connector_name`: `StringC` = rt.string; `external_id`: `StringC` = rt.string; `external_title`: `StringC` = rt.string; `external_url`: `StringC` = rt.string; `pushed_at`: `StringC` = rt.string; `pushed_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT }\>]\>, `NullC`]\> = CaseFullExternalServiceRt; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `totalAlerts`: `NumberC` = rt.number; `totalComment`: `NumberC` = rt.number; `version`: `StringC` = rt.string }\>, `PartialC`<{ `comments`: `ArrayC`<`IntersectionC`<[`UnionC`<[`IntersectionC`<[`TypeC`<{ `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`user`](client._internal_namespace.md#user)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `alertId`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `index`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `owner`: `StringC` = rt.string; `rule`: `TypeC`<{ `id`: `UnionC`<[`StringC`, `NullC`]\> ; `name`: `UnionC`<[`StringC`, `NullC`]\> }\> ; `type`: `LiteralC`<[`alert`](client._internal_namespace.md#alert)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `actions`: `TypeC`<{ `targets`: `ArrayC`<`TypeC`<{ `endpointId`: `StringC` = rt.string; `hostname`: `StringC` = rt.string }\>\> ; `type`: `StringC` = rt.string }\> ; `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`actions`](client._internal_namespace.md#actions)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `version`: `StringC` = rt.string }\>]\>\> }\>]\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:199](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L199) - -___ - -### CaseUserActionsResponseRt - -• **CaseUserActionsResponseRt**: `ArrayC`<`IntersectionC`<[`IntersectionC`<[`UnionC`<[`UnionC`<[`TypeC`<{ `payload`: `TypeC`<{ `description`: `StringC` = rt.string }\> = DescriptionUserActionPayloadRt; `type`: `LiteralC`<``"description"``\> }\>, `TypeC`<{ `payload`: `TypeC`<{ `comment`: `UnionC`<[`TypeC`<{ `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`user`](client._internal_namespace.md#user)\> }\>, `TypeC`<{ `alertId`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `index`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `owner`: `StringC` = rt.string; `rule`: `TypeC`<{ `id`: `UnionC`<[`StringC`, `NullC`]\> ; `name`: `UnionC`<[`StringC`, `NullC`]\> }\> ; `type`: `LiteralC`<[`alert`](client._internal_namespace.md#alert)\> }\>, `TypeC`<{ `actions`: `TypeC`<{ `targets`: `ArrayC`<`TypeC`<{ `endpointId`: `StringC` = rt.string; `hostname`: `StringC` = rt.string }\>\> ; `type`: `StringC` = rt.string }\> ; `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`actions`](client._internal_namespace.md#actions)\> }\>]\> = CommentRequestRt }\> = CommentUserActionPayloadRt; `type`: `LiteralC`<``"comment"``\> }\>, `TypeC`<{ `payload`: `TypeC`<{ `tags`: `ArrayC`<`StringC`\> }\> = TagsUserActionPayloadRt; `type`: `LiteralC`<``"tags"``\> }\>, `TypeC`<{ `payload`: `TypeC`<{ `title`: `StringC` = rt.string }\> = TitleUserActionPayloadRt; `type`: `LiteralC`<``"title"``\> }\>, `TypeC`<{ `payload`: `TypeC`<{ `settings`: `TypeC`<{ `syncAlerts`: `BooleanC` = rt.boolean }\> = SettingsRt }\> = SettingsUserActionPayloadRt; `type`: `LiteralC`<``"settings"``\> }\>, `TypeC`<{ `payload`: `TypeC`<{ `status`: `UnionC`<[`LiteralC`<[`open`](../enums/client._internal_namespace.CaseStatuses.md#open)\>, `LiteralC`<`any`[`any`]\>, `LiteralC`<[`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed)\>]\> = CaseStatusRt }\> = StatusUserActionPayloadRt; `type`: `LiteralC`<``"status"``\> }\>]\>, `IntersectionC`<[`TypeC`<{ `type`: `LiteralC`<``"create_case"``\> }\>, `TypeC`<{ `payload`: `IntersectionC`<[`TypeC`<{ `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt }\>, `TypeC`<{ `description`: `StringC` = DescriptionUserActionPayloadRt.props.description; `owner`: `StringC` = rt.string; `settings`: `TypeC`<{ `syncAlerts`: `BooleanC` = rt.boolean }\> = SettingsUserActionPayloadRt.props.settings; `status`: `StringC` = rt.string; `tags`: `ArrayC`<`StringC`\> = TagsUserActionPayloadRt.props.tags; `title`: `StringC` = TitleUserActionPayloadRt.props.title }\>]\> }\>]\>, `TypeC`<{ `payload`: `TypeC`<{ `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt }\> = ConnectorUserActionPayloadRt; `type`: `LiteralC`<``"connector"``\> }\>, `TypeC`<{ `payload`: `TypeC`<{ `externalService`: `IntersectionC`<[`TypeC`<{ `connector_id`: `StringC` = rt.string }\>, `TypeC`<{ `connector_name`: `StringC` = rt.string; `external_id`: `StringC` = rt.string; `external_title`: `StringC` = rt.string; `external_url`: `StringC` = rt.string; `pushed_at`: `StringC` = rt.string; `pushed_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT }\>]\> = CaseExternalServiceBasicRt }\> = PushedUserActionPayloadRt; `type`: `LiteralC`<``"pushed"``\> }\>, `TypeC`<{ `payload`: `TypeC`<{}\> ; `type`: `LiteralC`<``"delete_case"``\> }\>]\>, `TypeC`<{ `action`: `KeyofC`<{ `add`: ``"add"`` = 'add'; `create`: ``"create"`` = 'create'; `delete`: ``"delete"`` = 'delete'; `push_to_service`: ``"push_to_service"`` = 'push\_to\_service'; `update`: ``"update"`` = 'update' }\> = ActionsRt; `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string }\>]\>, `TypeC`<{ `action_id`: `StringC` = rt.string; `case_id`: `StringC` = rt.string; `comment_id`: `UnionC`<[`StringC`, `NullC`]\> }\>]\>\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/user_actions/index.ts:76](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/user_actions/index.ts#L76) - -___ - -### CasesConfigurePatchRt - -• **CasesConfigurePatchRt**: `IntersectionC`<[`PartialC`<{ `closure_type`: `UnionC`<[`LiteralC`<``"close-by-user"``\>, `LiteralC`<``"close-by-pushing"``\>]\> = ClosureTypeRT; `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt }\>, `TypeC`<{ `version`: `StringC` = rt.string }\>]\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/configure.ts:38](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/configure.ts#L38) - -___ - -### CasesConfigureRequestRt - -• **CasesConfigureRequestRt**: `IntersectionC`<[`TypeC`<{ `closure_type`: `UnionC`<[`LiteralC`<``"close-by-user"``\>, `LiteralC`<``"close-by-pushing"``\>]\> = ClosureTypeRT; `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt }\>, `TypeC`<{ `owner`: `StringC` = rt.string }\>]\> = `CasesConfigureBasicRt` - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/configure.ts:37](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/configure.ts#L37) - -___ - -### CasesFindResponseRt - -• **CasesFindResponseRt**: `IntersectionC`<[`TypeC`<{ `cases`: `ArrayC`<`IntersectionC`<[`IntersectionC`<[`TypeC`<{ `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt; `description`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `settings`: `TypeC`<{ `syncAlerts`: `BooleanC` = rt.boolean }\> = SettingsRt; `status`: `UnionC`<[`LiteralC`<[`open`](../enums/client._internal_namespace.CaseStatuses.md#open)\>, `LiteralC`<`any`[`any`]\>, `LiteralC`<[`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed)\>]\> = CaseStatusRt; `tags`: `ArrayC`<`StringC`\> ; `title`: `StringC` = rt.string }\>, `TypeC`<{ `closed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `closed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `external_service`: `UnionC`<[`IntersectionC`<[`TypeC`<{ `connector_id`: `StringC` = rt.string }\>, `TypeC`<{ `connector_name`: `StringC` = rt.string; `external_id`: `StringC` = rt.string; `external_title`: `StringC` = rt.string; `external_url`: `StringC` = rt.string; `pushed_at`: `StringC` = rt.string; `pushed_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT }\>]\>, `NullC`]\> = CaseFullExternalServiceRt; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `totalAlerts`: `NumberC` = rt.number; `totalComment`: `NumberC` = rt.number; `version`: `StringC` = rt.string }\>, `PartialC`<{ `comments`: `ArrayC`<`IntersectionC`<[`UnionC`<[`IntersectionC`<[`TypeC`<{ `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`user`](client._internal_namespace.md#user)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `alertId`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `index`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `owner`: `StringC` = rt.string; `rule`: `TypeC`<{ `id`: `UnionC`<[`StringC`, `NullC`]\> ; `name`: `UnionC`<[`StringC`, `NullC`]\> }\> ; `type`: `LiteralC`<[`alert`](client._internal_namespace.md#alert)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `actions`: `TypeC`<{ `targets`: `ArrayC`<`TypeC`<{ `endpointId`: `StringC` = rt.string; `hostname`: `StringC` = rt.string }\>\> ; `type`: `StringC` = rt.string }\> ; `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`actions`](client._internal_namespace.md#actions)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `version`: `StringC` = rt.string }\>]\>\> }\>]\>\> ; `page`: `NumberC` = rt.number; `per_page`: `NumberC` = rt.number; `total`: `NumberC` = rt.number }\>, `TypeC`<{ `count_closed_cases`: `NumberC` = rt.number; `count_in_progress_cases`: `NumberC` = rt.number; `count_open_cases`: `NumberC` = rt.number }\>]\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:222](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L222) - -___ - -### CasesPatchRequestRt - -• **CasesPatchRequestRt**: `TypeC`<{ `cases`: `ArrayC`<`IntersectionC`<[`PartialC`<{ `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt; `description`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `settings`: `TypeC`<{ `syncAlerts`: `BooleanC` = rt.boolean }\> = SettingsRt; `status`: `UnionC`<[`LiteralC`<[`open`](../enums/client._internal_namespace.CaseStatuses.md#open)\>, `LiteralC`<`any`[`any`]\>, `LiteralC`<[`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed)\>]\> = CaseStatusRt; `tags`: `ArrayC`<`StringC`\> ; `title`: `StringC` = rt.string }\>, `TypeC`<{ `id`: `StringC` = rt.string; `version`: `StringC` = rt.string }\>]\>\> }\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:240](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L240) - -___ - -### CasesResponseRt - -• **CasesResponseRt**: `ArrayC`<`IntersectionC`<[`IntersectionC`<[`TypeC`<{ `connector`: `IntersectionC`<[`TypeC`<{ `id`: `StringC` = rt.string }\>, `UnionC`<[`IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `issueType`: `UnionC`<[`StringC`, `NullC`]\> ; `parent`: `UnionC`<[`StringC`, `NullC`]\> ; `priority`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`jira`](client._internal_namespace.md#jira)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `NullC` = rt.null; `type`: `LiteralC`<[`none`](client._internal_namespace.md#none)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>, `IntersectionC`<[`TypeC`<{ `fields`: `UnionC`<[`TypeC`<{ `incidentTypes`: `UnionC`<[`ArrayC`<`StringC`\>, `NullC`]\> ; `severityCode`: `UnionC`<[`StringC`, `NullC`]\> }\>, `NullC`]\> ; `type`: `LiteralC`<[`resilient`](client._internal_namespace.md#resilient)\> }\>, `TypeC`<{ `name`: `StringC` = rt.string }\>]\>]\>]\> = CaseConnectorRt; `description`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `settings`: `TypeC`<{ `syncAlerts`: `BooleanC` = rt.boolean }\> = SettingsRt; `status`: `UnionC`<[`LiteralC`<[`open`](../enums/client._internal_namespace.CaseStatuses.md#open)\>, `LiteralC`<`any`[`any`]\>, `LiteralC`<[`closed`](../enums/client._internal_namespace.CaseStatuses.md#closed)\>]\> = CaseStatusRt; `tags`: `ArrayC`<`StringC`\> ; `title`: `StringC` = rt.string }\>, `TypeC`<{ `closed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `closed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `external_service`: `UnionC`<[`IntersectionC`<[`TypeC`<{ `connector_id`: `StringC` = rt.string }\>, `TypeC`<{ `connector_name`: `StringC` = rt.string; `external_id`: `StringC` = rt.string; `external_title`: `StringC` = rt.string; `external_url`: `StringC` = rt.string; `pushed_at`: `StringC` = rt.string; `pushed_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT }\>]\>, `NullC`]\> = CaseFullExternalServiceRt; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `totalAlerts`: `NumberC` = rt.number; `totalComment`: `NumberC` = rt.number; `version`: `StringC` = rt.string }\>, `PartialC`<{ `comments`: `ArrayC`<`IntersectionC`<[`UnionC`<[`IntersectionC`<[`TypeC`<{ `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`user`](client._internal_namespace.md#user)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `alertId`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `index`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `owner`: `StringC` = rt.string; `rule`: `TypeC`<{ `id`: `UnionC`<[`StringC`, `NullC`]\> ; `name`: `UnionC`<[`StringC`, `NullC`]\> }\> ; `type`: `LiteralC`<[`alert`](client._internal_namespace.md#alert)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `actions`: `TypeC`<{ `targets`: `ArrayC`<`TypeC`<{ `endpointId`: `StringC` = rt.string; `hostname`: `StringC` = rt.string }\>\> ; `type`: `StringC` = rt.string }\> ; `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`actions`](client._internal_namespace.md#actions)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `version`: `StringC` = rt.string }\>]\>\> }\>]\>\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/case.ts:241](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/case.ts#L241) - -___ - -### CommentsResponseRt - -• **CommentsResponseRt**: `TypeC`<{ `comments`: `ArrayC`<`IntersectionC`<[`UnionC`<[`IntersectionC`<[`TypeC`<{ `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`user`](client._internal_namespace.md#user)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `alertId`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `index`: `UnionC`<[`ArrayC`<`StringC`\>, `StringC`]\> ; `owner`: `StringC` = rt.string; `rule`: `TypeC`<{ `id`: `UnionC`<[`StringC`, `NullC`]\> ; `name`: `UnionC`<[`StringC`, `NullC`]\> }\> ; `type`: `LiteralC`<[`alert`](client._internal_namespace.md#alert)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>, `IntersectionC`<[`TypeC`<{ `actions`: `TypeC`<{ `targets`: `ArrayC`<`TypeC`<{ `endpointId`: `StringC` = rt.string; `hostname`: `StringC` = rt.string }\>\> ; `type`: `StringC` = rt.string }\> ; `comment`: `StringC` = rt.string; `owner`: `StringC` = rt.string; `type`: `LiteralC`<[`actions`](client._internal_namespace.md#actions)\> }\>, `TypeC`<{ `created_at`: `StringC` = rt.string; `created_by`: `TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\> = UserRT; `owner`: `StringC` = rt.string; `pushed_at`: `UnionC`<[`StringC`, `NullC`]\> ; `pushed_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> ; `updated_at`: `UnionC`<[`StringC`, `NullC`]\> ; `updated_by`: `UnionC`<[`TypeC`<{ `email`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `full_name`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> ; `username`: `UnionC`<[`UndefinedC`, `NullC`, `StringC`]\> }\>, `NullC`]\> }\>]\>]\>, `TypeC`<{ `id`: `StringC` = rt.string; `version`: `StringC` = rt.string }\>]\>\> ; `page`: `NumberC` = rt.number; `per_page`: `NumberC` = rt.number; `total`: `NumberC` = rt.number }\> - -#### Defined in - -[x-pack/plugins/cases/common/api/cases/comment.ts:143](https://github.com/elastic/kibana/blob/c427bf270ae/x-pack/plugins/cases/common/api/cases/comment.ts#L143) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/typedoc_interfaces.md b/x-pack/plugins/cases/docs/cases_client/modules/typedoc_interfaces.md deleted file mode 100644 index 9f9d1f9a8808c..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/typedoc_interfaces.md +++ /dev/null @@ -1,28 +0,0 @@ -[Cases Client API Interface](../README.md) / typedoc\_interfaces - -# Module: typedoc\_interfaces - -This file defines simpler types for typedoc. This helps reduce the type alias expansion for the io-ts types because it -can be very large. These types are equivalent to the io-ts aliases. - -## Table of contents - -### Namespaces - -- [\_internal\_namespace](typedoc_interfaces._internal_namespace.md) - -### Interfaces - -- [IAllCommentsResponse](../interfaces/typedoc_interfaces.IAllCommentsResponse.md) -- [ICasePostRequest](../interfaces/typedoc_interfaces.ICasePostRequest.md) -- [ICaseResolveResponse](../interfaces/typedoc_interfaces.ICaseResolveResponse.md) -- [ICaseResponse](../interfaces/typedoc_interfaces.ICaseResponse.md) -- [ICaseUserActionsResponse](../interfaces/typedoc_interfaces.ICaseUserActionsResponse.md) -- [ICasesConfigurePatch](../interfaces/typedoc_interfaces.ICasesConfigurePatch.md) -- [ICasesConfigureRequest](../interfaces/typedoc_interfaces.ICasesConfigureRequest.md) -- [ICasesConfigureResponse](../interfaces/typedoc_interfaces.ICasesConfigureResponse.md) -- [ICasesFindRequest](../interfaces/typedoc_interfaces.ICasesFindRequest.md) -- [ICasesFindResponse](../interfaces/typedoc_interfaces.ICasesFindResponse.md) -- [ICasesPatchRequest](../interfaces/typedoc_interfaces.ICasesPatchRequest.md) -- [ICasesResponse](../interfaces/typedoc_interfaces.ICasesResponse.md) -- [ICommentsResponse](../interfaces/typedoc_interfaces.ICommentsResponse.md) diff --git a/x-pack/plugins/cases/docs/cases_client/modules/user_actions_client.md b/x-pack/plugins/cases/docs/cases_client/modules/user_actions_client.md deleted file mode 100644 index 4ec27e0beee46..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client/modules/user_actions_client.md +++ /dev/null @@ -1,10 +0,0 @@ -[Cases Client API Interface](../README.md) / user\_actions/client - -# Module: user\_actions/client - -## Table of contents - -### Interfaces - -- [UserActionGet](../interfaces/user_actions_client.UserActionGet.md) -- [UserActionsSubClient](../interfaces/user_actions_client.UserActionsSubClient.md) diff --git a/x-pack/plugins/cases/docs/cases_client_typedoc.json b/x-pack/plugins/cases/docs/cases_client_typedoc.json deleted file mode 100644 index a5e1305196491..0000000000000 --- a/x-pack/plugins/cases/docs/cases_client_typedoc.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "entryPoints": [ - "../server/client/client.ts", - "../server/client/typedoc_interfaces.ts", - "../server/client/attachments/client.ts", - "../server/client/cases/client.ts", - "../server/client/cases/get.ts", - "../server/client/cases/push.ts", - "../server/client/configure/client.ts", - "../server/client/metrics/client.ts", - "../server/client/stats/client.ts", - "../server/client/user_actions/client.ts" - ], - "entryPointStrategy": "expand", - "exclude": [ - "**/mock.ts", - "../server/client/cases/+(mock.ts|utils.ts|utils.test.ts|types.ts)" - ], - "excludeExternals": true, - "out": "cases_client", - "theme": "markdown", - "internalNamespace": "_internal_namespace", - "plugin": ["typedoc-plugin-markdown", "typedoc-plugin-missing-exports"], - "readme": "none", - "name": "Cases Client API Interface", - "gitRemote": "upstream" -} diff --git a/x-pack/plugins/data_visualizer/common/types/field_request_config.ts b/x-pack/plugins/data_visualizer/common/types/field_request_config.ts index f0ea7079bf750..e15e39ffb46de 100644 --- a/x-pack/plugins/data_visualizer/common/types/field_request_config.ts +++ b/x-pack/plugins/data_visualizer/common/types/field_request_config.ts @@ -17,6 +17,7 @@ export interface FieldRequestConfig { fieldName: string; type: JobFieldType; cardinality: number; + existsInDocs: boolean; } export interface DocumentCountBuckets { diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/fields_stats_grid/filter_fields.ts b/x-pack/plugins/data_visualizer/public/application/common/components/fields_stats_grid/filter_fields.ts index de97b6007d877..145a8fa5f8867 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/fields_stats_grid/filter_fields.ts +++ b/x-pack/plugins/data_visualizer/public/application/common/components/fields_stats_grid/filter_fields.ts @@ -6,15 +6,15 @@ */ import { JOB_FIELD_TYPES } from '../../../../../common/constants'; -import type { - FileBasedFieldVisConfig, - FileBasedUnknownFieldVisConfig, -} from '../../../../../common/types/field_vis_config'; -export function filterFields( - fields: Array, - visibleFieldNames: string[], - visibleFieldTypes: string[] +interface CommonFieldConfig { + type: string; + fieldName?: string; +} +export function filterFields( + fields: T[], + visibleFieldNames: string[] | undefined, + visibleFieldTypes: string[] | undefined ) { let items = fields; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/data_visualizer_stats_table.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/data_visualizer_stats_table.tsx index cc9cd075c7615..5d4c4de8ca901 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/data_visualizer_stats_table.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/data_visualizer_stats_table.tsx @@ -19,6 +19,7 @@ import { LEFT_ALIGNMENT, RIGHT_ALIGNMENT, EuiResizeObserver, + EuiLoadingSpinner, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { EuiTableComputedColumnType } from '@elastic/eui/src/components/basic_table/table_types'; @@ -279,6 +280,15 @@ export const DataVisualizerTable = ({ ), render: (item: DataVisualizerTableItem) => { if (item === undefined || showDistributions === false) return null; + + if ('loading' in item && item.loading === true) { + return ( + + + + ); + } + if ( (item.type === JOB_FIELD_TYPES.KEYWORD || item.type === JOB_FIELD_TYPES.IP) && item.stats?.topValues !== undefined diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js index 5d5f07f2279c9..ae0a979008eff 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js @@ -74,7 +74,7 @@ export class FileDataVisualizerView extends Component { // note, calling hasImportPermission with no arguments just checks the // cluster privileges, the user will still need index privileges to create and ingest const hasPermissionToImport = await this.props.fileUpload.hasImportPermission({ - checkCreateIndexPattern: false, + checkCreateDataView: false, checkHasManagePipeline: true, }); this.setState({ hasPermissionToImport }); diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_view/import_view.js b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_view/import_view.js index b62e43c5fc2e2..c5021f930c942 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_view/import_view.js +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_view/import_view.js @@ -116,7 +116,7 @@ export class ImportView extends Component { // check to see if the user has permission to create and ingest data into the specified index if ( (await fileUpload.hasImportPermission({ - checkCreateIndexPattern: createDataView, + checkCreateDataView: createDataView, checkHasManagePipeline: true, indexName: index, })) === false diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/constants/index_data_visualizer_viewer.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/constants/index_data_visualizer_viewer.ts index cd12706d0bc9b..c1b314a19cf37 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/constants/index_data_visualizer_viewer.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/constants/index_data_visualizer_viewer.ts @@ -6,3 +6,5 @@ */ export const DATA_VISUALIZER_INDEX_VIEWER = 'DATA_VISUALIZER_INDEX_VIEWER'; + +export const MAX_CONCURRENT_REQUESTS = 10; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx index 8097d400c3b71..c44932470c7e8 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx @@ -84,6 +84,7 @@ export const EmbeddableWrapper = ({ }, [dataVisualizerListState, onOutputChange] ); + const { configs, searchQueryLanguage, searchString, extendedColumns, progress, setLastRefresh } = useDataVisualizerGridData(input, dataVisualizerListState); diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts index bbf088c53d94c..7c821f698d8df 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_data_visualizer_grid_data.ts @@ -53,7 +53,6 @@ export const useDataVisualizerGridData = ( const { services } = useDataVisualizerKibana(); const { uiSettings, data } = services; const { samplerShardSize, visibleFieldTypes, showEmptyFields } = dataVisualizerListState; - const dataVisualizerListStateRef = useRef(dataVisualizerListState); const [lastRefresh, setLastRefresh] = useState(0); const searchSessionId = input.sessionId; @@ -227,11 +226,11 @@ export const useDataVisualizerGridData = ( if (overallStatsProgress.loaded < 100) return; const existMetricFields = metricConfigs .map((config) => { - if (config.existsInDocs === false) return; return { fieldName: config.fieldName, type: config.type, cardinality: config.stats?.cardinality ?? 0, + existsInDocs: config.existsInDocs, }; }) .filter((c) => c !== undefined) as FieldRequestConfig[]; @@ -240,11 +239,11 @@ export const useDataVisualizerGridData = ( // Top values will be obtained on a sample if cardinality > 100000. const existNonMetricFields: FieldRequestConfig[] = nonMetricConfigs .map((config) => { - if (config.existsInDocs === false) return; return { fieldName: config.fieldName, type: config.type, cardinality: config.stats?.cardinality ?? 0, + existsInDocs: config.existsInDocs, }; }) .filter((c) => c !== undefined) as FieldRequestConfig[]; @@ -255,7 +254,7 @@ export const useDataVisualizerGridData = ( const strategyResponse = useFieldStatsSearchStrategy( fieldStatsRequest, configsWithoutStats, - dataVisualizerListStateRef.current + dataVisualizerListState ); const combinedProgress = useMemo( @@ -325,7 +324,7 @@ export const useDataVisualizerGridData = ( ...fieldData, fieldFormat: currentDataView.getFormatterForField(field), type: JOB_FIELD_TYPES.NUMBER, - loading: true, + loading: fieldData?.existsInDocs ?? true, aggregatable: true, deletable: field.runtimeField !== undefined, }; @@ -436,41 +435,46 @@ export const useDataVisualizerGridData = ( // eslint-disable-next-line react-hooks/exhaustive-deps }, [overallStats, showEmptyFields]); - const configs = useMemo(() => { - const fieldStats = strategyResponse.fieldStats; - let combinedConfigs = [...nonMetricConfigs, ...metricConfigs]; - if (visibleFieldTypes && visibleFieldTypes.length > 0) { - combinedConfigs = combinedConfigs.filter( - (config) => visibleFieldTypes.findIndex((field) => field === config.type) > -1 - ); - } - if (visibleFieldNames && visibleFieldNames.length > 0) { - combinedConfigs = combinedConfigs.filter( - (config) => visibleFieldNames.findIndex((field) => field === config.fieldName) > -1 - ); - } - - if (fieldStats) { - combinedConfigs = combinedConfigs.map((c) => { - const loadedFullStats = fieldStats.get(c.fieldName) ?? {}; - return loadedFullStats - ? { - ...c, - loading: false, - stats: { ...c.stats, ...loadedFullStats }, - } - : c; - }); - } + const configs = useMemo( + () => { + const fieldStats = strategyResponse.fieldStats; + let combinedConfigs = [...nonMetricConfigs, ...metricConfigs]; + if (visibleFieldTypes && visibleFieldTypes.length > 0) { + combinedConfigs = combinedConfigs.filter( + (config) => visibleFieldTypes.findIndex((field) => field === config.type) > -1 + ); + } + if (visibleFieldNames && visibleFieldNames.length > 0) { + combinedConfigs = combinedConfigs.filter( + (config) => visibleFieldNames.findIndex((field) => field === config.fieldName) > -1 + ); + } - return combinedConfigs; - }, [ - nonMetricConfigs, - metricConfigs, - visibleFieldTypes, - visibleFieldNames, - strategyResponse.fieldStats, - ]); + if (fieldStats) { + combinedConfigs = combinedConfigs.map((c) => { + const loadedFullStats = fieldStats.get(c.fieldName) ?? {}; + return loadedFullStats + ? { + ...c, + loading: false, + stats: { ...c.stats, ...loadedFullStats }, + } + : c; + }); + } + return combinedConfigs; + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [ + nonMetricConfigs, + metricConfigs, + visibleFieldTypes, + visibleFieldNames, + strategyResponse.progress.loaded, + dataVisualizerListState.pageIndex, + dataVisualizerListState.pageSize, + ] + ); // Some actions open up fly-out or popup // This variable is used to keep track of them and clean up when unmounting diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts index 19eaf8be68327..750c1d417e84d 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_field_stats.ts @@ -6,10 +6,11 @@ */ import { useCallback, useEffect, useReducer, useRef, useState } from 'react'; -import { combineLatest, Observable, Subject, Subscription } from 'rxjs'; +import { combineLatest, from, Observable, Subject, Subscription } from 'rxjs'; import { i18n } from '@kbn/i18n'; import { last, cloneDeep } from 'lodash'; -import { switchMap } from 'rxjs/operators'; +import { mergeMap, switchMap } from 'rxjs/operators'; +import { Comparators } from '@elastic/eui'; import type { DataStatsFetchProgress, FieldStatsSearchStrategyReturnBase, @@ -29,6 +30,9 @@ import { getInitialProgress, getReducer } from '../progress_utils'; import { MAX_EXAMPLES_DEFAULT } from '../search_strategy/requests/constants'; import type { ISearchOptions } from '../../../../../../../src/plugins/data/common'; import { getFieldsStats } from '../search_strategy/requests/get_fields_stats'; +import { MAX_CONCURRENT_REQUESTS } from '../constants/index_data_visualizer_viewer'; +import { filterFields } from '../../common/components/fields_stats_grid/filter_fields'; + interface FieldStatsParams { metricConfigs: FieldRequestConfig[]; nonMetricConfigs: FieldRequestConfig[]; @@ -61,7 +65,7 @@ const createBatchedRequests = (fields: Field[], maxBatchSize = 10) => { export function useFieldStatsSearchStrategy( searchStrategyParams: OverallStatsSearchStrategyParams | undefined, fieldStatsParams: FieldStatsParams | undefined, - initialDataVisualizerListState: DataVisualizerIndexBasedAppState + dataVisualizerListState: DataVisualizerIndexBasedAppState ): FieldStatsSearchStrategyReturnBase { const { services: { @@ -106,19 +110,41 @@ export function useFieldStatsSearchStrategy( return; } - const { sortField, sortDirection } = initialDataVisualizerListState; + const { sortField, sortDirection } = dataVisualizerListState; /** * Sort the list of fields by the initial sort field and sort direction * Then divide into chunks by the initial page size */ - let sortedConfigs = [...fieldStatsParams.metricConfigs, ...fieldStatsParams.nonMetricConfigs]; + const itemsSorter = Comparators.property( + sortField as string, + Comparators.default(sortDirection as 'asc' | 'desc' | undefined) + ); - if (sortField === 'fieldName' || sortField === 'type') { - sortedConfigs = sortedConfigs.sort((a, b) => a[sortField].localeCompare(b[sortField])); - } - if (sortDirection === 'desc') { - sortedConfigs = sortedConfigs.reverse(); + const preslicedSortedConfigs = [ + ...fieldStatsParams.metricConfigs, + ...fieldStatsParams.nonMetricConfigs, + ].sort(itemsSorter); + + const filteredItems = filterFields( + preslicedSortedConfigs, + dataVisualizerListState.visibleFieldNames, + dataVisualizerListState.visibleFieldTypes + ); + + const { pageIndex, pageSize } = dataVisualizerListState; + + const pageOfConfigs = filteredItems.filteredFields + ?.slice(pageIndex * pageSize, (pageIndex + 1) * pageSize) + .filter((d) => d.existsInDocs === true); + + if (!pageOfConfigs || pageOfConfigs.length === 0) { + setFetchState({ + loaded: 100, + isRunning: false, + }); + + return; } const filterCriteria = buildBaseFilterCriteria( @@ -149,7 +175,7 @@ export function useFieldStatsSearchStrategy( }; const batches = createBatchedRequests( - sortedConfigs.map((config, idx) => ({ + pageOfConfigs.map((config, idx) => ({ fieldName: config.fieldName, type: config.type, cardinality: config.cardinality, @@ -161,11 +187,10 @@ export function useFieldStatsSearchStrategy( const statsMap$ = new Subject(); const fieldsToRetry$ = new Subject(); - const fieldStatsSub = combineLatest( - batches - .map((batch) => getFieldsStats(data.search, params, batch, searchOptions)) - .filter((obs) => obs !== undefined) as Array> - ); + const fieldStatsToFetch = batches + .map((batch) => getFieldsStats(data.search, params, batch, searchOptions)) + .filter((obs) => obs !== undefined) as Array>; + const onError = (error: any) => { toasts.addError(error, { title: i18n.translate('xpack.dataVisualizer.index.errorFetchingFieldStatisticsMessage', { @@ -184,17 +209,24 @@ export function useFieldStatsSearchStrategy( }); }; + const statsMapTmp = new Map(); + // First, attempt to fetch field stats in batches of 10 - searchSubscription$.current = fieldStatsSub.subscribe({ - next: (resp) => { - if (resp) { - const statsMap = new Map(); - const failedFields: Field[] = []; - resp.forEach((batchResponse) => { + searchSubscription$.current = from(fieldStatsToFetch) + .pipe(mergeMap((observable) => observable, MAX_CONCURRENT_REQUESTS)) + .subscribe({ + next: (batchResponse) => { + setFetchState({ + ...getInitialProgress(), + error: undefined, + }); + + if (batchResponse) { + const failedFields: Field[] = []; if (Array.isArray(batchResponse)) { batchResponse.forEach((f) => { if (f.fieldName !== undefined) { - statsMap.set(f.fieldName, f); + statsMapTmp.set(f.fieldName, f); } }); } else { @@ -202,23 +234,22 @@ export function useFieldStatsSearchStrategy( // retry each field in the failed batch individually failedFields.push(...(batchResponse.fields ?? [])); } - }); - setFetchState({ - loaded: (statsMap.size / sortedConfigs.length) * 100, - isRunning: true, - }); + setFieldStats(statsMapTmp); + setFetchState({ + loaded: (statsMapTmp.size / pageOfConfigs.length) * 100, + isRunning: true, + }); - setFieldStats(statsMap); - if (failedFields.length > 0) { - statsMap$.next(statsMap); - fieldsToRetry$.next(failedFields); + if (failedFields.length > 0) { + statsMap$.next(statsMapTmp); + fieldsToRetry$.next(failedFields); + } } - } - }, - error: onError, - complete: onComplete, - }); + }, + error: onError, + complete: onComplete, + }); // If any of batches failed, retry each of the failed field at least one time individually retries$.current = combineLatest([ @@ -247,7 +278,7 @@ export function useFieldStatsSearchStrategy( }); setFieldStats(statsMap); setFetchState({ - loaded: (statsMap.size / sortedConfigs.length) * 100, + loaded: (statsMap.size / pageOfConfigs.length) * 100, isRunning: true, }); } @@ -256,7 +287,15 @@ export function useFieldStatsSearchStrategy( complete: onComplete, }); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [data.search, toasts, fieldStatsParams, initialDataVisualizerListState]); + }, [ + data.search, + toasts, + fieldStatsParams, + dataVisualizerListState.pageSize, + dataVisualizerListState.pageIndex, + dataVisualizerListState.sortDirection, + dataVisualizerListState.sortField, + ]); const cancelFetch = useCallback(() => { searchSubscription$.current?.unsubscribe(); diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_overall_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_overall_stats.ts index 8995a6adc4d46..0ad8ec7037153 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_overall_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/hooks/use_overall_stats.ts @@ -6,8 +6,8 @@ */ import { useCallback, useEffect, useState, useRef, useMemo, useReducer } from 'react'; -import { forkJoin, of, Subscription } from 'rxjs'; -import { switchMap } from 'rxjs/operators'; +import { from, of, Subscription, Observable } from 'rxjs'; +import { mergeMap, last, map, toArray } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; import type { ToastsStart } from 'kibana/public'; import { chunk } from 'lodash'; @@ -16,6 +16,7 @@ import { AggregatableFieldOverallStats, checkAggregatableFieldsExistRequest, checkNonAggregatableFieldExistsRequest, + isAggregatableFieldOverallStats, processAggregatableFieldsExistResponse, processNonAggregatableFieldsExistResponse, } from '../search_strategy/requests/overall_stats'; @@ -36,6 +37,31 @@ import { processDocumentCountStats, } from '../search_strategy/requests/get_document_stats'; import { getInitialProgress, getReducer } from '../progress_utils'; +import { MAX_CONCURRENT_REQUESTS } from '../constants/index_data_visualizer_viewer'; + +/** + * Helper function to run forkJoin + * with restrictions on how many input observables can be subscribed to concurrently + */ +export function rateLimitingForkJoin( + observables: Array>, + maxConcurrentRequests = MAX_CONCURRENT_REQUESTS +): Observable { + return from(observables).pipe( + mergeMap( + (observable, index) => + observable.pipe( + last(), + map((value) => ({ index, value })) + ), + maxConcurrentRequests + ), + toArray(), + map((indexedObservables) => + indexedObservables.sort((l, r) => l.index - r.index).map((obs) => obs.value) + ) + ); +} function displayError(toastNotifications: ToastsStart, index: string, err: any) { if (err.statusCode === 500) { @@ -116,72 +142,63 @@ export function useOverallStats 0 - ? forkJoin( - nonAggregatableFields.map((fieldName: string) => - data.search - .search( - { - params: checkNonAggregatableFieldExistsRequest( - index, - searchQuery, - fieldName, - timeFieldName, - earliest, - latest, - runtimeFieldMap - ), - }, - searchOptions - ) - .pipe( - switchMap((resp) => { - return of({ - ...resp, - rawResponse: { ...resp.rawResponse, fieldName }, - } as IKibanaSearchResponse); - }) - ) - ) - ) - : of(undefined); + + const nonAggregatableFieldsObs = nonAggregatableFields.map((fieldName: string) => + data.search + .search( + { + params: checkNonAggregatableFieldExistsRequest( + index, + searchQuery, + fieldName, + timeFieldName, + earliest, + latest, + runtimeFieldMap + ), + }, + searchOptions + ) + .pipe( + map((resp) => { + return { + ...resp, + rawResponse: { ...resp.rawResponse, fieldName }, + } as IKibanaSearchResponse; + }) + ) + ); // Have to divide into smaller requests to avoid 413 payload too large const aggregatableFieldsChunks = chunk(aggregatableFields, 30); - const aggregatableOverallStats$ = forkJoin( - aggregatableFields.length > 0 - ? aggregatableFieldsChunks.map((aggregatableFieldsChunk) => - data.search - .search( - { - params: checkAggregatableFieldsExistRequest( - index, - searchQuery, - aggregatableFieldsChunk, - samplerShardSize, - timeFieldName, - earliest, - latest, - undefined, - runtimeFieldMap - ), - }, - searchOptions - ) - .pipe( - switchMap((resp) => { - return of({ - ...resp, - aggregatableFields: aggregatableFieldsChunk, - } as AggregatableFieldOverallStats); - }) - ) - ) - : of(undefined) + const aggregatableOverallStatsObs = aggregatableFieldsChunks.map((aggregatableFieldsChunk) => + data.search + .search( + { + params: checkAggregatableFieldsExistRequest( + index, + searchQuery, + aggregatableFieldsChunk, + samplerShardSize, + timeFieldName, + earliest, + latest, + undefined, + runtimeFieldMap + ), + }, + searchOptions + ) + .pipe( + map((resp) => { + return { + ...resp, + aggregatableFields: aggregatableFieldsChunk, + } as AggregatableFieldOverallStats; + }) + ) ); - const documentCountStats$ = !fieldsToFetch && timeFieldName !== undefined && intervalMs !== undefined && intervalMs > 0 ? data.search.search( @@ -191,28 +208,42 @@ export function useOverallStats { + + const sub = rateLimitingForkJoin< + AggregatableFieldOverallStats | IKibanaSearchResponse | undefined + >( + [documentCountStats$, ...aggregatableOverallStatsObs, ...nonAggregatableFieldsObs], + MAX_CONCURRENT_REQUESTS + ); + + searchSubscription$.current = sub.subscribe({ + next: (value) => { + { + const aggregatableOverallStatsResp: AggregatableFieldOverallStats[] = []; + const nonAggregatableOverallStatsResp: IKibanaSearchResponse[] = []; + const documentCountStatsResp = value[0]; + + value.forEach((resp, idx) => { + if (!resp) return; + if (isAggregatableFieldOverallStats(resp)) { + aggregatableOverallStatsResp.push(resp); + } else { + nonAggregatableOverallStatsResp.push(resp); + } + }); + const aggregatableOverallStats = processAggregatableFieldsExistResponse( aggregatableOverallStatsResp, aggregatableFields, samplerShardSize ); + const nonAggregatableOverallStats = processNonAggregatableFieldsExistResponse( nonAggregatableOverallStatsResp, nonAggregatableFields ); - return of({ + setOverallStats({ documentCountStats: processDocumentCountStats( documentCountStatsResp?.rawResponse, searchStrategyParams @@ -221,14 +252,6 @@ export function useOverallStats { - if (overallStats) { - setOverallStats(overallStats); - } }, error: (error) => { displayError(toasts, searchStrategyParams.index, extractErrorProperties(error)); diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts index 1e7c99ce25428..a96244ece334a 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/search_strategy/requests/overall_stats.ts @@ -90,6 +90,13 @@ export const checkAggregatableFieldsExistRequest = ( export interface AggregatableFieldOverallStats extends IKibanaSearchResponse { aggregatableFields: string[]; } + +export function isAggregatableFieldOverallStats( + arg: unknown +): arg is AggregatableFieldOverallStats { + return isPopulatedObject(arg, ['aggregatableFields']); +} + export const processAggregatableFieldsExistResponse = ( responses: AggregatableFieldOverallStats[] | undefined, aggregatableFields: string[], diff --git a/x-pack/plugins/discover_enhanced/kibana.json b/x-pack/plugins/discover_enhanced/kibana.json index 426da33ae64f1..d1c8242987424 100644 --- a/x-pack/plugins/discover_enhanced/kibana.json +++ b/x-pack/plugins/discover_enhanced/kibana.json @@ -7,7 +7,7 @@ "requiredPlugins": ["uiActions", "embeddable", "discover"], "optionalPlugins": ["share", "usageCollection"], "configPath": ["xpack", "discoverEnhanced"], - "requiredBundles": ["kibanaUtils", "data"], + "requiredBundles": ["kibanaUtils", "data", "lens"], "owner": { "name": "Data Discovery", "githubTeam": "kibana-data-discovery" diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/abstract_explore_data_action.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/abstract_explore_data_action.ts index c1c84c040f51e..52b60012f62f2 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/abstract_explore_data_action.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/abstract_explore_data_action.ts @@ -11,6 +11,7 @@ import { ViewMode, IEmbeddable } from '../../../../../../src/plugins/embeddable/ import { StartServicesGetter } from '../../../../../../src/plugins/kibana_utils/public'; import { CoreStart } from '../../../../../../src/core/public'; import { KibanaLocation } from '../../../../../../src/plugins/share/public'; +import { DOC_TYPE as LENS_DOC_TYPE } from '../../../../lens/common/constants'; import * as shared from './shared'; export const ACTION_EXPLORE_DATA = 'ACTION_EXPLORE_DATA'; @@ -41,6 +42,7 @@ export abstract class AbstractExploreDataAction { if (!embeddable) return false; + if (embeddable.type === LENS_DOC_TYPE) return false; const { core, plugins } = this.params.start(); const { capabilities } = core.application; diff --git a/x-pack/plugins/discover_enhanced/tsconfig.json b/x-pack/plugins/discover_enhanced/tsconfig.json index 8ce3e5bf9f63a..631ca8a577cdf 100644 --- a/x-pack/plugins/discover_enhanced/tsconfig.json +++ b/x-pack/plugins/discover_enhanced/tsconfig.json @@ -13,6 +13,7 @@ { "path": "../../../src/plugins/discover/tsconfig.json" }, { "path": "../../../src/plugins/share/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, + { "path": "../lens/tsconfig.json" }, { "path": "../../../src/plugins/url_forwarding/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, diff --git a/x-pack/plugins/enterprise_search/common/types/indices.ts b/x-pack/plugins/enterprise_search/common/types/indices.ts index a0be781638fb5..61d61b73b6a45 100644 --- a/x-pack/plugins/enterprise_search/common/types/indices.ts +++ b/x-pack/plugins/enterprise_search/common/types/indices.ts @@ -19,5 +19,4 @@ export interface ElasticsearchIndex { size_in_bytes: string; }; }; - aliases: string | string[]; } 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 971b00b6529ee..19263f057e40f 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 @@ -92,6 +92,7 @@ export interface SourceDataItem { export interface ContentSource { id: string; serviceType: string; + baseServiceType?: string; name: string; } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_custom_source/save_custom.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_custom_source/save_custom.test.tsx index 73add51b87955..3de514a3e4d71 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_custom_source/save_custom.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_custom_source/save_custom.test.tsx @@ -15,7 +15,7 @@ import { EuiButtonTo } from '../../../../../../shared/react_router_helpers'; import { staticCustomSourceData } from '../../../source_data'; -import { SourceIdentifier } from '../../source_identifier'; +import { CustomSourceDeployment } from '../../custom_source_deployment'; import { SaveCustom } from './save_custom'; @@ -43,12 +43,8 @@ describe('SaveCustom', () => { expect(wrapper.find(EuiButtonTo)).toHaveLength(1); }); - it('contains a source identifier', () => { - expect(wrapper.find(SourceIdentifier)).toHaveLength(1); - }); - - it('includes a link to generic documentation', () => { - expect(wrapper.find('[data-test-subj="GenericDocumentationLink"]')).toHaveLength(1); + it('includes deployment instructions', () => { + expect(wrapper.find(CustomSourceDeployment)).toHaveLength(1); }); }); @@ -72,14 +68,6 @@ describe('SaveCustom', () => { wrapper = shallow(); }); - it('includes a to the github repository', () => { - expect(wrapper.find('[data-test-subj="GithubRepositoryLink"]')).toHaveLength(1); - }); - - it('includes a link to service-type specific documentation', () => { - expect(wrapper.find('[data-test-subj="PreconfiguredDocumentationLink"]')).toHaveLength(1); - }); - it('includes a link to provide feedback', () => { expect(wrapper.find('[data-test-subj="FeedbackCallout"]')).toHaveLength(1); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_custom_source/save_custom.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_custom_source/save_custom.tsx index 8d0612f36fc0d..de87d82d8712e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_custom_source/save_custom.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_custom_source/save_custom.tsx @@ -17,9 +17,7 @@ import { EuiText, EuiTextAlign, EuiTitle, - EuiLink, EuiPanel, - EuiHorizontalRule, EuiCallOut, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -27,10 +25,9 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonTo, EuiLinkTo } from '../../../../../../shared/react_router_helpers'; import { AppLogic } from '../../../../../app_logic'; -import { API_KEY_LABEL } from '../../../../../constants'; -import { SOURCES_PATH, getSourcesPath, API_KEYS_PATH } from '../../../../../routes'; +import { SOURCES_PATH, getSourcesPath } from '../../../../../routes'; -import { SourceIdentifier } from '../../source_identifier'; +import { CustomSourceDeployment } from '../../custom_source_deployment'; import { AddSourceHeader } from '../add_source_header'; import { SAVE_CUSTOM_BODY1 as READY_TO_ACCEPT_REQUESTS_LABEL } from '../constants'; @@ -40,12 +37,7 @@ import { AddCustomSourceLogic } from './add_custom_source_logic'; export const SaveCustom: React.FC = () => { const { newCustomSource, sourceData } = useValues(AddCustomSourceLogic); const { isOrganization } = useValues(AppLogic); - const { - serviceType, - configuration: { githubRepository, documentationUrl }, - name, - categories = [], - } = sourceData; + const { serviceType, name, categories = [] } = sourceData; return ( <> @@ -99,77 +91,7 @@ export const SaveCustom: React.FC = () => { - - - {serviceType !== 'custom' && githubRepository ? ( - <> - - - - ), - }} - /> - - - - - ), - }} - /> - - ) : ( - - - - ), - }} - /> - )} - - - {API_KEY_LABEL} - - ), - }} - /> - - - - + {serviceType !== 'custom' && ( diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_external_connector/external_connector_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_external_connector/external_connector_logic.test.ts index 0e9ad386a353d..1f15ef2ae7b67 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_external_connector/external_connector_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_external_connector/external_connector_logic.test.ts @@ -45,6 +45,16 @@ describe('ExternalConnectorLogic', () => { insecureUrl: true, }; + const DEFAULT_VALUES_SUCCESS: ExternalConnectorValues = { + ...DEFAULT_VALUES, + externalConnectorApiKey: 'asdf1234', + externalConnectorUrl: 'https://www.elastic.co', + formDisabled: false, + insecureUrl: false, + dataLoading: false, + sourceConfigData, + }; + beforeEach(() => { jest.clearAllMocks(); mount(); @@ -61,38 +71,56 @@ describe('ExternalConnectorLogic', () => { }); it('turns off the data loading flag', () => { - expect(ExternalConnectorLogic.values.dataLoading).toEqual(false); + expect(ExternalConnectorLogic.values).toEqual({ + ...DEFAULT_VALUES_SUCCESS, + dataLoading: false, + }); }); it('saves the external url', () => { - expect(ExternalConnectorLogic.values.externalConnectorUrl).toEqual( - sourceConfigData.configuredFields.externalConnectorUrl - ); + expect(ExternalConnectorLogic.values).toEqual({ + ...DEFAULT_VALUES_SUCCESS, + externalConnectorUrl: sourceConfigData.configuredFields.externalConnectorUrl, + }); }); it('saves the source config', () => { - expect(ExternalConnectorLogic.values.sourceConfigData).toEqual(sourceConfigData); + expect(ExternalConnectorLogic.values).toEqual({ + ...DEFAULT_VALUES_SUCCESS, + sourceConfigData, + }); }); it('sets undefined url to empty string', () => { - ExternalConnectorLogic.actions.fetchExternalSourceSuccess({ + const newSourceConfigData = { ...sourceConfigData, configuredFields: { ...sourceConfigData.configuredFields, externalConnectorUrl: undefined, }, + }; + ExternalConnectorLogic.actions.fetchExternalSourceSuccess(newSourceConfigData); + expect(ExternalConnectorLogic.values).toEqual({ + ...DEFAULT_VALUES_SUCCESS, + externalConnectorUrl: '', + insecureUrl: true, + sourceConfigData: newSourceConfigData, }); - expect(ExternalConnectorLogic.values.externalConnectorUrl).toEqual(''); }); it('sets undefined api key to empty string', () => { - ExternalConnectorLogic.actions.fetchExternalSourceSuccess({ + const newSourceConfigData = { ...sourceConfigData, configuredFields: { ...sourceConfigData.configuredFields, externalConnectorApiKey: undefined, }, + }; + ExternalConnectorLogic.actions.fetchExternalSourceSuccess(newSourceConfigData); + expect(ExternalConnectorLogic.values).toEqual({ + ...DEFAULT_VALUES_SUCCESS, + externalConnectorApiKey: '', + sourceConfigData: newSourceConfigData, }); - expect(ExternalConnectorLogic.values.externalConnectorApiKey).toEqual(''); }); }); @@ -104,7 +132,19 @@ describe('ExternalConnectorLogic', () => { ExternalConnectorLogic.actions.saveExternalConnectorConfigSuccess('external'); - expect(ExternalConnectorLogic.values.buttonLoading).toEqual(false); + expect(ExternalConnectorLogic.values).toEqual({ ...DEFAULT_VALUES, buttonLoading: false }); + }); + }); + + describe('saveExternalConnectorConfigError', () => { + it('turns off the button loading flag', () => { + mount({ + buttonLoading: true, + }); + + ExternalConnectorLogic.actions.saveExternalConnectorConfigError(); + + expect(ExternalConnectorLogic.values).toEqual({ ...DEFAULT_VALUES, buttonLoading: false }); }); }); @@ -112,7 +152,10 @@ describe('ExternalConnectorLogic', () => { it('updates the api key', () => { ExternalConnectorLogic.actions.setExternalConnectorApiKey('abcd1234'); - expect(ExternalConnectorLogic.values.externalConnectorApiKey).toEqual('abcd1234'); + expect(ExternalConnectorLogic.values).toEqual({ + ...DEFAULT_VALUES, + externalConnectorApiKey: 'abcd1234', + }); }); }); @@ -120,23 +163,28 @@ describe('ExternalConnectorLogic', () => { it('updates the url', () => { ExternalConnectorLogic.actions.setExternalConnectorUrl('https://www.elastic.co'); - expect(ExternalConnectorLogic.values.externalConnectorUrl).toEqual( - 'https://www.elastic.co' - ); + expect(ExternalConnectorLogic.values).toEqual({ + ...DEFAULT_VALUES, + externalConnectorUrl: 'https://www.elastic.co', + insecureUrl: false, + }); }); }); describe('setUrlValidation', () => { it('updates the url validation', () => { ExternalConnectorLogic.actions.setUrlValidation(false); - expect(ExternalConnectorLogic.values.urlValid).toEqual(false); + expect(ExternalConnectorLogic.values).toEqual({ ...DEFAULT_VALUES, urlValid: false }); }); }); describe('setShowInsecureUrlCallout', () => { it('updates the url validation', () => { ExternalConnectorLogic.actions.setShowInsecureUrlCallout(true); - expect(ExternalConnectorLogic.values.showInsecureUrlCallout).toEqual(true); + expect(ExternalConnectorLogic.values).toEqual({ + ...DEFAULT_VALUES, + showInsecureUrlCallout: true, + }); }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_external_connector/external_connector_logic.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_external_connector/external_connector_logic.ts index 3bf96a31dd8c5..ecb139ede3132 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_external_connector/external_connector_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_external_connector/external_connector_logic.ts @@ -25,6 +25,7 @@ import { AddSourceLogic, SourceConfigData } from '../add_source_logic'; export interface ExternalConnectorActions { fetchExternalSource: () => true; fetchExternalSourceSuccess(sourceConfigData: SourceConfigData): SourceConfigData; + saveExternalConnectorConfigError: () => true; saveExternalConnectorConfigSuccess(externalConnectorId: string): string; setExternalConnectorApiKey(externalConnectorApiKey: string): string; saveExternalConnectorConfig(config: ExternalConnectorConfig): ExternalConnectorConfig; @@ -59,6 +60,7 @@ export const ExternalConnectorLogic = kea< actions: { fetchExternalSource: true, fetchExternalSourceSuccess: (sourceConfigData) => sourceConfigData, + saveExternalConnectorConfigError: true, saveExternalConnectorConfigSuccess: (externalConnectorId) => externalConnectorId, saveExternalConnectorConfig: (config) => config, setExternalConnectorApiKey: (externalConnectorApiKey: string) => externalConnectorApiKey, @@ -78,6 +80,7 @@ export const ExternalConnectorLogic = kea< false, { saveExternalConnectorConfigSuccess: () => false, + saveExternalConnectorConfigError: () => false, saveExternalConnectorConfig: () => true, }, ], @@ -168,6 +171,7 @@ export const ExternalConnectorLogic = kea< getSourcesPath(`${getAddPath('external')}`, AppLogic.values.isOrganization) ); } catch (e) { + actions.saveExternalConnectorConfigError(); flashAPIErrors(e); } } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source.test.tsx index d4b5a1dbd9829..e9cbafd01003e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source.test.tsx @@ -52,6 +52,7 @@ describe('AddSourceList', () => { dataLoading: false, newCustomSource: {}, isOrganization: true, + externalConfigured: false, }; beforeEach(() => { @@ -72,6 +73,17 @@ describe('AddSourceList', () => { expect(setAddSourceStep).toHaveBeenCalledWith(AddSourceSteps.SaveConfigStep); }); + it('renders default state correctly when there are multiple connector options, but all connectors have been configured', () => { + setMockValues({ ...mockValues, externalConfigured: true }); + const sourceData = { + ...staticSourceData[0], + externalConnectorAvailable: true, + configured: true, + }; + shallow(); + expect(initializeAddSource).toHaveBeenCalledWith(expect.objectContaining({ connect: true })); + }); + it('renders default state correctly when there are multiple connector options', () => { const wrapper = shallow( = (props) => { const { initializeAddSource, setAddSourceStep, saveSourceConfig, resetSourceState } = useActions(AddSourceLogic); const { addSourceCurrentStep, sourceConfigData, dataLoading } = useValues(AddSourceLogic); - const { name, categories, needsPermissions, accountContextOnly, privateSourcesEnabled } = - sourceConfigData; - const { serviceType, configuration, features, objTypes } = props.sourceData; + const { + name, + categories, + needsPermissions, + accountContextOnly, + privateSourcesEnabled, + configured, + } = sourceConfigData; + const { serviceType, configuration, features, objTypes, externalConnectorAvailable } = + props.sourceData; const addPath = getAddPath(serviceType); const { isOrganization } = useValues(AppLogic); const { externalConfigured } = useValues(SourcesLogic); useEffect(() => { - initializeAddSource(props); + // We can land on this page from a choice page for multiple types of connectors + // If that's the case we want to skip the intro and configuration, if the external & internal connector have already been configured + const goToConnect = externalConnectorAvailable && externalConfigured && configured; + initializeAddSource(goToConnect ? props : { ...props, connect: true }); return resetSourceState; }, []); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/custom_source_deployment.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/custom_source_deployment.test.tsx new file mode 100644 index 0000000000000..afacfd0ccbbf9 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/custom_source_deployment.test.tsx @@ -0,0 +1,99 @@ +/* + * 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 { setMockValues } from '../../../../__mocks__/kea_logic'; + +import React from 'react'; + +import { ShallowWrapper, shallow } from 'enzyme'; + +import { EuiPanel, EuiText, EuiHorizontalRule } from '@elastic/eui'; + +import { staticCustomSourceData } from '../source_data'; + +import { CustomSourceDeployment } from './custom_source_deployment'; +import { SourceIdentifier } from './source_identifier'; + +const customSource = { + id: 'id', + accessToken: 'token', + name: 'name', +}; + +const preconfiguredSourceData = { + ...staticCustomSourceData, + serviceType: 'sharepoint-server', + configuration: { + ...staticCustomSourceData.configuration, + githubRepository: 'elastic/sharepoint-server-connector', + }, +}; +const mockValues = { + sourceData: staticCustomSourceData, +}; + +describe('CustomSourceDeployment', () => { + describe('default behavior', () => { + let wrapper: ShallowWrapper; + + beforeAll(() => { + jest.clearAllMocks(); + setMockValues(mockValues); + + wrapper = shallow( + + ); + }); + + it('contains a source identifier', () => { + expect(wrapper.find(SourceIdentifier)).toHaveLength(1); + }); + + it('includes a link to generic documentation', () => { + expect(wrapper.find('[data-test-subj="GenericDocumentationLink"]')).toHaveLength(1); + }); + }); + + describe('for pre-configured custom sources', () => { + let wrapper: ShallowWrapper; + + beforeAll(() => { + jest.clearAllMocks(); + setMockValues({ + ...mockValues, + sourceData: {}, + }); + + wrapper = shallow( + + ); + }); + + it('includes a to the github repository', () => { + expect(wrapper.find('[data-test-subj="GithubRepositoryLink"]')).toHaveLength(1); + }); + + it('includes a link to service-type specific documentation', () => { + expect(wrapper.find('[data-test-subj="PreconfiguredDocumentationLink"]')).toHaveLength(1); + }); + }); + + it('can render a small version', () => { + jest.clearAllMocks(); + setMockValues(mockValues); + + const wrapper = shallow( + + ); + + expect(wrapper.find(EuiPanel).prop('paddingSize')).toEqual('m'); + + expect(wrapper.find(EuiText).prop('size')).toEqual('s'); + + expect(wrapper.find(EuiHorizontalRule).prop('margin')).toEqual('s'); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/custom_source_deployment.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/custom_source_deployment.tsx new file mode 100644 index 0000000000000..7d34783e998a7 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/custom_source_deployment.tsx @@ -0,0 +1,104 @@ +/* + * 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 { EuiPanel, EuiText, EuiSpacer, EuiLink, EuiHorizontalRule } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { EuiLinkTo } from '../../../../shared/react_router_helpers'; +import { API_KEY_LABEL } from '../../../constants'; +import { API_KEYS_PATH } from '../../../routes'; + +import { ContentSource, CustomSource, SourceDataItem } from '../../../types'; + +import { SourceIdentifier } from './source_identifier'; + +interface Props { + source: ContentSource | CustomSource; + sourceData: SourceDataItem; + small?: boolean; +} +export const CustomSourceDeployment: React.FC = ({ source, sourceData, small = false }) => { + const { name, id } = source; + const { + configuration: { documentationUrl, githubRepository }, + } = sourceData; + return ( + + + {githubRepository ? ( + <> + + + + ), + }} + /> + + + + + ), + }} + /> + + ) : ( + + + + ), + }} + /> + )} + + + {API_KEY_LABEL} + + ), + }} + /> + + + + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.test.tsx index 21a71308a1832..9af4eae693d7c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.test.tsx @@ -12,10 +12,14 @@ import React from 'react'; import { shallow } from 'enzyme'; -import { EuiCallOut, EuiConfirmModal, EuiEmptyPrompt, EuiPanel, EuiTable } from '@elastic/eui'; +import { EuiCallOut, EuiConfirmModal, EuiEmptyPrompt, EuiTable } from '@elastic/eui'; import { ComponentLoader } from '../../../components/shared/component_loader'; +import * as SourceData from '../source_data'; + +import { CustomSourceDeployment } from './custom_source_deployment'; + import { Overview } from './overview'; describe('Overview', () => { @@ -31,6 +35,7 @@ describe('Overview', () => { }; beforeEach(() => { + jest.clearAllMocks(); setMockValues({ ...mockValues }); setMockActions({ initializeSourceSynchronization }); }); @@ -83,14 +88,6 @@ describe('Overview', () => { expect(groupsSummary.find('[data-test-subj="SourceGroupLink"]')).toHaveLength(1); }); - it('renders DocumentationCallout', () => { - setMockValues({ ...mockValues, contentSource: fullContentSources[1] }); - const wrapper = shallow(); - const documentationCallout = wrapper.find('[data-test-subj="DocumentationCallout"]').dive(); - - expect(documentationCallout.find(EuiPanel)).toHaveLength(1); - }); - it('renders PermissionsStatus', () => { setMockValues({ ...mockValues, @@ -146,4 +143,44 @@ describe('Overview', () => { expect(initializeSourceSynchronization).toHaveBeenCalled(); }); + + it('uses a base service type if one is provided', () => { + jest.spyOn(SourceData, 'getSourceData'); + setMockValues({ + ...mockValues, + contentSource: { + ...fullContentSources[0], + baseServiceType: 'share_point_server', + }, + }); + + shallow(); + + expect(SourceData.getSourceData).toHaveBeenCalledWith('share_point_server'); + }); + + it('defaults to the regular service tye', () => { + jest.spyOn(SourceData, 'getSourceData'); + setMockValues({ + ...mockValues, + contentSource: fullContentSources[0], + }); + + shallow(); + + expect(SourceData.getSourceData).toHaveBeenCalledWith('custom'); + }); + + describe('custom sources', () => { + it('includes deployment instructions', () => { + setMockValues({ + ...mockValues, + contentSource: fullContentSources[1], + }); + + const wrapper = shallow(); + + expect(wrapper.find(CustomSourceDeployment)).toHaveLength(1); + }); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.tsx index 8f287537e4109..698dc7a60eea4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.tsx @@ -43,11 +43,7 @@ import { ComponentLoader } from '../../../components/shared/component_loader'; import { LicenseBadge } from '../../../components/shared/license_badge'; import { StatusItem } from '../../../components/shared/status_item'; import { ViewContentHeader } from '../../../components/shared/view_content_header'; -import { - RECENT_ACTIVITY_TITLE, - CREDENTIALS_TITLE, - DOCUMENTATION_LINK_TITLE, -} from '../../../constants'; +import { RECENT_ACTIVITY_TITLE } from '../../../constants'; import { SYNC_FREQUENCY_PATH, BLOCKED_TIME_WINDOWS_PATH, @@ -78,7 +74,6 @@ import { EXTERNAL_IDENTITIES_LINK, LEARN_CUSTOM_FEATURES_BUTTON, DOC_PERMISSIONS_DESCRIPTION, - CUSTOM_CALLOUT_TITLE, SOURCE_SYNCHRONIZATION_TITLE, SOURCE_SYNC_FREQUENCY_LINK_LABEL, SOURCE_BLOCKED_TIME_WINDOWS_LINK_LABEL, @@ -86,9 +81,10 @@ import { SOURCE_SYNC_CONFIRM_TITLE, SOURCE_SYNC_CONFIRM_MESSAGE, } from '../constants'; +import { getSourceData } from '../source_data'; import { SourceLogic } from '../source_logic'; -import { SourceIdentifier } from './source_identifier'; +import { CustomSourceDeployment } from './custom_source_deployment'; import { SourceLayout } from './source_layout'; export const Overview: React.FC = () => { @@ -109,10 +105,13 @@ export const Overview: React.FC = () => { hasPermissions, isFederatedSource, isIndexedSource, - serviceType, name, } = contentSource; + const serviceType = contentSource.baseServiceType || contentSource.serviceType; + + const sourceData = getSourceData(serviceType); + const [isSyncing, setIsSyncing] = useState(false); const [isModalVisible, setIsModalVisible] = useState(false); const closeModal = () => setIsModalVisible(false); @@ -363,27 +362,27 @@ export const Overview: React.FC = () => { ); const sourceStatus = ( - - -
- {STATUS_HEADER} -
-
+ <> + +
{STATUS_HEADER}
+
- - - - - - - {STATUS_HEADING} - - -

{STATUS_TEXT}

-
-
-
-
+ + + + + + + + {STATUS_HEADING} + + +

{STATUS_TEXT}

+
+
+
+
+ ); const permissionsStatus = ( @@ -422,56 +421,45 @@ export const Overview: React.FC = () => { ); - const credentials = ( - - -
- {CREDENTIALS_TITLE} -
-
- - -
- ); - - const DocumentationCallout = ({ - title, - children, - }: { - title: string; - children: React.ReactNode; - }) => ( - - + const customSourceDeployment = ( + <> +
- {DOCUMENTATION_LINK_TITLE} + {i18n.translate('xpack.enterpriseSearch.workplaceSearch.deployment.title', { + defaultMessage: 'Deployment', + })}
-
- - - {title} - {children} -
+ + + ); const documentPermssionsLicenseLocked = ( - - - - - {DOCUMENT_PERMISSIONS_TITLE} - - -

{DOC_PERMISSIONS_DESCRIPTION}

-
+ <> + + + + {DOCUMENT_PERMISSIONS_TITLE} + + + + + + - - - {LEARN_CUSTOM_FEATURES_BUTTON} - - -
+ + +

{DOC_PERMISSIONS_DESCRIPTION}

+
+ + + + {LEARN_CUSTOM_FEATURES_BUTTON} + + +
+ ); const syncTriggerCallout = ( @@ -557,27 +545,7 @@ export const Overview: React.FC = () => { {custom && ( <> {sourceStatus} - {credentials} - - -

- - {LEARN_MORE_LINK} - - ), - }} - /> -

-
-
+ {customSourceDeployment} {!licenseSupportsPermissions && ( {documentPermssionsLicenseLocked} )} diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx index 5b1e4d97ef4cd..3cd8fb2bbcd33 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/source_data.tsx @@ -634,3 +634,10 @@ export const staticCustomSourceData: SourceDataItem = { accountContextOnly: false, customConnectorAvailable: true, }; + +export const getSourceData = (serviceType: string): SourceDataItem => { + return ( + staticSourceData.find((staticSource) => staticSource.serviceType === serviceType) || + staticCustomSourceData + ); +}; diff --git a/x-pack/plugins/enterprise_search/server/lib/fetch_indices.test.ts b/x-pack/plugins/enterprise_search/server/lib/fetch_indices.test.ts index c983df7241e0a..6bf95487a0022 100644 --- a/x-pack/plugins/enterprise_search/server/lib/fetch_indices.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/fetch_indices.test.ts @@ -70,7 +70,6 @@ describe('fetchIndices lib function', () => { size_in_bytes: '105.47kb', }, }, - aliases: 'none', name: 'search-regular-index', }, ]); @@ -120,8 +119,22 @@ describe('fetchIndices lib function', () => { size_in_bytes: '105.47kb', }, }, - aliases: ['search-aliased', 'search-double-aliased'], - name: 'index-without-prefix', + name: 'search-aliased', + }, + { + health: 'green', + status: 'open', + uuid: '83a81e7e-5955-4255-b008-5d6961203f57', + total: { + docs: { + count: 100, + deleted: 0, + }, + store: { + size_in_bytes: '105.47kb', + }, + }, + name: 'search-double-aliased', }, ]); }); @@ -139,7 +152,6 @@ describe('fetchIndices lib function', () => { // deleted index won't be present in the indices stats call response await expect(fetchIndices(mockClient as unknown as IScopedClusterClient)).resolves.toEqual([ { - aliases: 'none', name: 'search-regular-index', total: { docs: { diff --git a/x-pack/plugins/enterprise_search/server/lib/fetch_indices.ts b/x-pack/plugins/enterprise_search/server/lib/fetch_indices.ts index 770b967bf7fb3..4b8c2612f6467 100644 --- a/x-pack/plugins/enterprise_search/server/lib/fetch_indices.ts +++ b/x-pack/plugins/enterprise_search/server/lib/fetch_indices.ts @@ -13,6 +13,7 @@ import { ElasticsearchIndex } from '../../common/types'; export const fetchIndices = async (client: IScopedClusterClient): Promise => { const indexNamesString = 'search-*'; + const indexNamesRegEx = /^search-*/; // This call retrieves alias and settings information about indices const indices = await client.asCurrentUser.indices.get({ @@ -36,31 +37,43 @@ export const fetchIndices = async (client: IScopedClusterClient): Promise { - const indexData = indices[indexName]; - const indexStats = indicesStats[indexName]; - const aliases = Object.keys(indexData.aliases!); - const sizeInBytes = new ByteSizeValue(indexStats?.total?.store?.size_in_bytes ?? 0).toString(); + return indicesNames + .map((indexName: string) => { + const indexData = indices[indexName]; + const indexStats = indicesStats[indexName]; + const aliases = Object.keys(indexData.aliases!); + const sizeInBytes = new ByteSizeValue( + indexStats?.total?.store?.size_in_bytes ?? 0 + ).toString(); - const docCount = indexStats?.total?.docs?.count ?? 0; - const docDeleted = indexStats?.total?.docs?.deleted ?? 0; - const total = { - docs: { - count: docCount, - deleted: docDeleted, - }, - store: { - size_in_bytes: sizeInBytes, - }, - }; + const docCount = indexStats?.total?.docs?.count ?? 0; + const docDeleted = indexStats?.total?.docs?.deleted ?? 0; + const total = { + docs: { + count: docCount, + deleted: docDeleted, + }, + store: { + size_in_bytes: sizeInBytes, + }, + }; - return { - health: indexStats?.health, - status: indexStats?.status, - name: indexName, - uuid: indexStats?.uuid, - total, - aliases: aliases.length ? aliases : 'none', - }; - }); + return { + health: indexStats?.health, + status: indexStats?.status, + name: indexName, + uuid: indexStats?.uuid, + total, + aliases, + }; + }) + .flatMap(({ name, aliases, ...engineData }) => { + const engines = []; + engines.push({ name, ...engineData }); + aliases.forEach((alias) => { + engines.push({ name: alias, ...engineData }); + }); + return engines; + }) + .filter(({ name }) => name.match(indexNamesRegEx)); }; diff --git a/x-pack/plugins/event_log/generated/mappings.json b/x-pack/plugins/event_log/generated/mappings.json index 3187423e91b29..f030f0d50b5e7 100644 --- a/x-pack/plugins/event_log/generated/mappings.json +++ b/x-pack/plugins/event_log/generated/mappings.json @@ -296,6 +296,9 @@ "number_of_triggered_actions": { "type": "long" }, + "number_of_scheduled_actions": { + "type": "long" + }, "number_of_searches": { "type": "long" }, diff --git a/x-pack/plugins/event_log/generated/schemas.ts b/x-pack/plugins/event_log/generated/schemas.ts index 5a26cb92c636c..817c545b45c56 100644 --- a/x-pack/plugins/event_log/generated/schemas.ts +++ b/x-pack/plugins/event_log/generated/schemas.ts @@ -130,6 +130,7 @@ export const EventSchema = schema.maybe( metrics: schema.maybe( schema.object({ number_of_triggered_actions: ecsNumber(), + number_of_scheduled_actions: ecsNumber(), number_of_searches: ecsNumber(), total_indexing_duration_ms: ecsNumber(), es_search_duration_ms: ecsNumber(), diff --git a/x-pack/plugins/event_log/scripts/mappings.js b/x-pack/plugins/event_log/scripts/mappings.js index cc255c2b15719..bf3f9c6b88009 100644 --- a/x-pack/plugins/event_log/scripts/mappings.js +++ b/x-pack/plugins/event_log/scripts/mappings.js @@ -78,6 +78,9 @@ exports.EcsCustomPropertyMappings = { number_of_triggered_actions: { type: 'long', }, + number_of_scheduled_actions: { + type: 'long', + }, number_of_searches: { type: 'long', }, diff --git a/x-pack/plugins/file_upload/public/api/index.ts b/x-pack/plugins/file_upload/public/api/index.ts index 7224eacc08e42..4284102b26674 100644 --- a/x-pack/plugins/file_upload/public/api/index.ts +++ b/x-pack/plugins/file_upload/public/api/index.ts @@ -42,7 +42,7 @@ export async function importerFactory( } interface HasImportPermissionParams { - checkCreateIndexPattern: boolean; + checkCreateDataView: boolean; checkHasManagePipeline: boolean; indexName?: string; } diff --git a/x-pack/plugins/file_upload/public/components/geo_upload_wizard.tsx b/x-pack/plugins/file_upload/public/components/geo_upload_wizard.tsx index 8c876c84b3b77..24fcbdd7e1ed0 100644 --- a/x-pack/plugins/file_upload/public/components/geo_upload_wizard.tsx +++ b/x-pack/plugins/file_upload/public/components/geo_upload_wizard.tsx @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiProgress, EuiText } from '@elastic/eui'; -import { getIndexPatternService } from '../kibana_services'; +import { getDataViewsService } from '../kibana_services'; import { GeoUploadForm, OnFileSelectParameters } from './geo_upload_form'; import { ImportCompleteView } from './import_complete_view'; import { ES_FIELD_TYPES } from '../../../../../src/plugins/data/public'; @@ -38,7 +38,7 @@ interface State { importResults?: ImportResults; indexName: string; indexNameError?: string; - indexPatternResp?: object; + dataViewResp?: object; phase: PHASE; } @@ -81,7 +81,7 @@ export class GeoUploadWizard extends Component // check permissions // const canImport = await hasImportPermission({ - checkCreateIndexPattern: true, + checkCreateDataView: true, checkHasManagePipeline: false, indexName: this.state.indexName, }); @@ -179,24 +179,24 @@ export class GeoUploadWizard extends Component // this.setState({ importResults, - importStatus: i18n.translate('xpack.fileUpload.geoUploadWizard.creatingIndexPattern', { + importStatus: i18n.translate('xpack.fileUpload.geoUploadWizard.creatingDataView', { defaultMessage: 'Creating data view: {indexName}', values: { indexName: this.state.indexName }, }), }); - let indexPattern; + let dataView; let results: FileUploadGeoResults | undefined; try { - indexPattern = await getIndexPatternService().createAndSave( + dataView = await getDataViewsService().createAndSave( { title: this.state.indexName, }, true ); - if (!indexPattern.id) { + if (!dataView.id) { throw new Error('id not provided'); } - const geoField = indexPattern.fields.find((field) => + const geoField = dataView.fields.find((field) => [ES_FIELD_TYPES.GEO_POINT as string, ES_FIELD_TYPES.GEO_SHAPE as string].includes( field.type ) @@ -205,7 +205,7 @@ export class GeoUploadWizard extends Component throw new Error('geo field not created'); } results = { - indexPatternId: indexPattern.id, + indexPatternId: dataView.id, geoFieldName: geoField.name, geoFieldType: geoField.type as ES_FIELD_TYPES.GEO_POINT | ES_FIELD_TYPES.GEO_SHAPE, docCount: importResults.docCount !== undefined ? importResults.docCount : 0, @@ -213,7 +213,7 @@ export class GeoUploadWizard extends Component } catch (error) { if (this._isMounted) { this.setState({ - importStatus: i18n.translate('xpack.fileUpload.geoUploadWizard.indexPatternError', { + importStatus: i18n.translate('xpack.fileUpload.geoUploadWizard.dataViewError', { defaultMessage: 'Unable to create data view', }), phase: PHASE.COMPLETE, @@ -230,10 +230,10 @@ export class GeoUploadWizard extends Component // Successful import // this.setState({ - indexPatternResp: { + dataViewResp: { success: true, - id: indexPattern.id, - fields: indexPattern.fields, + id: dataView.id, + fields: dataView.fields, }, phase: PHASE.COMPLETE, importStatus: '', @@ -297,7 +297,7 @@ export class GeoUploadWizard extends Component return ( diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index 09f2ad96d11f4..5a7483328112e 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -30,7 +30,7 @@ const services = { interface Props { failedPermissionCheck: boolean; importResults?: ImportResults; - indexPatternResp?: object; + dataViewResp?: object; indexName: string; } @@ -213,11 +213,11 @@ export class ImportCompleteView extends Component { 'indexRespCopyButton' )} {this._renderCodeEditor( - this.props.indexPatternResp, - i18n.translate('xpack.fileUpload.importComplete.indexPatternResponse', { + this.props.dataViewResp, + i18n.translate('xpack.fileUpload.importComplete.dataViewResponse', { defaultMessage: 'Data view response', }), - 'indexPatternRespCopyButton' + 'dataViewRespCopyButton' )} {this._renderIndexManagementMsg()} diff --git a/x-pack/plugins/file_upload/public/kibana_services.ts b/x-pack/plugins/file_upload/public/kibana_services.ts index dfe2785e7a2bc..76dd6f660da51 100644 --- a/x-pack/plugins/file_upload/public/kibana_services.ts +++ b/x-pack/plugins/file_upload/public/kibana_services.ts @@ -16,7 +16,7 @@ export function setStartServices(core: CoreStart, plugins: FileUploadStartDepend } export const getDocLinks = () => coreStart.docLinks; -export const getIndexPatternService = () => pluginsStart.data.indexPatterns; +export const getDataViewsService = () => pluginsStart.data.dataViews; export const getHttp = () => coreStart.http; export const getSavedObjectsClient = () => coreStart.savedObjects.client; export const getUiSettings = () => coreStart.uiSettings; diff --git a/x-pack/plugins/file_upload/public/validate_index_name.ts b/x-pack/plugins/file_upload/public/validate_index_name.ts index 39cffdf63580e..4c3c7747c5fd9 100644 --- a/x-pack/plugins/file_upload/public/validate_index_name.ts +++ b/x-pack/plugins/file_upload/public/validate_index_name.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { getIndexPatternService } from './kibana_services'; +import { getDataViewsService } from './kibana_services'; import { checkIndexExists } from './api'; export function checkIndexPatternValid(name: string) { @@ -35,9 +35,9 @@ export const validateIndexName = async (indexName: string) => { }); } - const indexPatternNames = await getIndexPatternService().getTitles(); - if (indexPatternNames.includes(indexName)) { - return i18n.translate('xpack.fileUpload.indexPatternAlreadyExistsErrorMessage', { + const dataViewNames = await getDataViewsService().getTitles(); + if (dataViewNames.includes(indexName)) { + return i18n.translate('xpack.fileUpload.dataViewAlreadyExistsErrorMessage', { defaultMessage: 'Data view already exists.', }); } diff --git a/x-pack/plugins/file_upload/server/capabilities.ts b/x-pack/plugins/file_upload/server/capabilities.ts index 17880b98150d6..585aca196c66e 100644 --- a/x-pack/plugins/file_upload/server/capabilities.ts +++ b/x-pack/plugins/file_upload/server/capabilities.ts @@ -30,7 +30,7 @@ export const setupCapabilities = ( const { hasImportPermission } = await checkFileUploadPrivileges({ authorization: security?.authz, request, - checkCreateIndexPattern: true, + checkCreateDataView: true, checkHasManagePipeline: false, }); diff --git a/x-pack/plugins/file_upload/server/check_privileges.ts b/x-pack/plugins/file_upload/server/check_privileges.ts index 42cc53f693fec..5f8b521506840 100644 --- a/x-pack/plugins/file_upload/server/check_privileges.ts +++ b/x-pack/plugins/file_upload/server/check_privileges.ts @@ -15,7 +15,7 @@ interface Deps { 'mode' | 'actions' | 'checkPrivilegesDynamicallyWithRequest' >; checkHasManagePipeline: boolean; - checkCreateIndexPattern: boolean; + checkCreateDataView: boolean; indexName?: string; } @@ -23,7 +23,7 @@ export const checkFileUploadPrivileges = async ({ request, authorization, checkHasManagePipeline, - checkCreateIndexPattern, + checkCreateDataView, indexName, }: Deps) => { const requiresAuthz = authorization?.mode.useRbacForRequest(request) ?? false; @@ -42,7 +42,7 @@ export const checkFileUploadPrivileges = async ({ index: indexName ? { [indexName]: ['create', 'create_index'] } : {}, }, }; - if (checkCreateIndexPattern) { + if (checkCreateDataView) { checkPrivilegesPayload.kibana = [ authorization.actions.savedObject.get('index-pattern', 'create'), ]; diff --git a/x-pack/plugins/file_upload/server/routes.ts b/x-pack/plugins/file_upload/server/routes.ts index eeb22faefb1ca..82c66d9c73313 100644 --- a/x-pack/plugins/file_upload/server/routes.ts +++ b/x-pack/plugins/file_upload/server/routes.ts @@ -50,7 +50,7 @@ export function fileUploadRoutes(coreSetup: CoreSetup, logge validate: { query: schema.object({ indexName: schema.maybe(schema.string()), - checkCreateIndexPattern: schema.boolean(), + checkCreateDataView: schema.boolean(), checkHasManagePipeline: schema.boolean(), }), }, @@ -58,13 +58,13 @@ export function fileUploadRoutes(coreSetup: CoreSetup, logge async (context, request, response) => { try { const [, pluginsStart] = await coreSetup.getStartServices(); - const { indexName, checkCreateIndexPattern, checkHasManagePipeline } = request.query; + const { indexName, checkCreateDataView, checkHasManagePipeline } = request.query; const { hasImportPermission } = await checkFileUploadPrivileges({ authorization: pluginsStart.security?.authz, request, indexName, - checkCreateIndexPattern, + checkCreateDataView, checkHasManagePipeline, }); diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index e9bb796626f58..dfc257b2bfe1e 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -1157,7 +1157,7 @@ "schema": { "type": "array" }, - "name": "agentsIds", + "name": "agentsId", "in": "query", "required": true } @@ -2302,7 +2302,15 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/get_enrollment_api_keys_response" + "type": "object", + "properties": { + "item": { + "$ref": "#/components/schemas/enrollment_api_key" + } + }, + "required": [ + "item" + ] } } } @@ -3586,7 +3594,7 @@ "lens", "ml-module", "security-rule", - "csp-rule-template" + "csp_rule_template" ] }, "elasticsearch_asset_type": { @@ -4152,30 +4160,6 @@ "created_at" ] }, - "get_enrollment_api_keys_response": { - "title": "Bulk install packages response", - "type": "object", - "properties": { - "list": { - "type": "array", - "deprecated": true, - "properties": { - "items": { - "$ref": "#/components/schemas/enrollment_api_key" - } - } - }, - "item": { - "type": "array", - "items": { - "$ref": "#/components/schemas/enrollment_api_key" - } - } - }, - "required": [ - "item" - ] - }, "upgrade_diff": { "title": "Package policy Upgrade dryrun", "type": "array", diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index f7941f863c120..d91ebd515600d 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -1412,7 +1412,12 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/get_enrollment_api_keys_response' + type: object + properties: + item: + $ref: '#/components/schemas/enrollment_api_key' + required: + - item operationId: get-enrollment-api-key delete: summary: Enrollment API Key - Delete @@ -2613,22 +2618,6 @@ components: - api_key - active - created_at - get_enrollment_api_keys_response: - title: Bulk install packages response - type: object - properties: - list: - type: array - deprecated: true - properties: - items: - $ref: '#/components/schemas/enrollment_api_key' - item: - type: array - items: - $ref: '#/components/schemas/enrollment_api_key' - required: - - item upgrade_diff: title: Package policy Upgrade dryrun type: array diff --git a/x-pack/plugins/fleet/common/openapi/components/schemas/get_enrollment_api_keys_response.yaml b/x-pack/plugins/fleet/common/openapi/components/schemas/get_enrollment_api_keys_response.yaml deleted file mode 100644 index c8a121a6ffee3..0000000000000 --- a/x-pack/plugins/fleet/common/openapi/components/schemas/get_enrollment_api_keys_response.yaml +++ /dev/null @@ -1,15 +0,0 @@ -title: Bulk install packages response -type: object -properties: - list: - type: array - deprecated: true - properties: - items: - $ref: ./enrollment_api_key.yaml - item: - type: array - items: - $ref: ./enrollment_api_key.yaml -required: - - item diff --git a/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys@{key_id}.yaml b/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys@{key_id}.yaml index f5e0905464346..37c390897ef67 100644 --- a/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys@{key_id}.yaml +++ b/x-pack/plugins/fleet/common/openapi/paths/enrollment_api_keys@{key_id}.yaml @@ -13,7 +13,12 @@ get: content: application/json: schema: - $ref: ../components/schemas/get_enrollment_api_keys_response.yaml + type: object + properties: + item: + $ref: ../components/schemas/enrollment_api_key.yaml + required: + - item operationId: get-enrollment-api-key delete: summary: Enrollment API Key - Delete diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx index f366f32a36b84..2517d5c9e6f5c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx @@ -45,7 +45,7 @@ export interface EditOutputFlyoutProps { const OUTPUT_TYPE_OPTIONS = [ { value: 'elasticsearch', text: 'Elasticsearch' }, - { value: 'logstash', text: 'Logstash' }, + { value: 'logstash', text: 'Logstash (BETA)' }, ]; export const EditOutputFlyout: React.FunctionComponent = ({ @@ -130,6 +130,23 @@ export const EditOutputFlyout: React.FunctionComponent = defaultMessage="Type" /> } + helpText={ + isLogstashOutput && ( + + {i18n.translate('xpack.fleet.editOutputFlyout.learnMoreLink', { + defaultMessage: 'Learn more', + })} + + ), + }} + /> + ) + } > { +// FLAKY: https://github.com/elastic/kibana/issues/127076 +describe.skip('Fleet preconfiguration reset', () => { let esServer: kbnTestServer.TestElasticsearchUtils; let kbnServer: kbnTestServer.TestKibanaUtils; diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_2_0.test.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_2_0.test.ts index a1cd0f01ac225..dabd76dd48635 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_2_0.test.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_2_0.test.ts @@ -12,7 +12,12 @@ import type { PackagePolicy } from '../../../../common'; import { migratePackagePolicyToV820 as migration } from './to_v8_2_0'; describe('8.2.0 Endpoint Package Policy migration', () => { - const policyDoc = ({ windowsMalware = {}, macMalware = {}, linuxMalware = {} }) => { + const policyDoc = ({ + windowsMalware = {}, + macMalware = {}, + linuxMalware = {}, + linuxEvents = {}, + }) => { return { id: 'mock-saved-object-id', attributes: { @@ -48,6 +53,7 @@ describe('8.2.0 Endpoint Package Policy migration', () => { }, linux: { ...linuxMalware, + ...linuxEvents, }, }, }, @@ -64,12 +70,14 @@ describe('8.2.0 Endpoint Package Policy migration', () => { windowsMalware: { malware: { mode: 'off' } }, macMalware: { malware: { mode: 'off' } }, linuxMalware: { malware: { mode: 'off' } }, + linuxEvents: { events: { process: true, file: true, network: true } }, }); const migratedDoc = policyDoc({ windowsMalware: { malware: { mode: 'off', blocklist: false } }, macMalware: { malware: { mode: 'off', blocklist: false } }, linuxMalware: { malware: { mode: 'off', blocklist: false } }, + linuxEvents: { events: { process: true, file: true, network: true, session_data: false } }, }); expect(migration(initialDoc, {} as SavedObjectMigrationContext)).toEqual(migratedDoc); @@ -80,12 +88,14 @@ describe('8.2.0 Endpoint Package Policy migration', () => { windowsMalware: { malware: { mode: 'prevent' } }, macMalware: { malware: { mode: 'prevent' } }, linuxMalware: { malware: { mode: 'prevent' } }, + linuxEvents: { events: { process: true, file: true, network: true } }, }); const migratedDoc = policyDoc({ windowsMalware: { malware: { mode: 'prevent', blocklist: true } }, macMalware: { malware: { mode: 'prevent', blocklist: true } }, linuxMalware: { malware: { mode: 'prevent', blocklist: true } }, + linuxEvents: { events: { process: true, file: true, network: true, session_data: false } }, }); expect(migration(initialDoc, {} as SavedObjectMigrationContext)).toEqual(migratedDoc); @@ -96,12 +106,14 @@ describe('8.2.0 Endpoint Package Policy migration', () => { windowsMalware: { malware: { mode: 'detect' } }, macMalware: { malware: { mode: 'detect' } }, linuxMalware: { malware: { mode: 'detect' } }, + linuxEvents: { events: { process: true, file: true, network: true } }, }); const migratedDoc = policyDoc({ windowsMalware: { malware: { mode: 'detect', blocklist: true } }, macMalware: { malware: { mode: 'detect', blocklist: true } }, linuxMalware: { malware: { mode: 'detect', blocklist: true } }, + linuxEvents: { events: { process: true, file: true, network: true, session_data: false } }, }); expect(migration(initialDoc, {} as SavedObjectMigrationContext)).toEqual(migratedDoc); diff --git a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_2_0.ts b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_2_0.ts index dbc5c2f32a2a8..d6610915c0031 100644 --- a/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_2_0.ts +++ b/x-pack/plugins/fleet/server/saved_objects/migrations/security_solution/to_v8_2_0.ts @@ -28,6 +28,8 @@ export const migratePackagePolicyToV820: SavedObjectMigrationFn { default: { type: 'elasticsearch', hosts: ['http://127.0.0.1:9201'], - ca_sha256: undefined, }, }, inputs: [], @@ -176,7 +175,6 @@ describe('getFullAgentPolicy', () => { default: { type: 'elasticsearch', hosts: ['http://127.0.0.1:9201'], - ca_sha256: undefined, }, }, inputs: [], @@ -210,7 +208,6 @@ describe('getFullAgentPolicy', () => { default: { type: 'elasticsearch', hosts: ['http://127.0.0.1:9201'], - ca_sha256: undefined, }, }, inputs: [], @@ -316,7 +313,6 @@ describe('transformOutputToFullPolicyOutput', () => { expect(policyOutput).toMatchInlineSnapshot(` Object { - "ca_sha256": undefined, "hosts": Array [ "http://host.fr", ], @@ -341,7 +337,6 @@ ssl.test: 123 expect(policyOutput).toMatchInlineSnapshot(` Object { - "ca_sha256": undefined, "hosts": Array [ "http://host.fr", ], @@ -368,7 +363,6 @@ ssl.test: 123 expect(policyOutput).toMatchInlineSnapshot(` Object { - "ca_sha256": undefined, "hosts": Array [ "http://host.fr", ], @@ -394,7 +388,6 @@ ssl.test: 123 expect(policyOutput).toMatchInlineSnapshot(` Object { - "ca_sha256": undefined, "hosts": Array [ "host.fr:3332", ], diff --git a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts index 0bc5315f62ddf..3114ac3c0a8ed 100644 --- a/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policies/full_agent_policy.ts @@ -179,7 +179,7 @@ export function transformOutputToFullPolicyOutput( ...configJs, type, hosts, - ca_sha256, + ...(ca_sha256 ? { ca_sha256 } : {}), ...(ssl ? { ssl } : {}), ...(ca_trusted_fingerprint ? { 'ssl.ca_trusted_fingerprint': ca_trusted_fingerprint } : {}), }; diff --git a/x-pack/plugins/fleet/server/services/output.test.ts b/x-pack/plugins/fleet/server/services/output.test.ts index a08fd7a81759d..211abecbc4395 100644 --- a/x-pack/plugins/fleet/server/services/output.test.ts +++ b/x-pack/plugins/fleet/server/services/output.test.ts @@ -84,6 +84,13 @@ function getMockedSoClient( }); } + case outputIdToUuid('existing-es-output'): { + return mockOutputSO('existing-es-output', { + type: 'elasticsearch', + is_default: false, + }); + } + default: throw new Error('not found: ' + id); } @@ -445,6 +452,26 @@ describe('Output Service', () => { ); }); + // With ES output + it('Should delete Logstash specific fields if the output type change to ES', async () => { + const soClient = getMockedSoClient({}); + mockedAgentPolicyService.list.mockResolvedValue({ + items: [{}], + } as unknown as ReturnType); + mockedAgentPolicyService.hasAPMIntegration.mockReturnValue(false); + + await outputService.update(soClient, 'existing-logstash-output', { + type: 'elasticsearch', + hosts: ['http://test:4343'], + }); + + expect(soClient.update).toBeCalledWith(expect.anything(), expect.anything(), { + type: 'elasticsearch', + hosts: ['http://test:4343'], + ssl: null, + }); + }); + // With logstash output it('Should work if you try to make that output the default output and no policies using default output has APM integration', async () => { const soClient = getMockedSoClient({}); @@ -472,6 +499,25 @@ describe('Output Service', () => { }) ).rejects.toThrow(`Logstash output cannot be used with APM integration.`); }); + it('Should delete ES specific fields if the output type change to logstash', async () => { + const soClient = getMockedSoClient({}); + mockedAgentPolicyService.list.mockResolvedValue({ + items: [{}], + } as unknown as ReturnType); + mockedAgentPolicyService.hasAPMIntegration.mockReturnValue(false); + + await outputService.update(soClient, 'existing-es-output', { + type: 'logstash', + hosts: ['test:4343'], + }); + + expect(soClient.update).toBeCalledWith(expect.anything(), expect.anything(), { + type: 'logstash', + hosts: ['test:4343'], + ca_sha256: null, + ca_trusted_fingerprint: null, + }); + }); }); describe('delete', () => { diff --git a/x-pack/plugins/fleet/server/services/output.ts b/x-pack/plugins/fleet/server/services/output.ts index 9302c87af85c1..3d2f5de0339ca 100644 --- a/x-pack/plugins/fleet/server/services/output.ts +++ b/x-pack/plugins/fleet/server/services/output.ts @@ -21,6 +21,8 @@ import { OutputUnauthorizedError, OutputInvalidError } from '../errors'; import { agentPolicyService } from './agent_policy'; import { appContextService } from './app_context'; +type Nullable = { [P in keyof T]: T[P] | null }; + const SAVED_OBJECT_TYPE = OUTPUT_SAVED_OBJECT_TYPE; const DEFAULT_ES_HOSTS = ['http://localhost:9200']; @@ -309,7 +311,7 @@ class OutputService { ); } - const updateData = { ...data }; + const updateData: Nullable> = { ...data }; const mergedType = data.type ?? originalOutput.type; const mergedIsDefault = data.is_default ?? originalOutput.is_default; @@ -317,6 +319,18 @@ class OutputService { await validateLogstashOutputNotUsedInAPMPolicy(soClient, id, mergedIsDefault); } + // If the output type changed + if (data.type && data.type !== originalOutput.type) { + if (data.type === outputType.Logstash) { + // remove ES specific field + updateData.ca_trusted_fingerprint = null; + updateData.ca_sha256 = null; + } else { + // remove logstash specific field + updateData.ssl = null; + } + } + // ensure only default output exists if (data.is_default) { const defaultDataOuputId = await this.getDefaultDataOutputId(soClient); @@ -345,7 +359,7 @@ class OutputService { if (mergedType === outputType.Elasticsearch && updateData.hosts) { updateData.hosts = updateData.hosts.map(normalizeHostsForAgents); } - const outputSO = await soClient.update( + const outputSO = await soClient.update>( SAVED_OBJECT_TYPE, outputIdToUuid(id), updateData diff --git a/x-pack/plugins/infra/common/alerting/metrics/alert_link.ts b/x-pack/plugins/infra/common/alerting/metrics/alert_link.ts new file mode 100644 index 0000000000000..b6d09e1004a70 --- /dev/null +++ b/x-pack/plugins/infra/common/alerting/metrics/alert_link.ts @@ -0,0 +1,48 @@ +/* + * 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 { ALERT_RULE_PARAMETERS, TIMESTAMP } from '@kbn/rule-data-utils'; +import { encode } from 'rison-node'; +import { stringify } from 'query-string'; +import { ParsedTechnicalFields } from '../../../../rule_registry/common/parse_technical_fields'; + +export const getInventoryViewInAppUrl = ( + fields: ParsedTechnicalFields & Record +): string => { + const nodeTypeField = `${ALERT_RULE_PARAMETERS}.nodeType`; + const nodeType = fields[nodeTypeField]; + let inventoryViewInAppUrl = '/app/metrics/link-to/inventory?'; + if (nodeType) { + const linkToParams: Record = { + nodeType: fields[nodeTypeField][0], + timestamp: Date.parse(fields[TIMESTAMP]), + customMetric: '', + }; + // We always pick the first criteria metric for the URL + const criteriaMetric = fields[`${ALERT_RULE_PARAMETERS}.criteria.metric`][0]; + const criteriaCustomMetricId = fields[`${ALERT_RULE_PARAMETERS}.criteria.customMetric.id`][0]; + if (criteriaCustomMetricId !== 'alert-custom-metric') { + const criteriaCustomMetricAggregation = + fields[`${ALERT_RULE_PARAMETERS}.criteria.customMetric.aggregation`][0]; + const criteriaCustomMetricField = + fields[`${ALERT_RULE_PARAMETERS}.criteria.customMetric.field`][0]; + + const customMetric = encode({ + id: criteriaCustomMetricId, + type: 'custom', + field: criteriaCustomMetricField, + aggregation: criteriaCustomMetricAggregation, + }); + linkToParams.customMetric = customMetric; + linkToParams.metric = customMetric; + } else { + linkToParams.metric = encode({ type: criteriaMetric }); + } + inventoryViewInAppUrl += stringify(linkToParams); + } + return inventoryViewInAppUrl; +}; diff --git a/x-pack/plugins/infra/common/alerting/metrics/index.ts b/x-pack/plugins/infra/common/alerting/metrics/index.ts index 2c66638711cd0..3ed41e70e2269 100644 --- a/x-pack/plugins/infra/common/alerting/metrics/index.ts +++ b/x-pack/plugins/infra/common/alerting/metrics/index.ts @@ -17,3 +17,5 @@ export const isTooManyBucketsPreviewException = ( value: any ): value is TooManyBucketsPreviewExceptionMetadata => Boolean(value && value.TOO_MANY_BUCKETS_PREVIEW_EXCEPTION); + +export const LINK_TO_METRICS_EXPLORER = '/app/metrics/explorer'; diff --git a/x-pack/plugins/infra/common/formatters/alert_link.ts b/x-pack/plugins/infra/common/formatters/alert_link.ts new file mode 100644 index 0000000000000..ce5ab8941aa5a --- /dev/null +++ b/x-pack/plugins/infra/common/formatters/alert_link.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 { modifyUrl } from '@kbn/std'; +export const getLogsAppAlertUrl = (timestamp: number | null) => + modifyUrl('/app/logs/link-to/default/logs', ({ query, ...otherUrlParts }) => ({ + ...otherUrlParts, + query: { + ...query, + ...(timestamp != null ? { time: `${timestamp}` } : {}), + }, + })); diff --git a/x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts b/x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts index b3455b8baa713..a419bef9f6c76 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts +++ b/x-pack/plugins/infra/public/alerting/inventory/rule_data_formatters.ts @@ -5,50 +5,15 @@ * 2.0. */ -import { ALERT_REASON, ALERT_RULE_PARAMETERS, TIMESTAMP } from '@kbn/rule-data-utils'; -import { encode } from 'rison-node'; -import { stringify } from 'query-string'; +import { ALERT_REASON } from '@kbn/rule-data-utils'; import { ObservabilityRuleTypeFormatter } from '../../../../observability/public'; +import { getInventoryViewInAppUrl } from '../../../common/alerting/metrics/alert_link'; export const formatReason: ObservabilityRuleTypeFormatter = ({ fields }) => { const reason = fields[ALERT_REASON] ?? '-'; - const nodeTypeField = `${ALERT_RULE_PARAMETERS}.nodeType`; - const nodeType = fields[nodeTypeField]; - let link = '/app/metrics/link-to/inventory?'; - - if (nodeType) { - const linkToParams: Record = { - nodeType: fields[nodeTypeField][0], - timestamp: Date.parse(fields[TIMESTAMP]), - customMetric: '', - }; - - // We always pick the first criteria metric for the URL - const criteriaMetric = fields[`${ALERT_RULE_PARAMETERS}.criteria.metric`][0]; - const criteriaCustomMetricId = fields[`${ALERT_RULE_PARAMETERS}.criteria.customMetric.id`][0]; - if (criteriaCustomMetricId !== 'alert-custom-metric') { - const criteriaCustomMetricAggregation = - fields[`${ALERT_RULE_PARAMETERS}.criteria.customMetric.aggregation`][0]; - const criteriaCustomMetricField = - fields[`${ALERT_RULE_PARAMETERS}.criteria.customMetric.field`][0]; - - const customMetric = encode({ - id: criteriaCustomMetricId, - type: 'custom', - field: criteriaCustomMetricField, - aggregation: criteriaCustomMetricAggregation, - }); - linkToParams.customMetric = customMetric; - linkToParams.metric = customMetric; - } else { - linkToParams.metric = encode({ type: criteriaMetric }); - } - - link += stringify(linkToParams); - } return { reason, - link, + link: getInventoryViewInAppUrl(fields), }; }; diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/rule_data_formatters.ts b/x-pack/plugins/infra/public/alerting/log_threshold/rule_data_formatters.ts index c64f9b07fa33e..888646856e119 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/rule_data_formatters.ts +++ b/x-pack/plugins/infra/public/alerting/log_threshold/rule_data_formatters.ts @@ -6,23 +6,16 @@ */ import { ALERT_REASON, ALERT_START } from '@kbn/rule-data-utils'; -import { modifyUrl } from '@kbn/std'; import { ObservabilityRuleTypeFormatter } from '../../../../observability/public'; +import { getLogsAppAlertUrl } from '../../../common/formatters/alert_link'; export const formatRuleData: ObservabilityRuleTypeFormatter = ({ fields }) => { const reason = fields[ALERT_REASON] ?? ''; const alertStartDate = fields[ALERT_START]; const timestamp = alertStartDate != null ? new Date(alertStartDate).valueOf() : null; - const link = modifyUrl('/app/logs/link-to/default/logs', ({ query, ...otherUrlParts }) => ({ - ...otherUrlParts, - query: { - ...query, - ...(timestamp != null ? { time: `${timestamp}` } : {}), - }, - })); return { reason, - link, // TODO: refactor to URL generators + link: getLogsAppAlertUrl(timestamp), // TODO: refactor to URL generators }; }; diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/rule_data_formatters.ts b/x-pack/plugins/infra/public/alerting/metric_threshold/rule_data_formatters.ts index 7a0140ab05652..268d0d2113381 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/rule_data_formatters.ts +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/rule_data_formatters.ts @@ -7,10 +7,10 @@ import { ALERT_REASON } from '@kbn/rule-data-utils'; import { ObservabilityRuleTypeFormatter } from '../../../../observability/public'; - +import { LINK_TO_METRICS_EXPLORER } from '../../../common/alerting/metrics'; export const formatReason: ObservabilityRuleTypeFormatter = ({ fields }) => { const reason = fields[ALERT_REASON] ?? '-'; - const link = '/app/metrics/explorer'; // TODO https://github.com/elastic/kibana/issues/106497 & https://github.com/elastic/kibana/issues/106958 + const link = LINK_TO_METRICS_EXPLORER; // TODO https://github.com/elastic/kibana/issues/106497 & https://github.com/elastic/kibana/issues/106958 return { reason, diff --git a/x-pack/plugins/infra/server/lib/alerting/common/messages.ts b/x-pack/plugins/infra/server/lib/alerting/common/messages.ts index 193b5191bc98f..d61d4dd95b05e 100644 --- a/x-pack/plugins/infra/server/lib/alerting/common/messages.ts +++ b/x-pack/plugins/infra/server/lib/alerting/common/messages.ts @@ -206,3 +206,11 @@ export const thresholdActionVariableDescription = i18n.translate( 'The threshold value of the metric for the specified condition. Usage: (ctx.threshold.condition0, ctx.threshold.condition1, etc...).', } ); + +export const viewInAppUrlActionVariableDescription = i18n.translate( + 'xpack.infra.metrics.alerting.viewInAppUrlActionVariableDescription', + { + defaultMessage: + 'Link to the view or feature within Elastic that can be used to investigate the alert and its context further', + } +); diff --git a/x-pack/plugins/infra/server/lib/alerting/common/utils.ts b/x-pack/plugins/infra/server/lib/alerting/common/utils.ts index d1a7f9d643773..e5e93ae4aa360 100644 --- a/x-pack/plugins/infra/server/lib/alerting/common/utils.ts +++ b/x-pack/plugins/infra/server/lib/alerting/common/utils.ts @@ -8,7 +8,14 @@ import { isEmpty, isError } from 'lodash'; import { schema } from '@kbn/config-schema'; import { Logger, LogMeta } from '@kbn/logging'; -import { AlertExecutionDetails } from '../../../../common/alerting/metrics/types'; +import type { IBasePath } from 'kibana/server'; +import { ALERT_RULE_PARAMETERS, TIMESTAMP } from '@kbn/rule-data-utils'; +import { getInventoryViewInAppUrl } from '../../../../common/alerting/metrics/alert_link'; +import { parseTechnicalFields } from '../../../../../rule_registry/common/parse_technical_fields'; +import { + AlertExecutionDetails, + InventoryMetricConditions, +} from '../../../../common/alerting/metrics/types'; export const oneOfLiterals = (arrayOfLiterals: Readonly) => schema.string({ @@ -75,3 +82,28 @@ export const createScopedLogger = ( }, }; }; + +export const getViewInAppUrl = (basePath: IBasePath, relativeViewInAppUrl: string) => + basePath.publicBaseUrl + ? new URL(basePath.prepend(relativeViewInAppUrl), basePath.publicBaseUrl).toString() + : relativeViewInAppUrl; + +export const getViewInAppUrlInventory = ( + criteria: InventoryMetricConditions[], + nodeType: string, + timestamp: string, + basePath: IBasePath +) => { + const { metric, customMetric } = criteria[0]; + const fields = { + [`${ALERT_RULE_PARAMETERS}.criteria.metric`]: [metric], + [`${ALERT_RULE_PARAMETERS}.criteria.customMetric.id`]: [customMetric?.id], + [`${ALERT_RULE_PARAMETERS}.criteria.customMetric.aggregation`]: [customMetric?.aggregation], + [`${ALERT_RULE_PARAMETERS}.criteria.customMetric.field`]: [customMetric?.field], + [`${ALERT_RULE_PARAMETERS}.nodeType`]: [nodeType], + [TIMESTAMP]: timestamp, + }; + + const relativeViewInAppUrl = getInventoryViewInAppUrl(parseTechnicalFields(fields, true)); + return getViewInAppUrl(basePath, relativeViewInAppUrl); +}; diff --git a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts index 7b6b23eff0a08..289b4bc6ee74e 100644 --- a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts @@ -32,7 +32,7 @@ import { // buildRecoveredAlertReason, stateToAlertMessage, } from '../common/messages'; -import { createScopedLogger } from '../common/utils'; +import { createScopedLogger, getViewInAppUrlInventory } from '../common/utils'; import { evaluateCondition } from './evaluate_condition'; type InventoryMetricThresholdAllowedActionGroups = ActionGroupIdsOf< @@ -62,12 +62,12 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = InventoryMetricThresholdAlertState, InventoryMetricThresholdAlertContext, InventoryMetricThresholdAllowedActionGroups - >(async ({ services, params, alertId, executionId }) => { + >(async ({ services, params, alertId, executionId, startedAt }) => { const startTime = Date.now(); const { criteria, filterQuery, sourceId, nodeType, alertOnNoData } = params; if (criteria.length === 0) throw new Error('Cannot execute an alert with 0 conditions'); const logger = createScopedLogger(libs.logger, 'inventoryRule', { alertId, executionId }); - const { alertWithLifecycle, savedObjectsClient } = services; + const { alertWithLifecycle, savedObjectsClient, getAlertStartedDate } = services; const alertFactory: InventoryMetricThresholdAlertFactory = (id, reason) => alertWithLifecycle({ id, @@ -86,10 +86,18 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = const actionGroupId = FIRED_ACTIONS.id; // Change this to an Error action group when able const reason = buildInvalidQueryAlertReason(params.filterQueryText); const alert = alertFactory('*', reason); + const indexedStartedDate = getAlertStartedDate('*') ?? startedAt.toISOString(); + const viewInAppUrl = getViewInAppUrlInventory( + criteria, + nodeType, + indexedStartedDate, + libs.basePath + ); alert.scheduleActions(actionGroupId, { group: '*', alertState: stateToAlertMessage[AlertStates.ERROR], reason, + viewInAppUrl, timestamp: moment().toISOString(), value: null, metric: mapToConditionsLookup(criteria, (c) => c.metric), @@ -192,7 +200,14 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = ? WARNING_ACTIONS.id : FIRED_ACTIONS.id; - const alert = alertFactory(`${group}`, reason); + const alert = alertFactory(group, reason); + const indexedStartedDate = getAlertStartedDate(group) ?? startedAt.toISOString(); + const viewInAppUrl = getViewInAppUrlInventory( + criteria, + nodeType, + indexedStartedDate, + libs.basePath + ); scheduledActionsCount++; alert.scheduleActions( /** @@ -204,6 +219,7 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) = group, alertState: stateToAlertMessage[nextState], reason, + viewInAppUrl, timestamp: moment().toISOString(), value: mapToConditionsLookup(results, (result) => formatMetric(result[group].metric, result[group].currentValue) diff --git a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/register_inventory_metric_threshold_rule_type.ts b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/register_inventory_metric_threshold_rule_type.ts index 81d7758886644..f7d1e80346d71 100644 --- a/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/register_inventory_metric_threshold_rule_type.ts +++ b/x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/register_inventory_metric_threshold_rule_type.ts @@ -30,6 +30,7 @@ import { thresholdActionVariableDescription, timestampActionVariableDescription, valueActionVariableDescription, + viewInAppUrlActionVariableDescription, } from '../common/messages'; import { oneOfLiterals, validateIsStringElasticsearchJSONFilter } from '../common/utils'; import { @@ -99,6 +100,7 @@ export async function registerMetricInventoryThresholdRuleType( { name: 'value', description: valueActionVariableDescription }, { name: 'metric', description: metricActionVariableDescription }, { name: 'threshold', description: thresholdActionVariableDescription }, + { name: 'viewInAppUrl', description: viewInAppUrlActionVariableDescription }, ], }, }); diff --git a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.test.ts b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.test.ts index ba02fb96b0d68..d6b599336fac8 100644 --- a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.test.ts +++ b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.test.ts @@ -17,13 +17,11 @@ import { } from './log_threshold_executor'; import { Comparator, - AlertStates, RuleParams, Criterion, UngroupedSearchQueryResponse, GroupedSearchQueryResponse, } from '../../../../common/alerting/logs/log_threshold'; -import { alertsMock } from '../../../../../alerting/server/mocks'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; // Mocks // @@ -31,7 +29,6 @@ const numericField = { field: 'numericField', value: 10, }; - const keywordField = { field: 'keywordField', value: 'error', @@ -407,7 +404,7 @@ describe('Log threshold executor', () => { describe('Results processors', () => { describe('Can process ungrouped results', () => { test('It handles the ALERT state correctly', () => { - const alertUpdaterMock = jest.fn(); + const alertFactoryMock = jest.fn(); const ruleParams = { ...baseRuleParams, criteria: [positiveCriteria[0]], @@ -419,16 +416,11 @@ describe('Log threshold executor', () => { }, }, } as UngroupedSearchQueryResponse; - processUngroupedResults( - results, - ruleParams, - alertsMock.createAlertFactory.create, - alertUpdaterMock - ); - // First call, second argument - expect(alertUpdaterMock.mock.calls[0][1]).toBe(AlertStates.ALERT); - // First call, third argument - expect(alertUpdaterMock.mock.calls[0][2]).toEqual([ + + processUngroupedResults(results, ruleParams, alertFactoryMock); + + // first call, fifth argument + expect(alertFactoryMock.mock.calls[0][4]).toEqual([ { actionGroup: 'logs.threshold.fired', context: { @@ -445,7 +437,7 @@ describe('Log threshold executor', () => { describe('Can process grouped results', () => { test('It handles the ALERT state correctly', () => { - const alertUpdaterMock = jest.fn(); + const alertFactoryMock = jest.fn(); const ruleParams = { ...baseRuleParams, criteria: [positiveCriteria[0]], @@ -484,17 +476,12 @@ describe('Log threshold executor', () => { }, }, ] as GroupedSearchQueryResponse['aggregations']['groups']['buckets']; - processGroupByResults( - results, - ruleParams, - alertsMock.createAlertFactory.create, - alertUpdaterMock - ); - expect(alertUpdaterMock.mock.calls.length).toBe(2); - // First call, second argument - expect(alertUpdaterMock.mock.calls[0][1]).toBe(AlertStates.ALERT); - // First call, third argument - expect(alertUpdaterMock.mock.calls[0][2]).toEqual([ + + processGroupByResults(results, ruleParams, alertFactoryMock); + expect(alertFactoryMock.mock.calls.length).toBe(2); + + // First call, fifth argument + expect(alertFactoryMock.mock.calls[0][4]).toEqual([ { actionGroup: 'logs.threshold.fired', context: { @@ -508,10 +495,8 @@ describe('Log threshold executor', () => { }, ]); - // Second call, second argument - expect(alertUpdaterMock.mock.calls[1][1]).toBe(AlertStates.ALERT); - // Second call, third argument - expect(alertUpdaterMock.mock.calls[1][2]).toEqual([ + // Second call, fifth argument + expect(alertFactoryMock.mock.calls[1][4]).toEqual([ { actionGroup: 'logs.threshold.fired', context: { diff --git a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts index 2ca97c6b8a35f..5bf1a914f49b1 100644 --- a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.ts @@ -21,6 +21,7 @@ import { AlertInstanceState as AlertState, AlertTypeState as RuleTypeState, } from '../../../../../alerting/server'; + import { RuleParams, ruleParamsRT, @@ -43,6 +44,7 @@ import { } from '../../../../common/alerting/logs/log_threshold'; import { resolveLogSourceConfiguration } from '../../../../common/log_sources'; import { decodeOrThrow } from '../../../../common/runtime_types'; +import { getLogsAppAlertUrl } from '../../../../common/formatters/alert_link'; import { getIntervalInSeconds } from '../../../utils/get_interval_in_seconds'; import { InfraBackendLibs } from '../../infra_types'; import { UNGROUPED_FACTORY_KEY } from '../common/utils'; @@ -68,7 +70,8 @@ type LogThresholdAlertFactory = ( id: string, reason: string, value: number, - threshold: number + threshold: number, + actions?: Array<{ actionGroup: LogThresholdActionGroups; context: AlertContext }> ) => LogThresholdAlert; const COMPOSITE_GROUP_SIZE = 2000; @@ -93,11 +96,13 @@ export const createLogThresholdExecutor = (libs: InfraBackendLibs) => LogThresholdAlertState, LogThresholdAlertContext, LogThresholdActionGroups - >(async ({ services, params }) => { - const { alertWithLifecycle, savedObjectsClient, scopedClusterClient } = services; - const { sources } = libs; - const alertFactory: LogThresholdAlertFactory = (id, reason, value, threshold) => - alertWithLifecycle({ + >(async ({ services, params, startedAt }) => { + const { alertWithLifecycle, savedObjectsClient, scopedClusterClient, getAlertStartedDate } = + services; + const { sources, basePath } = libs; + + const alertFactory: LogThresholdAlertFactory = (id, reason, value, threshold, actions) => { + const alert = alertWithLifecycle({ id, fields: { [ALERT_EVALUATION_THRESHOLD]: threshold, @@ -106,6 +111,28 @@ export const createLogThresholdExecutor = (libs: InfraBackendLibs) => }, }); + if (actions && actions.length > 0) { + const indexedStartedAt = getAlertStartedDate(id) ?? startedAt.toISOString(); + const relativeViewInAppUrl = getLogsAppAlertUrl(new Date(indexedStartedAt).getTime()); + const viewInAppUrl = basePath.publicBaseUrl + ? new URL(basePath.prepend(relativeViewInAppUrl), basePath.publicBaseUrl).toString() + : relativeViewInAppUrl; + + const sharedContext = { + timestamp: new Date().toISOString(), + viewInAppUrl, + }; + actions.forEach((actionSet) => { + const { actionGroup, context } = actionSet; + alert.scheduleActions(actionGroup, { ...sharedContext, ...context }); + }); + } + + alert.replaceState({ + alertState: AlertStates.ALERT, + }); + return alert; + }; const sourceConfiguration = await sources.getSourceConfiguration(savedObjectsClient, 'default'); const { indices, timestampField, runtimeMappings } = await resolveLogSourceConfiguration( sourceConfiguration.configuration, @@ -157,19 +184,9 @@ async function executeAlert( } if (hasGroupBy(ruleParams)) { - processGroupByResults( - await getGroupedResults(query, esClient), - ruleParams, - alertFactory, - updateAlert - ); + processGroupByResults(await getGroupedResults(query, esClient), ruleParams, alertFactory); } else { - processUngroupedResults( - await getUngroupedResults(query, esClient), - ruleParams, - alertFactory, - updateAlert - ); + processUngroupedResults(await getUngroupedResults(query, esClient), ruleParams, alertFactory); } } @@ -213,8 +230,7 @@ async function executeRatioAlert( numeratorGroupedResults, denominatorGroupedResults, ruleParams, - alertFactory, - updateAlert + alertFactory ); } else { const [numeratorUngroupedResults, denominatorUngroupedResults] = await Promise.all([ @@ -225,8 +241,7 @@ async function executeRatioAlert( numeratorUngroupedResults, denominatorUngroupedResults, ruleParams, - alertFactory, - updateAlert + alertFactory ); } } @@ -245,8 +260,7 @@ const getESQuery = ( export const processUngroupedResults = ( results: UngroupedSearchQueryResponse, params: CountRuleParams, - alertFactory: LogThresholdAlertFactory, - alertUpdater: AlertUpdater + alertFactory: LogThresholdAlertFactory ) => { const { count, criteria, timeSize, timeUnit } = params; const documentCount = results.hits.total.value; @@ -257,9 +271,9 @@ export const processUngroupedResults = ( timeSize, timeUnit ); + if (checkValueAgainstComparatorMap[count.comparator](documentCount, count.value)) { - const alert = alertFactory(UNGROUPED_FACTORY_KEY, reasonMessage, documentCount, count.value); - alertUpdater(alert, AlertStates.ALERT, [ + const actions = [ { actionGroup: FIRED_ACTIONS.id, context: { @@ -270,7 +284,8 @@ export const processUngroupedResults = ( reason: reasonMessage, }, }, - ]); + ]; + alertFactory(UNGROUPED_FACTORY_KEY, reasonMessage, documentCount, count.value, actions); } }; @@ -278,8 +293,7 @@ export const processUngroupedRatioResults = ( numeratorResults: UngroupedSearchQueryResponse, denominatorResults: UngroupedSearchQueryResponse, params: RatioRuleParams, - alertFactory: LogThresholdAlertFactory, - alertUpdater: AlertUpdater + alertFactory: LogThresholdAlertFactory ) => { const { count, criteria, timeSize, timeUnit } = params; @@ -295,8 +309,7 @@ export const processUngroupedRatioResults = ( timeSize, timeUnit ); - const alert = alertFactory(UNGROUPED_FACTORY_KEY, reasonMessage, ratio, count.value); - alertUpdater(alert, AlertStates.ALERT, [ + const actions = [ { actionGroup: FIRED_ACTIONS.id, context: { @@ -308,7 +321,8 @@ export const processUngroupedRatioResults = ( reason: reasonMessage, }, }, - ]); + ]; + alertFactory(UNGROUPED_FACTORY_KEY, reasonMessage, ratio, count.value, actions); } }; @@ -354,8 +368,7 @@ const getReducedGroupByResults = ( export const processGroupByResults = ( results: GroupedSearchQueryResponse['aggregations']['groups']['buckets'], params: CountRuleParams, - alertFactory: LogThresholdAlertFactory, - alertUpdater: AlertUpdater + alertFactory: LogThresholdAlertFactory ) => { const { count, criteria, timeSize, timeUnit } = params; @@ -373,8 +386,7 @@ export const processGroupByResults = ( timeSize, timeUnit ); - const alert = alertFactory(group.name, reasonMessage, documentCount, count.value); - alertUpdater(alert, AlertStates.ALERT, [ + const actions = [ { actionGroup: FIRED_ACTIONS.id, context: { @@ -385,7 +397,8 @@ export const processGroupByResults = ( reason: reasonMessage, }, }, - ]); + ]; + alertFactory(group.name, reasonMessage, documentCount, count.value, actions); } }); }; @@ -394,8 +407,7 @@ export const processGroupByRatioResults = ( numeratorResults: GroupedSearchQueryResponse['aggregations']['groups']['buckets'], denominatorResults: GroupedSearchQueryResponse['aggregations']['groups']['buckets'], params: RatioRuleParams, - alertFactory: LogThresholdAlertFactory, - alertUpdater: AlertUpdater + alertFactory: LogThresholdAlertFactory ) => { const { count, criteria, timeSize, timeUnit } = params; @@ -423,8 +435,7 @@ export const processGroupByRatioResults = ( timeSize, timeUnit ); - const alert = alertFactory(numeratorGroup.name, reasonMessage, ratio, count.value); - alertUpdater(alert, AlertStates.ALERT, [ + const actions = [ { actionGroup: FIRED_ACTIONS.id, context: { @@ -436,33 +447,12 @@ export const processGroupByRatioResults = ( reason: reasonMessage, }, }, - ]); + ]; + alertFactory(numeratorGroup.name, reasonMessage, ratio, count.value, actions); } }); }; -type AlertUpdater = ( - alert: Alert, - state: AlertStates, - actions?: Array<{ actionGroup: LogThresholdActionGroups; context: AlertContext }> -) => void; - -export const updateAlert: AlertUpdater = (alert, state, actions) => { - if (actions && actions.length > 0) { - const sharedContext = { - timestamp: new Date().toISOString(), - }; - actions.forEach((actionSet) => { - const { actionGroup, context } = actionSet; - alert.scheduleActions(actionGroup, { ...sharedContext, ...context }); - }); - } - - alert.replaceState({ - alertState: state, - }); -}; - export const buildFiltersFromCriteria = ( params: Pick & { criteria: CountCriteria }, timestampField: string diff --git a/x-pack/plugins/infra/server/lib/alerting/log_threshold/register_log_threshold_rule_type.ts b/x-pack/plugins/infra/server/lib/alerting/log_threshold/register_log_threshold_rule_type.ts index d5f2fd17cf3be..d7b73ce187396 100644 --- a/x-pack/plugins/infra/server/lib/alerting/log_threshold/register_log_threshold_rule_type.ts +++ b/x-pack/plugins/infra/server/lib/alerting/log_threshold/register_log_threshold_rule_type.ts @@ -78,6 +78,14 @@ const alertReasonMessageActionVariableDescription = i18n.translate( } ); +const viewInAppUrlActionVariableDescription = i18n.translate( + 'xpack.infra.logs.alerting.threshold.viewInAppUrlActionVariableDescription', + { + defaultMessage: + 'Link to the view or feature within Elastic that can be used to investigate the alert and its context further', + } +); + export async function registerLogThresholdRuleType( alertingPlugin: PluginSetupContract, libs: InfraBackendLibs @@ -118,6 +126,10 @@ export async function registerLogThresholdRuleType( name: 'denominatorConditions', description: denominatorConditionsActionVariableDescription, }, + { + name: 'viewInAppUrl', + description: viewInAppUrlActionVariableDescription, + }, ], }, producer: 'logs', diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts index 9fbbe26fba126..d8792e7cb9d34 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts @@ -27,7 +27,9 @@ import { // buildRecoveredAlertReason, stateToAlertMessage, } from '../common/messages'; -import { UNGROUPED_FACTORY_KEY } from '../common/utils'; +import { UNGROUPED_FACTORY_KEY, getViewInAppUrl } from '../common/utils'; +import { LINK_TO_METRICS_EXPLORER } from '../../../../common/alerting/metrics'; + import { EvaluatedRuleParams, evaluateRule } from './lib/evaluate_rule'; import { TimeUnitChar } from '../../../../../observability/common/utils/formatters/duration'; @@ -100,6 +102,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => group: UNGROUPED_FACTORY_KEY, alertState: stateToAlertMessage[AlertStates.ERROR], reason, + viewInAppUrl: getViewInAppUrl(libs.basePath, LINK_TO_METRICS_EXPLORER), timestamp, value: null, metric: mapToConditionsLookup(criteria, (c) => c.metric), @@ -234,6 +237,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) => group, alertState: stateToAlertMessage[nextState], reason, + viewInAppUrl: getViewInAppUrl(libs.basePath, LINK_TO_METRICS_EXPLORER), timestamp, value: mapToConditionsLookup( alertResults, diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts index d5d819ba7902e..a4ec6e4c4930e 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts @@ -20,6 +20,7 @@ import { thresholdActionVariableDescription, timestampActionVariableDescription, valueActionVariableDescription, + viewInAppUrlActionVariableDescription, } from '../common/messages'; import { oneOfLiterals, validateIsStringElasticsearchJSONFilter } from '../common/utils'; import { @@ -97,6 +98,7 @@ export async function registerMetricThresholdRuleType( { name: 'value', description: valueActionVariableDescription }, { name: 'metric', description: metricActionVariableDescription }, { name: 'threshold', description: thresholdActionVariableDescription }, + { name: 'viewInAppUrl', description: viewInAppUrlActionVariableDescription }, ], }, producer: 'infrastructure', diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts index d023aa5e28a4e..ee9a34ef9233a 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts @@ -4,6 +4,11 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import * as utils from '../../alerting/common/utils'; +jest + .spyOn(utils, 'getViewInAppUrl') + .mockReturnValue('http://localhost:5601/eyg/app/metrics/explorer'); + const bucketsA = (from: number) => [ { doc_count: null, diff --git a/x-pack/plugins/infra/server/lib/infra_types.ts b/x-pack/plugins/infra/server/lib/infra_types.ts index 7f3b730cf03e7..bf2847491a901 100644 --- a/x-pack/plugins/infra/server/lib/infra_types.ts +++ b/x-pack/plugins/infra/server/lib/infra_types.ts @@ -6,6 +6,7 @@ */ import { Logger } from '@kbn/logging'; +import type { IBasePath } from 'kibana/server'; import { handleEsError } from '../../../../../src/plugins/es_ui_shared/server'; import { InfraConfig } from '../types'; import { GetLogQueryFields } from '../services/log_queries/get_log_query_fields'; @@ -33,4 +34,5 @@ export interface InfraBackendLibs extends InfraDomainLibs { logsRules: RulesServiceSetup; metricsRules: RulesServiceSetup; logger: Logger; + basePath: IBasePath; } diff --git a/x-pack/plugins/infra/server/plugin.ts b/x-pack/plugins/infra/server/plugin.ts index eb66e805b15f4..6b0400a0c5e65 100644 --- a/x-pack/plugins/infra/server/plugin.ts +++ b/x-pack/plugins/infra/server/plugin.ts @@ -155,6 +155,7 @@ export class InfraServerPlugin implements Plugin { logsRules: this.logsRules.setup(core, plugins), metricsRules: this.metricsRules.setup(core, plugins), logger: this.logger, + basePath: core.http.basePath, }; plugins.features.registerKibanaFeature(METRICS_FEATURE); diff --git a/x-pack/plugins/lens/common/expressions/format_column/format_column.test.ts b/x-pack/plugins/lens/common/expressions/format_column/format_column.test.ts index 17192103efaae..d3e074d4cdafc 100644 --- a/x-pack/plugins/lens/common/expressions/format_column/format_column.test.ts +++ b/x-pack/plugins/lens/common/expressions/format_column/format_column.test.ts @@ -63,6 +63,26 @@ describe('format_column', () => { }); }); + it('wraps in suffix formatter if provided', async () => { + datatable.columns[0].meta.params = { id: 'myformatter', params: {} }; + const result = await fn(datatable, { + columnId: 'test', + format: 'number', + decimals: 5, + suffix: 'ABC', + }); + expect(result.columns[0].meta.params).toEqual({ + id: 'suffix', + params: { + suffixString: 'ABC', + id: 'number', + params: { + pattern: '0,0.00000', + }, + }, + }); + }); + it('has special handling for 0 decimals', async () => { datatable.columns[0].meta.params = { id: 'myformatter', params: {} }; const result = await fn(datatable, { columnId: 'test', format: 'number', decimals: 0 }); @@ -140,6 +160,32 @@ describe('format_column', () => { }); }); + it('double-nests suffix formatters', async () => { + datatable.columns[0].meta.params = { + id: 'suffix', + params: { suffixString: 'ABC', id: 'myformatter', params: { innerParam: 456 } }, + }; + const result = await fn(datatable, { + columnId: 'test', + format: '', + parentFormat: JSON.stringify({ id: 'suffix', params: { suffixString: 'DEF' } }), + }); + expect(result.columns[0].meta.params).toEqual({ + id: 'suffix', + params: { + suffixString: 'DEF', + id: 'suffix', + params: { + suffixString: 'ABC', + id: 'myformatter', + params: { + innerParam: 456, + }, + }, + }, + }); + }); + it('overwrites format with well known pattern including decimals', async () => { datatable.columns[0].meta.params = { id: 'previousWrapper', diff --git a/x-pack/plugins/lens/common/expressions/format_column/format_column_fn.ts b/x-pack/plugins/lens/common/expressions/format_column/format_column_fn.ts index 93b54e777b645..183ec74ac301d 100644 --- a/x-pack/plugins/lens/common/expressions/format_column/format_column_fn.ts +++ b/x-pack/plugins/lens/common/expressions/format_column/format_column_fn.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { SerializedFieldFormat } from 'src/plugins/field_formats/common'; import { supportedFormats } from './supported_formats'; import type { DatatableColumn } from '../../../../../../src/plugins/expressions'; import type { FormatColumnArgs } from './index'; @@ -12,7 +13,8 @@ import type { FormatColumnExpressionFunction } from './types'; function isNestedFormat(params: DatatableColumn['meta']['params']) { // if there is a nested params object with an id, it's a nested format - return !!params?.params?.id; + // suffix formatters do not count as nested + return !!params?.params?.id && params.id !== 'suffix'; } function withParams(col: DatatableColumn, params: Record) { @@ -21,17 +23,27 @@ function withParams(col: DatatableColumn, params: Record) { export const formatColumnFn: FormatColumnExpressionFunction['fn'] = ( input, - { format, columnId, decimals, parentFormat }: FormatColumnArgs + { format, columnId, decimals, suffix, parentFormat }: FormatColumnArgs ) => ({ ...input, columns: input.columns.map((col) => { if (col.id === columnId) { if (!parentFormat) { if (supportedFormats[format]) { - return withParams(col, { + let serializedFormat: SerializedFieldFormat = { id: format, params: { pattern: supportedFormats[format].decimalsToPattern(decimals) }, - }); + }; + if (suffix) { + serializedFormat = { + id: 'suffix', + params: { + ...serializedFormat, + suffixString: suffix, + }, + }; + } + return withParams(col, serializedFormat as Record); } else if (format) { return withParams(col, { id: format }); } else { diff --git a/x-pack/plugins/lens/common/expressions/format_column/index.ts b/x-pack/plugins/lens/common/expressions/format_column/index.ts index 0fc99ff8f7089..2a6721ad993b7 100644 --- a/x-pack/plugins/lens/common/expressions/format_column/index.ts +++ b/x-pack/plugins/lens/common/expressions/format_column/index.ts @@ -11,6 +11,7 @@ export interface FormatColumnArgs { format: string; columnId: string; decimals?: number; + suffix?: string; parentFormat?: string; } @@ -33,6 +34,10 @@ export const formatColumn: FormatColumnExpressionFunction = { types: ['number'], help: '', }, + suffix: { + types: ['string'], + help: '', + }, parentFormat: { types: ['string'], help: '', diff --git a/x-pack/plugins/lens/common/expressions/index.ts b/x-pack/plugins/lens/common/expressions/index.ts index 526bee92ec7e5..47ff8318447b2 100644 --- a/x-pack/plugins/lens/common/expressions/index.ts +++ b/x-pack/plugins/lens/common/expressions/index.ts @@ -11,6 +11,5 @@ export * from './rename_columns'; export * from './merge_tables'; export * from './time_scale'; export * from './datatable'; -export * from './xy_chart'; export * from './expression_types'; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/axis_config.ts b/x-pack/plugins/lens/common/expressions/xy_chart/axis_config.ts deleted file mode 100644 index 0b9667353706d..0000000000000 --- a/x-pack/plugins/lens/common/expressions/xy_chart/axis_config.ts +++ /dev/null @@ -1,207 +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 { i18n } from '@kbn/i18n'; -import type { - ArgumentType, - ExpressionFunctionDefinition, -} from '../../../../../../src/plugins/expressions/common'; - -export interface AxesSettingsConfig { - x: boolean; - yLeft: boolean; - yRight: boolean; -} - -export interface AxisExtentConfig { - mode: 'full' | 'dataBounds' | 'custom'; - lowerBound?: number; - upperBound?: number; -} - -interface AxisConfig { - title: string; - hide?: boolean; -} - -export type YAxisMode = 'auto' | 'left' | 'right' | 'bottom'; -export type LineStyle = 'solid' | 'dashed' | 'dotted'; -export type FillStyle = 'none' | 'above' | 'below'; -export type IconPosition = 'auto' | 'left' | 'right' | 'above' | 'below'; - -export interface YConfig { - forAccessor: string; - axisMode?: YAxisMode; - color?: string; - icon?: string; - lineWidth?: number; - lineStyle?: LineStyle; - fill?: FillStyle; - iconPosition?: IconPosition; - textVisibility?: boolean; -} - -export type AxisTitlesVisibilityConfigResult = AxesSettingsConfig & { - type: 'lens_xy_axisTitlesVisibilityConfig'; -}; - -export const axisTitlesVisibilityConfig: ExpressionFunctionDefinition< - 'lens_xy_axisTitlesVisibilityConfig', - null, - AxesSettingsConfig, - AxisTitlesVisibilityConfigResult -> = { - name: 'lens_xy_axisTitlesVisibilityConfig', - aliases: [], - type: 'lens_xy_axisTitlesVisibilityConfig', - help: `Configure the xy chart's axis titles appearance`, - inputTypes: ['null'], - args: { - x: { - types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.xAxisTitle.help', { - defaultMessage: 'Specifies whether or not the title of the x-axis are visible.', - }), - }, - yLeft: { - types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.yLeftAxisTitle.help', { - defaultMessage: 'Specifies whether or not the title of the left y-axis are visible.', - }), - }, - yRight: { - types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.yRightAxisTitle.help', { - defaultMessage: 'Specifies whether or not the title of the right y-axis are visible.', - }), - }, - }, - fn: function fn(input: unknown, args: AxesSettingsConfig) { - return { - type: 'lens_xy_axisTitlesVisibilityConfig', - ...args, - }; - }, -}; - -export type AxisExtentConfigResult = AxisExtentConfig & { type: 'lens_xy_axisExtentConfig' }; - -export const axisExtentConfig: ExpressionFunctionDefinition< - 'lens_xy_axisExtentConfig', - null, - AxisExtentConfig, - AxisExtentConfigResult -> = { - name: 'lens_xy_axisExtentConfig', - aliases: [], - type: 'lens_xy_axisExtentConfig', - help: `Configure the xy chart's axis extents`, - inputTypes: ['null'], - args: { - mode: { - types: ['string'], - options: ['full', 'dataBounds', 'custom'], - help: i18n.translate('xpack.lens.xyChart.extentMode.help', { - defaultMessage: 'The extent mode', - }), - }, - lowerBound: { - types: ['number'], - help: i18n.translate('xpack.lens.xyChart.extentMode.help', { - defaultMessage: 'The extent mode', - }), - }, - upperBound: { - types: ['number'], - help: i18n.translate('xpack.lens.xyChart.extentMode.help', { - defaultMessage: 'The extent mode', - }), - }, - }, - fn: function fn(input: unknown, args: AxisExtentConfig) { - return { - type: 'lens_xy_axisExtentConfig', - ...args, - }; - }, -}; - -export const axisConfig: { [key in keyof AxisConfig]: ArgumentType } = { - title: { - types: ['string'], - help: i18n.translate('xpack.lens.xyChart.title.help', { - defaultMessage: 'The axis title', - }), - }, - hide: { - types: ['boolean'], - default: false, - help: 'Show / hide axis', - }, -}; - -export type YConfigResult = YConfig & { type: 'lens_xy_yConfig' }; - -export const yAxisConfig: ExpressionFunctionDefinition< - 'lens_xy_yConfig', - null, - YConfig, - YConfigResult -> = { - name: 'lens_xy_yConfig', - aliases: [], - type: 'lens_xy_yConfig', - help: `Configure the behavior of a xy chart's y axis metric`, - inputTypes: ['null'], - args: { - forAccessor: { - types: ['string'], - help: 'The accessor this configuration is for', - }, - axisMode: { - types: ['string'], - options: ['auto', 'left', 'right'], - help: 'The axis mode of the metric', - }, - color: { - types: ['string'], - help: 'The color of the series', - }, - lineStyle: { - types: ['string'], - options: ['solid', 'dotted', 'dashed'], - help: 'The style of the reference line', - }, - lineWidth: { - types: ['number'], - help: 'The width of the reference line', - }, - icon: { - types: ['string'], - help: 'An optional icon used for reference lines', - }, - iconPosition: { - types: ['string'], - options: ['auto', 'above', 'below', 'left', 'right'], - help: 'The placement of the icon for the reference line', - }, - textVisibility: { - types: ['boolean'], - help: 'Visibility of the label on the reference line', - }, - fill: { - types: ['string'], - options: ['none', 'above', 'below'], - help: '', - }, - }, - fn: function fn(input: unknown, args: YConfig) { - return { - type: 'lens_xy_yConfig', - ...args, - }; - }, -}; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/index.ts b/x-pack/plugins/lens/common/expressions/xy_chart/index.ts deleted file mode 100644 index 2f66c2c61a9f1..0000000000000 --- a/x-pack/plugins/lens/common/expressions/xy_chart/index.ts +++ /dev/null @@ -1,18 +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. - */ - -export * from './axis_config'; -export * from './fitting_function'; -export * from './end_value'; -export * from './grid_lines_config'; -export * from './layer_config'; -export * from './legend_config'; -export * from './series_type'; -export * from './tick_labels_config'; -export * from './xy_args'; -export * from './xy_chart'; -export * from './labels_orientation_config'; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/annotation_layer_config.ts b/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/annotation_layer_config.ts deleted file mode 100644 index 45b4bf31c0cdc..0000000000000 --- a/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/annotation_layer_config.ts +++ /dev/null @@ -1,67 +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 { - EventAnnotationConfig, - EventAnnotationOutput, -} from '../../../../../../../src/plugins/event_annotation/common'; -import type { ExpressionFunctionDefinition } from '../../../../../../../src/plugins/expressions/common'; -import { layerTypes } from '../../../constants'; - -export interface XYAnnotationLayerConfig { - layerId: string; - layerType: typeof layerTypes.ANNOTATIONS; - annotations: EventAnnotationConfig[]; - hide?: boolean; -} - -export interface AnnotationLayerArgs { - annotations: EventAnnotationOutput[]; - layerId: string; - layerType: typeof layerTypes.ANNOTATIONS; - hide?: boolean; -} -export type XYAnnotationLayerArgsResult = AnnotationLayerArgs & { - type: 'lens_xy_annotation_layer'; -}; -export function annotationLayerConfig(): ExpressionFunctionDefinition< - 'lens_xy_annotation_layer', - null, - AnnotationLayerArgs, - XYAnnotationLayerArgsResult -> { - return { - name: 'lens_xy_annotation_layer', - aliases: [], - type: 'lens_xy_annotation_layer', - inputTypes: ['null'], - help: 'Annotation layer in lens', - args: { - layerId: { - types: ['string'], - help: '', - }, - layerType: { types: ['string'], options: [layerTypes.ANNOTATIONS], help: '' }, - hide: { - types: ['boolean'], - default: false, - help: 'Show details', - }, - annotations: { - types: ['manual_event_annotation'], - help: '', - multi: true, - }, - }, - fn: (input, args) => { - return { - type: 'lens_xy_annotation_layer', - ...args, - }; - }, - }; -} diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/data_layer_config.ts b/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/data_layer_config.ts deleted file mode 100644 index 322edccba19e3..0000000000000 --- a/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/data_layer_config.ts +++ /dev/null @@ -1,122 +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 { layerTypes } from '../../../constants'; -import type { PaletteOutput } from '../../../../../../../src/plugins/charts/common'; -import type { ExpressionFunctionDefinition } from '../../../../../../../src/plugins/expressions/common'; -import { axisConfig, YConfig } from '../axis_config'; -import type { SeriesType } from '../series_type'; - -export interface XYDataLayerConfig { - layerId: string; - layerType: typeof layerTypes.DATA; - accessors: string[]; - seriesType: SeriesType; - xAccessor?: string; - hide?: boolean; - yConfig?: YConfig[]; - splitAccessor?: string; - palette?: PaletteOutput; -} -export interface ValidLayer extends XYDataLayerConfig { - xAccessor: NonNullable; -} - -export type DataLayerArgs = XYDataLayerConfig & { - columnToLabel?: string; // Actually a JSON key-value pair - yScaleType: 'time' | 'linear' | 'log' | 'sqrt'; - xScaleType: 'time' | 'linear' | 'ordinal'; - isHistogram: boolean; - // palette will always be set on the expression - palette: PaletteOutput; -}; - -export type DataLayerConfigResult = DataLayerArgs & { type: 'lens_xy_data_layer' }; - -export const dataLayerConfig: ExpressionFunctionDefinition< - 'lens_xy_data_layer', - null, - DataLayerArgs, - DataLayerConfigResult -> = { - name: 'lens_xy_data_layer', - aliases: [], - type: 'lens_xy_data_layer', - help: `Configure a layer in the xy chart`, - inputTypes: ['null'], - args: { - ...axisConfig, - layerId: { - types: ['string'], - help: '', - }, - xAccessor: { - types: ['string'], - help: '', - }, - layerType: { types: ['string'], options: [layerTypes.DATA], help: '' }, - seriesType: { - types: ['string'], - options: [ - 'bar', - 'line', - 'area', - 'bar_stacked', - 'area_stacked', - 'bar_percentage_stacked', - 'area_percentage_stacked', - ], - help: 'The type of chart to display.', - }, - xScaleType: { - options: ['ordinal', 'linear', 'time'], - help: 'The scale type of the x axis', - default: 'ordinal', - }, - isHistogram: { - types: ['boolean'], - default: false, - help: 'Whether to layout the chart as a histogram', - }, - yScaleType: { - options: ['log', 'sqrt', 'linear', 'time'], - help: 'The scale type of the y axes', - default: 'linear', - }, - splitAccessor: { - types: ['string'], - help: 'The column to split by', - multi: false, - }, - accessors: { - types: ['string'], - help: 'The columns to display on the y axis.', - multi: true, - }, - yConfig: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - types: ['lens_xy_yConfig' as any], - help: 'Additional configuration for y axes', - multi: true, - }, - columnToLabel: { - types: ['string'], - help: 'JSON key-value pairs of column ID to label', - }, - palette: { - default: `{theme "palette" default={system_palette name="default"} }`, - help: '', - types: ['palette'], - }, - }, - fn: function fn(input: unknown, args: DataLayerArgs) { - return { - type: 'lens_xy_data_layer', - ...args, - }; - }, -}; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/index.ts b/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/index.ts deleted file mode 100644 index df27229bdb81f..0000000000000 --- a/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/index.ts +++ /dev/null @@ -1,17 +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 { XYDataLayerConfig } from './data_layer_config'; -import { XYReferenceLineLayerConfig } from './reference_line_layer_config'; -import { XYAnnotationLayerConfig } from './annotation_layer_config'; -export * from './data_layer_config'; -export * from './reference_line_layer_config'; -export * from './annotation_layer_config'; - -export type XYLayerConfig = - | XYDataLayerConfig - | XYReferenceLineLayerConfig - | XYAnnotationLayerConfig; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/reference_line_layer_config.ts b/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/reference_line_layer_config.ts deleted file mode 100644 index 6e241f8b8db65..0000000000000 --- a/x-pack/plugins/lens/common/expressions/xy_chart/layer_config/reference_line_layer_config.ts +++ /dev/null @@ -1,64 +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 type { ExpressionFunctionDefinition } from '../../../../../../../src/plugins/expressions/common'; -import { layerTypes } from '../../../constants'; -import { YConfig } from '../axis_config'; - -export interface XYReferenceLineLayerConfig { - layerId: string; - layerType: typeof layerTypes.REFERENCELINE; - accessors: string[]; - yConfig?: YConfig[]; -} -export type ReferenceLineLayerArgs = XYReferenceLineLayerConfig & { - columnToLabel?: string; -}; -export type ReferenceLineLayerConfigResult = ReferenceLineLayerArgs & { - type: 'lens_xy_referenceLine_layer'; -}; - -export const referenceLineLayerConfig: ExpressionFunctionDefinition< - 'lens_xy_referenceLine_layer', - null, - ReferenceLineLayerArgs, - ReferenceLineLayerConfigResult -> = { - name: 'lens_xy_referenceLine_layer', - aliases: [], - type: 'lens_xy_referenceLine_layer', - help: `Configure a layer in the xy chart`, - inputTypes: ['null'], - args: { - layerId: { - types: ['string'], - help: '', - }, - layerType: { types: ['string'], options: [layerTypes.REFERENCELINE], help: '' }, - accessors: { - types: ['string'], - help: 'The columns to display on the y axis.', - multi: true, - }, - yConfig: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - types: ['lens_xy_yConfig' as any], - help: 'Additional configuration for y axes', - multi: true, - }, - columnToLabel: { - types: ['string'], - help: 'JSON key-value pairs of column ID to label', - }, - }, - fn: function fn(input: unknown, args: ReferenceLineLayerArgs) { - return { - type: 'lens_xy_referenceLine_layer', - ...args, - }; - }, -}; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/legend_config.ts b/x-pack/plugins/lens/common/expressions/xy_chart/legend_config.ts deleted file mode 100644 index bced4e284aa3c..0000000000000 --- a/x-pack/plugins/lens/common/expressions/xy_chart/legend_config.ts +++ /dev/null @@ -1,142 +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 { HorizontalAlignment, Position, VerticalAlignment } from '@elastic/charts'; -import { i18n } from '@kbn/i18n'; -import type { ExpressionFunctionDefinition } from '../../../../../../src/plugins/expressions/common'; - -export interface LegendConfig { - /** - * Flag whether the legend should be shown. If there is just a single series, it will be hidden - */ - isVisible: boolean; - /** - * Position of the legend relative to the chart - */ - position: Position; - /** - * Flag whether the legend should be shown even with just a single series - */ - showSingleSeries?: boolean; - /** - * Flag whether the legend is inside the chart - */ - isInside?: boolean; - /** - * Horizontal Alignment of the legend when it is set inside chart - */ - horizontalAlignment?: HorizontalAlignment; - /** - * Vertical Alignment of the legend when it is set inside chart - */ - verticalAlignment?: VerticalAlignment; - /** - * Number of columns when legend is set inside chart - */ - floatingColumns?: number; - /** - * Maximum number of lines per legend item - */ - maxLines?: number; - /** - * Flag whether the legend items are truncated or not - */ - shouldTruncate?: boolean; - /** - * Exact legend width (vertical) or height (horizontal) - * Limited to max of 70% of the chart container dimension Vertical legends limited to min of 30% of computed width - */ - legendSize?: number; -} - -export type LegendConfigResult = LegendConfig & { type: 'lens_xy_legendConfig' }; - -export const legendConfig: ExpressionFunctionDefinition< - 'lens_xy_legendConfig', - null, - LegendConfig, - LegendConfigResult -> = { - name: 'lens_xy_legendConfig', - aliases: [], - type: 'lens_xy_legendConfig', - help: `Configure the xy chart's legend`, - inputTypes: ['null'], - args: { - isVisible: { - types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.isVisible.help', { - defaultMessage: 'Specifies whether or not the legend is visible.', - }), - }, - position: { - types: ['string'], - options: [Position.Top, Position.Right, Position.Bottom, Position.Left], - help: i18n.translate('xpack.lens.xyChart.position.help', { - defaultMessage: 'Specifies the legend position.', - }), - }, - showSingleSeries: { - types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.showSingleSeries.help', { - defaultMessage: 'Specifies whether a legend with just a single entry should be shown', - }), - }, - isInside: { - types: ['boolean'], - help: i18n.translate('xpack.lens.xyChart.isInside.help', { - defaultMessage: 'Specifies whether a legend is inside the chart', - }), - }, - horizontalAlignment: { - types: ['string'], - options: [HorizontalAlignment.Right, HorizontalAlignment.Left], - help: i18n.translate('xpack.lens.xyChart.horizontalAlignment.help', { - defaultMessage: - 'Specifies the horizontal alignment of the legend when it is displayed inside chart.', - }), - }, - verticalAlignment: { - types: ['string'], - options: [VerticalAlignment.Top, VerticalAlignment.Bottom], - help: i18n.translate('xpack.lens.xyChart.verticalAlignment.help', { - defaultMessage: - 'Specifies the vertical alignment of the legend when it is displayed inside chart.', - }), - }, - floatingColumns: { - types: ['number'], - help: i18n.translate('xpack.lens.xyChart.floatingColumns.help', { - defaultMessage: 'Specifies the number of columns when legend is displayed inside chart.', - }), - }, - maxLines: { - types: ['number'], - help: i18n.translate('xpack.lens.xyChart.maxLines.help', { - defaultMessage: 'Specifies the number of lines per legend item.', - }), - }, - shouldTruncate: { - types: ['boolean'], - default: true, - help: i18n.translate('xpack.lens.xyChart.shouldTruncate.help', { - defaultMessage: 'Specifies whether the legend items will be truncated or not', - }), - }, - legendSize: { - types: ['number'], - help: i18n.translate('xpack.lens.xyChart.legendSize.help', { - defaultMessage: 'Specifies the legend size in pixels.', - }), - }, - }, - fn: function fn(input: unknown, args: LegendConfig) { - return { - type: 'lens_xy_legendConfig', - ...args, - }; - }, -}; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/xy_args.ts b/x-pack/plugins/lens/common/expressions/xy_chart/xy_args.ts deleted file mode 100644 index 4520f0c99c3e9..0000000000000 --- a/x-pack/plugins/lens/common/expressions/xy_chart/xy_args.ts +++ /dev/null @@ -1,45 +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 type { AxisExtentConfigResult, AxisTitlesVisibilityConfigResult } from './axis_config'; -import type { FittingFunction } from './fitting_function'; -import type { EndValue } from './end_value'; -import type { GridlinesConfigResult } from './grid_lines_config'; -import type { AnnotationLayerArgs, DataLayerArgs } from './layer_config'; -import type { LegendConfigResult } from './legend_config'; -import type { TickLabelsConfigResult } from './tick_labels_config'; -import type { LabelsOrientationConfigResult } from './labels_orientation_config'; -import type { ValueLabelConfig } from '../../types'; - -export type XYCurveType = 'LINEAR' | 'CURVE_MONOTONE_X'; -export type XYLayerArgs = DataLayerArgs | AnnotationLayerArgs; - -// Arguments to XY chart expression, with computed properties -export interface XYArgs { - title?: string; - description?: string; - xTitle: string; - yTitle: string; - yRightTitle: string; - yLeftExtent: AxisExtentConfigResult; - yRightExtent: AxisExtentConfigResult; - legend: LegendConfigResult; - valueLabels: ValueLabelConfig; - layers: XYLayerArgs[]; - fittingFunction?: FittingFunction; - endValue?: EndValue; - emphasizeFitting?: boolean; - axisTitlesVisibilitySettings?: AxisTitlesVisibilityConfigResult; - tickLabelsVisibilitySettings?: TickLabelsConfigResult; - gridlinesVisibilitySettings?: GridlinesConfigResult; - labelsOrientation?: LabelsOrientationConfigResult; - curveType?: XYCurveType; - fillOpacity?: number; - hideEndzones?: boolean; - valuesInLegend?: boolean; - ariaLabel?: string; -} diff --git a/x-pack/plugins/lens/common/suffix_formatter/index.ts b/x-pack/plugins/lens/common/suffix_formatter/index.ts index 4fa6457f0125d..d2af0df25f132 100644 --- a/x-pack/plugins/lens/common/suffix_formatter/index.ts +++ b/x-pack/plugins/lens/common/suffix_formatter/index.ts @@ -49,7 +49,7 @@ export function getSuffixFormatter(getFormatFactory: () => FormatFactory): Field textConvert = (val: unknown) => { const unit = this.param('unit') as TimeScaleUnit | undefined; - const suffix = unit ? unitSuffixes[unit] : undefined; + const suffix = unit ? unitSuffixes[unit] : this.param('suffixString'); const nestedFormatter = this.param('id'); const nestedParams = this.param('params'); diff --git a/x-pack/plugins/lens/kibana.json b/x-pack/plugins/lens/kibana.json index 18f33adf40840..a2093e78f18f0 100644 --- a/x-pack/plugins/lens/kibana.json +++ b/x-pack/plugins/lens/kibana.json @@ -25,6 +25,7 @@ "eventAnnotation" ], "optionalPlugins": [ + "expressionXY", "usageCollection", "taskManager", "globalSearch", diff --git a/x-pack/plugins/lens/public/app_plugin/show_underlying_data.test.ts b/x-pack/plugins/lens/public/app_plugin/show_underlying_data.test.ts index f7ae043eba1d7..367349f17a5b2 100644 --- a/x-pack/plugins/lens/public/app_plugin/show_underlying_data.test.ts +++ b/x-pack/plugins/lens/public/app_plugin/show_underlying_data.test.ts @@ -9,14 +9,12 @@ import { createMockDatasource } from '../mocks'; import { combineQueryAndFilters, getLayerMetaInfo } from './show_underlying_data'; import { Filter } from '@kbn/es-query'; import { DatasourcePublicAPI } from '../types'; -import { RecursiveReadonly } from '@kbn/utility-types'; -import { Capabilities } from 'kibana/public'; describe('getLayerMetaInfo', () => { const capabilities = { navLinks: { discover: true }, discover: { show: true }, - } as unknown as RecursiveReadonly; + }; it('should return error in case of no data', () => { expect( getLayerMetaInfo(createMockDatasource('testDatasource'), {}, undefined, capabilities).error @@ -85,7 +83,7 @@ describe('getLayerMetaInfo', () => { { navLinks: { discover: false }, discover: { show: true }, - } as unknown as RecursiveReadonly + } ).isVisible ).toBeFalsy(); expect( @@ -98,7 +96,7 @@ describe('getLayerMetaInfo', () => { { navLinks: { discover: true }, discover: { show: false }, - } as unknown as RecursiveReadonly + } ).isVisible ).toBeFalsy(); }); @@ -178,7 +176,7 @@ describe('combineQueryAndFilters', () => { undefined ) ).toEqual({ - query: { language: 'kuery', query: '( myfield: * ) AND ( otherField: * )' }, + query: { language: 'kuery', query: '( ( myfield: * ) AND ( otherField: * ) )' }, filters: [], }); }); @@ -198,7 +196,7 @@ describe('combineQueryAndFilters', () => { }, undefined ) - ).toEqual({ query: { language: 'kuery', query: '( otherField: * )' }, filters: [] }); + ).toEqual({ query: { language: 'kuery', query: 'otherField: *' }, filters: [] }); }); it('should build single kuery expression from meta filters and join using OR and AND at the right level', () => { @@ -238,6 +236,7 @@ describe('combineQueryAndFilters', () => { filters: [], }); }); + it('should assign kuery meta filters to app filters if existing query is using lucene language', () => { expect( combineQueryAndFilters( @@ -293,6 +292,7 @@ describe('combineQueryAndFilters', () => { ], }); }); + it('should append lucene meta filters to app filters even if existing filters are using kuery', () => { expect( combineQueryAndFilters( @@ -385,7 +385,7 @@ describe('combineQueryAndFilters', () => { must: [ { query_string: { - query: '( anotherField )', + query: 'anotherField', }, }, ], @@ -407,6 +407,7 @@ describe('combineQueryAndFilters', () => { }, }); }); + it('should append lucene meta filters to an existing lucene query', () => { expect( combineQueryAndFilters( @@ -461,10 +462,158 @@ describe('combineQueryAndFilters', () => { ], query: { language: 'lucene', - query: '( myField ) AND ( anotherField )', + query: '( ( myField ) AND ( anotherField ) )', + }, + }); + }); + + it('should accept multiple queries (and play nice with meta filters)', () => { + const { query, filters } = combineQueryAndFilters( + [ + { language: 'lucene', query: 'myFirstField' }, + { language: 'lucene', query: 'mySecondField' }, + { language: 'kuery', query: 'myThirdField : *' }, + ], + [], + { + id: 'testDatasource', + columns: [], + filters: { + enabled: { + kuery: [[{ language: 'kuery', query: 'myFourthField : *' }]], + lucene: [[{ language: 'lucene', query: 'myFifthField' }]], + }, + disabled: { kuery: [], lucene: [] }, + }, }, + undefined + ); + + expect(query).toEqual({ + language: 'lucene', + query: '( ( myFirstField ) AND ( mySecondField ) AND ( myFifthField ) )', }); + + expect(filters).toEqual([ + { + $state: { + store: 'appState', + }, + bool: { + filter: [ + { + bool: { + filter: [ + { + bool: { + minimum_should_match: 1, + should: [ + { + exists: { + field: 'myThirdField', + }, + }, + ], + }, + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + exists: { + field: 'myFourthField', + }, + }, + ], + }, + }, + ], + }, + }, + ], + must: [], + must_not: [], + should: [], + }, + meta: { + alias: 'Lens context (kuery)', + disabled: false, + index: 'testDatasource', + negate: false, + type: 'custom', + }, + }, + ]); }); + + it('should ignore all empty queries', () => { + const emptyQueryAndFilters = { + filters: [], + query: { + language: 'kuery', + query: '', + }, + }; + + expect( + combineQueryAndFilters( + [{ language: 'lucene', query: '' }], + [], + { + id: 'testDatasource', + columns: [], + filters: { + enabled: { + kuery: [[{ language: 'kuery', query: '' }]], + lucene: [], + }, + disabled: { kuery: [], lucene: [] }, + }, + }, + undefined + ) + ).toEqual(emptyQueryAndFilters); + + expect( + combineQueryAndFilters( + { language: 'lucene', query: '' }, + [], + { + id: 'testDatasource', + columns: [], + filters: { + enabled: { + kuery: [[{ language: 'kuery', query: '' }]], + lucene: [], + }, + disabled: { kuery: [], lucene: [] }, + }, + }, + undefined + ) + ).toEqual(emptyQueryAndFilters); + + expect( + combineQueryAndFilters( + undefined, + [], + { + id: 'testDatasource', + columns: [], + filters: { + enabled: { + kuery: [[{ language: 'kuery', query: '' }]], + lucene: [], + }, + disabled: { kuery: [], lucene: [] }, + }, + }, + undefined + ) + ).toEqual(emptyQueryAndFilters); + }); + it('should work for complex cases of nested meta filters', () => { // scenario overview: // A kuery query @@ -596,7 +745,7 @@ describe('combineQueryAndFilters', () => { query: { language: 'kuery', query: - '( myField: * ) AND ( ( bytes > 4000 ) AND ( ( memory > 5000 ) OR ( memory >= 15000 ) ) AND ( myField: * ) AND ( otherField >= 15 ) )', + '( ( myField: * ) AND ( bytes > 4000 ) AND ( ( memory > 5000 ) OR ( memory >= 15000 ) ) AND ( myField: * ) AND ( otherField >= 15 ) )', }, }); }); @@ -796,7 +945,7 @@ describe('combineQueryAndFilters', () => { ], query: { language: 'lucene', - query: '( myField ) AND ( anotherField )', + query: '( ( myField ) AND ( anotherField ) )', }, }); }); diff --git a/x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts b/x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts index 7329159cc1d3b..12cd5aac25552 100644 --- a/x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts +++ b/x-pack/plugins/lens/public/app_plugin/show_underlying_data.ts @@ -16,6 +16,7 @@ import { import { i18n } from '@kbn/i18n'; import { RecursiveReadonly } from '@kbn/utility-types'; import { Capabilities } from 'kibana/public'; +import { partition } from 'lodash'; import { TableInspectorAdapter } from '../editor_frame_service/types'; import { Datasource } from '../types'; @@ -24,10 +25,17 @@ export const getShowUnderlyingDataLabel = () => defaultMessage: 'Open in Discover', }); -function joinQueries(queries: Query[][] | undefined) { - if (!queries) { - return ''; +/** + * Joins a series of queries. + * + * Uses "AND" along dimension 1 and "OR" along dimension 2 + */ +function joinQueries(queries: Query[][]) { + // leave a single query alone + if (queries.length === 1 && queries[0].length === 1) { + return queries[0][0].query; } + const expression = queries .filter((subQueries) => subQueries.length) .map((subQueries) => @@ -56,7 +64,10 @@ export function getLayerMetaInfo( currentDatasource: Datasource | undefined, datasourceState: unknown, activeData: TableInspectorAdapter | undefined, - capabilities: RecursiveReadonly + capabilities: RecursiveReadonly<{ + navLinks: Capabilities['navLinks']; + discover?: Capabilities['discover']; + }> ): { meta: LayerMetaInfo | undefined; isVisible: boolean; error: string | undefined } { const isVisible = Boolean(capabilities.navLinks?.discover && capabilities.discover?.show); // If Multiple tables, return @@ -123,40 +134,65 @@ export function getLayerMetaInfo( } // This enforces on assignment time that the two props are not the same -type LanguageAssignments = - | { queryLanguage: 'lucene'; filtersLanguage: 'kuery' } - | { queryLanguage: 'kuery'; filtersLanguage: 'lucene' }; +type QueryLanguage = 'lucene' | 'kuery'; +/** + * Translates an arbitrarily-large set of @type {Query}s (including those supplied in @type {LayerMetaInfo}) + * and existing Kibana @type {Filter}s into a single query and a new set of @type {Filter}s. This allows them to + * function as an equivalent context in Discover. + * + * If some of the queries are in KQL and some in Lucene, all the queries in one language will be merged into + * a large query to be shown in the query bar, while the queries in the other language will be encoded as an + * extra filter pill. + */ export function combineQueryAndFilters( - query: Query | undefined, + query: Query | Query[] | undefined, filters: Filter[], meta: LayerMetaInfo, dataViews: DataViewBase[] | undefined ) { - // Unless a lucene query is already defined, kuery is assigned to it - const { queryLanguage, filtersLanguage }: LanguageAssignments = - query?.language === 'lucene' - ? { queryLanguage: 'lucene', filtersLanguage: 'kuery' } - : { queryLanguage: 'kuery', filtersLanguage: 'lucene' }; - - let newQuery = query; - const enabledFilters = meta.filters.enabled; - if (enabledFilters[queryLanguage]?.length) { - const filtersQuery = joinQueries(enabledFilters[queryLanguage]); - newQuery = { - language: queryLanguage, - query: query?.query.trim() - ? `( ${query.query} ) ${filtersQuery ? `AND ${filtersQuery}` : ''}` - : filtersQuery, - }; - } + const queries: { + kuery: Query[]; + lucene: Query[]; + } = { + kuery: [], + lucene: [], + }; + + const allQueries = Array.isArray(query) ? query : query ? [query] : []; + const nonEmptyQueries = allQueries.filter((q) => Boolean(q.query.trim())); + + [queries.lucene, queries.kuery] = partition(nonEmptyQueries, (q) => q.language === 'lucene'); + + const queryLanguage: QueryLanguage = + (nonEmptyQueries[0]?.language as QueryLanguage | undefined) || 'kuery'; + + const newQuery = { + language: queryLanguage, + query: joinQueries([ + ...queries[queryLanguage].map((q) => [q]), + ...(meta.filters.enabled[queryLanguage] || []), + ]), + }; + + const filtersLanguage = queryLanguage === 'lucene' ? 'kuery' : 'lucene'; // make a copy as the original filters are readonly const newFilters = [...filters]; + const dataView = dataViews?.find(({ id }) => id === meta.id); - if (enabledFilters[filtersLanguage]?.length) { - const queryExpression = joinQueries(enabledFilters[filtersLanguage]); - // Append the new filter based on the queryExpression to the existing ones + + const hasQueriesInFiltersLanguage = Boolean( + meta.filters.enabled[filtersLanguage]?.length || queries[filtersLanguage].length + ); + + if (hasQueriesInFiltersLanguage) { + const queryExpression = joinQueries([ + ...queries[filtersLanguage].map((q) => [q]), + ...(meta.filters.enabled[filtersLanguage] || []), + ]); + + // Create new filter to encode the rest of the query information newFilters.push( buildCustomFilter( meta.id!, @@ -171,11 +207,11 @@ export function combineQueryAndFilters( ) ); } + // for each disabled filter create a new custom filter and disable it // note that both languages go into the filter bar - const disabledFilters = meta.filters.disabled; for (const language of ['lucene', 'kuery'] as const) { - const [disabledQueries] = disabledFilters[language] || []; + const [disabledQueries] = meta.filters.disabled[language] || []; for (const disabledQuery of disabledQueries || []) { let label = disabledQuery.query as string; if (language === 'lucene') { @@ -193,5 +229,6 @@ export function combineQueryAndFilters( ); } } + return { filters: newFilters, query: newQuery }; } diff --git a/x-pack/plugins/lens/public/editor_frame_service/service.tsx b/x-pack/plugins/lens/public/editor_frame_service/service.tsx index b585d03e12f8f..ff05f7e5f0bb9 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/service.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/service.tsx @@ -61,7 +61,7 @@ export class EditorFrameService { private readonly datasources: Array Promise)> = []; private readonly visualizations: Array Promise)> = []; - private loadDatasources = () => collectAsyncDefinitions(this.datasources); + public loadDatasources = () => collectAsyncDefinitions(this.datasources); public loadVisualizations = () => collectAsyncDefinitions(this.visualizations); /** diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx index 2ac0742ebfdc2..f37b0dfe4ad1e 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx @@ -145,11 +145,14 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, inspector: inspectorPluginMock.createStartContract(), getTrigger, theme: themeServiceMock.createStartContract(), visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), documentToExpression: () => Promise.resolve({ @@ -189,9 +192,15 @@ describe('embeddable', () => { basePath, indexPatternService: {} as DataViewsContract, inspector: inspectorPluginMock.createStartContract(), - capabilities: { canSaveDashboards: true, canSaveVisualizations: true }, + capabilities: { + canSaveDashboards: true, + canSaveVisualizations: true, + discover: {}, + navLinks: {}, + }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -236,9 +245,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -294,9 +306,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -341,9 +356,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -387,9 +405,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -429,9 +450,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -474,9 +498,15 @@ describe('embeddable', () => { basePath, inspector: inspectorPluginMock.createStartContract(), indexPatternService: {} as DataViewsContract, - capabilities: { canSaveDashboards: true, canSaveVisualizations: true }, + capabilities: { + canSaveDashboards: true, + canSaveVisualizations: true, + discover: {}, + navLinks: {}, + }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -526,9 +556,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -576,9 +609,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -633,9 +669,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -659,7 +698,7 @@ describe('embeddable', () => { expect.objectContaining({ timeRange, query: [query, savedVis.state.query], - filters: mockInjectFilterReferences(filters, []), + filters, }) ); @@ -691,9 +730,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -723,8 +765,10 @@ describe('embeddable', () => { it('should merge external context with query and filters of the saved object', async () => { const timeRange: TimeRange = { from: 'now-15d', to: 'now' }; - const query: Query = { language: 'kquery', query: 'external filter' }; - const filters: Filter[] = [{ meta: { alias: 'test', negate: false, disabled: false } }]; + const query: Query = { language: 'kquery', query: 'external query' }; + const filters: Filter[] = [ + { meta: { alias: 'external filter', negate: false, disabled: false } }, + ]; const newSavedVis = { ...savedVis, @@ -750,9 +794,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -772,18 +819,16 @@ describe('embeddable', () => { await embeddable.initializeSavedVis(input); embeddable.render(mountpoint); - expect(expressionRenderer.mock.calls[0][0].searchContext).toEqual({ - timeRange, - query: [query, { language: 'kquery', query: 'saved filter' }], - // actual index pattern id gets injected - filters: mockInjectFilterReferences( - [ - filters[0], - { meta: { alias: 'test', negate: false, disabled: false, index: 'injected!' } }, - ], - [] - ), - }); + const expectedFilters = [ + ...input.filters!, + ...mockInjectFilterReferences(newSavedVis.state.filters, []), + ]; + expect(expressionRenderer.mock.calls[0][0].searchContext?.timeRange).toEqual(timeRange); + expect(expressionRenderer.mock.calls[0][0].searchContext?.filters).toEqual(expectedFilters); + expect(expressionRenderer.mock.calls[0][0].searchContext?.query).toEqual([ + query, + { language: 'kquery', query: 'saved filter' }, + ]); }); it('should execute trigger on event from expression renderer', async () => { @@ -798,9 +843,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -846,9 +894,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -891,9 +942,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -951,9 +1005,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -1030,9 +1087,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -1084,9 +1144,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -1135,9 +1198,12 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, visualizationMap: {}, + datasourceMap: {}, injectFilterReferences: jest.fn(mockInjectFilterReferences), theme: themeServiceMock.createStartContract(), documentToExpression: () => @@ -1207,6 +1273,8 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true, + discover: {}, + navLinks: {}, }, getTrigger, theme: themeServiceMock.createStartContract(), @@ -1216,6 +1284,7 @@ describe('embeddable', () => { onEditAction: onEditActionMock, } as unknown as Visualization, }, + datasourceMap: {}, documentToExpression: documentToExpressionMock, }, { id: '123' } as unknown as LensEmbeddableInput diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index a0d5c91777364..cf126721a7c91 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -9,7 +9,7 @@ import { isEqual, uniqBy } from 'lodash'; import React from 'react'; import { i18n } from '@kbn/i18n'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Filter } from '@kbn/es-query'; +import { DataViewBase, Filter } from '@kbn/es-query'; import { ExecutionContextSearch, Query, @@ -55,21 +55,25 @@ import { LensTableRowContextMenuEvent, VisualizationMap, Visualization, + DatasourceMap, + Datasource, } from '../types'; import type { DataViewsContract, DataView } from '../../../../../src/plugins/data_views/public'; import { getEditPath, DOC_TYPE, PLUGIN_ID } from '../../common'; import type { + Capabilities, IBasePath, KibanaExecutionContext, ThemeServiceStart, } from '../../../../../src/core/public'; import { LensAttributeService } from '../lens_attribute_service'; -import type { ErrorMessage } from '../editor_frame_service/types'; +import type { ErrorMessage, TableInspectorAdapter } from '../editor_frame_service/types'; import { getLensInspectorService, LensInspector } from '../lens_inspector_service'; import { SharingSavedObjectProps } from '../types'; import type { SpacesPluginStart } from '../../../spaces/public'; -import { inferTimeField } from '../utils'; +import { getActiveDatasourceIdFromDoc, getIndexPatternsObjects, inferTimeField } from '../utils'; +import { getLayerMetaInfo, combineQueryAndFilters } from '../app_plugin/show_underlying_data'; export type LensSavedObjectAttributes = Omit; @@ -114,6 +118,7 @@ export interface LensEmbeddableDeps { ) => Promise<{ ast: Ast | null; errors: ErrorMessage[] | undefined }>; injectFilterReferences: FilterManager['inject']; visualizationMap: VisualizationMap; + datasourceMap: DatasourceMap; indexPatternService: DataViewsContract; expressionRenderer: ReactExpressionRendererType; timefilter: TimefilterContract; @@ -121,12 +126,25 @@ export interface LensEmbeddableDeps { inspector: InspectorStart; getTrigger?: UiActionsStart['getTrigger'] | undefined; getTriggerCompatibleActions?: UiActionsStart['getTriggerCompatibleActions']; - capabilities: { canSaveVisualizations: boolean; canSaveDashboards: boolean }; + capabilities: { + canSaveVisualizations: boolean; + canSaveDashboards: boolean; + navLinks: Capabilities['navLinks']; + discover: Capabilities['discover']; + }; usageCollection?: UsageCollectionSetup; spaces?: SpacesPluginStart; theme: ThemeServiceStart; } +export interface ViewUnderlyingDataArgs { + indexPatternId: string; + timeRange: TimeRange; + filters: Filter[]; + query: Query | undefined; + columns: string[]; +} + const getExpressionFromDocument = async ( document: Document, documentToExpression: LensEmbeddableDeps['documentToExpression'] @@ -138,6 +156,52 @@ const getExpressionFromDocument = async ( }; }; +function getViewUnderlyingDataArgs({ + activeDatasource, + activeDatasourceState, + activeData, + dataViews, + capabilities, + query, + filters, + timeRange, +}: { + activeDatasource: Datasource; + activeDatasourceState: unknown; + activeData: TableInspectorAdapter | undefined; + dataViews: DataViewBase[] | undefined; + capabilities: LensEmbeddableDeps['capabilities']; + query: ExecutionContextSearch['query']; + filters: Filter[]; + timeRange: TimeRange; +}) { + const { error, meta } = getLayerMetaInfo( + activeDatasource, + activeDatasourceState, + activeData, + capabilities + ); + + if (error || !meta) { + return; + } + + const { filters: newFilters, query: newQuery } = combineQueryAndFilters( + query, + filters, + meta, + dataViews + ); + + return { + indexPatternId: meta.id, + timeRange, + filters: newFilters, + query: newQuery, + columns: meta.columns, + }; +} + export class Embeddable extends AbstractEmbeddable implements ReferenceOrValueEmbeddable @@ -173,6 +237,16 @@ export class Embeddable searchSessionId?: string; } = {}; + private activeDataInfo: { + activeData?: TableInspectorAdapter; + activeDatasource?: Datasource; + activeDatasourceState?: unknown; + } = {}; + + private indexPatterns: DataView[] = []; + + private viewUnderlyingDataArgs?: ViewUnderlyingDataArgs; + constructor( private deps: LensEmbeddableDeps, initialInput: LensEmbeddableInput, @@ -387,7 +461,8 @@ export class Embeddable return isDirty; } - private updateActiveData: ExpressionWrapperProps['onData$'] = () => { + private updateActiveData: ExpressionWrapperProps['onData$'] = (_, adapters) => { + this.activeDataInfo.activeData = adapters?.tables?.tables; if (this.input.onLoad) { // once onData$ is get's called from expression renderer, loading becomes false this.input.onLoad(false); @@ -495,22 +570,25 @@ export class Embeddable if (!this.savedVis) { throw new Error('savedVis is required for getMergedSearchContext'); } - const output: ExecutionContextSearch = { + + const context: ExecutionContextSearch = { timeRange: this.externalSearchContext.timeRange, + query: [this.savedVis.state.query], + filters: this.deps.injectFilterReferences( + this.savedVis.state.filters, + this.savedVis.references + ), }; + if (this.externalSearchContext.query) { - output.query = [this.externalSearchContext.query, this.savedVis.state.query]; - } else { - output.query = [this.savedVis.state.query]; + context.query = [this.externalSearchContext.query, ...(context.query as Query[])]; } + if (this.externalSearchContext.filters?.length) { - output.filters = [...this.externalSearchContext.filters, ...this.savedVis.state.filters]; - } else { - output.filters = [...this.savedVis.state.filters]; + context.filters = [...this.externalSearchContext.filters, ...(context.filters as Filter[])]; } - output.filters = this.deps.injectFilterReferences(output.filters, this.savedVis.references); - return output; + return context; } private get onEditAction(): Visualization['onEditAction'] { @@ -597,28 +675,78 @@ export class Embeddable } } + private async loadViewUnderlyingDataArgs(): Promise { + const mergedSearchContext = this.getMergedSearchContext(); + + if (!this.activeDataInfo.activeData || !mergedSearchContext.timeRange) { + return false; + } + + const activeDatasourceId = getActiveDatasourceIdFromDoc(this.savedVis); + if (!activeDatasourceId) { + return false; + } + + this.activeDataInfo.activeDatasource = this.deps.datasourceMap[activeDatasourceId]; + const docDatasourceState = this.savedVis?.state.datasourceStates[activeDatasourceId]; + + if (!this.activeDataInfo.activeDatasourceState) { + this.activeDataInfo.activeDatasourceState = + await this.activeDataInfo.activeDatasource.initialize( + docDatasourceState, + this.savedVis?.references + ); + } + + const viewUnderlyingDataArgs = getViewUnderlyingDataArgs({ + activeDatasource: this.activeDataInfo.activeDatasource, + activeDatasourceState: this.activeDataInfo.activeDatasourceState, + activeData: this.activeDataInfo.activeData, + dataViews: this.indexPatterns, + capabilities: this.deps.capabilities, + query: mergedSearchContext.query, + filters: mergedSearchContext.filters || [], + timeRange: mergedSearchContext.timeRange, + }); + + const loaded = typeof viewUnderlyingDataArgs !== 'undefined'; + if (loaded) { + this.viewUnderlyingDataArgs = viewUnderlyingDataArgs; + } + return loaded; + } + + /** + * Returns the necessary arguments to view the underlying data in discover. + * + * Only makes sense to call this after canViewUnderlyingData has been checked + */ + public getViewUnderlyingDataArgs() { + return this.viewUnderlyingDataArgs; + } + + public canViewUnderlyingData() { + return this.loadViewUnderlyingDataArgs(); + } + async initializeOutput() { if (!this.savedVis) { return; } - const responses = await Promise.allSettled( - uniqBy( - this.savedVis.references.filter(({ type }) => type === 'index-pattern'), - 'id' - ).map(({ id }) => this.deps.indexPatternService.get(id)) + + const { indexPatterns } = await getIndexPatternsObjects( + this.savedVis?.references.map(({ id }) => id) || [], + this.deps.indexPatternService ); - const indexPatterns = responses - .filter( - (response): response is PromiseFulfilledResult => response.status === 'fulfilled' - ) - .map(({ value }) => value); + + this.indexPatterns = uniqBy(indexPatterns, 'id'); // passing edit url and index patterns to the output of this embeddable for // the container to pick them up and use them to configure filter bar and // config dropdown correctly. const input = this.getInput(); - this.errors = this.maybeAddTimeRangeError(this.errors, input, indexPatterns); + this.errors = this.maybeAddTimeRangeError(this.errors, input, this.indexPatterns); if (this.errors) { this.logError('validation'); @@ -633,7 +761,7 @@ export class Embeddable title, editPath: getEditPath(savedObjectId), editUrl: this.deps.basePath.prepend(`/app/lens${getEditPath(savedObjectId)}`), - indexPatterns, + indexPatterns: this.indexPatterns, }); // deferred loading of this embeddable is complete diff --git a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts index af76fd83b2b97..77a4acfa7d433 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts +++ b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts @@ -26,7 +26,7 @@ import { DOC_TYPE } from '../../common/constants'; import { ErrorMessage } from '../editor_frame_service/types'; import { extract, inject } from '../../common/embeddable_factory'; import type { SpacesPluginStart } from '../../../spaces/public'; -import { VisualizationMap } from '../types'; +import { DatasourceMap, VisualizationMap } from '../types'; export interface LensEmbeddableStartServices { timefilter: TimefilterContract; @@ -43,6 +43,7 @@ export interface LensEmbeddableStartServices { ) => Promise<{ ast: Ast | null; errors: ErrorMessage[] | undefined }>; injectFilterReferences: FilterManager['inject']; visualizationMap: VisualizationMap; + datasourceMap: DatasourceMap; spaces?: SpacesPluginStart; theme: ThemeServiceStart; } @@ -92,6 +93,7 @@ export class EmbeddableFactory implements EmbeddableFactoryDefinition { documentToExpression, injectFilterReferences, visualizationMap, + datasourceMap, uiActions, coreHttp, attributeService, @@ -118,9 +120,12 @@ export class EmbeddableFactory implements EmbeddableFactoryDefinition { documentToExpression, injectFilterReferences, visualizationMap, + datasourceMap, capabilities: { canSaveDashboards: Boolean(capabilities.dashboard?.showWriteControls), canSaveVisualizations: Boolean(capabilities.visualize.save), + navLinks: capabilities.navLinks, + discover: capabilities.discover, }, usageCollection, theme, diff --git a/x-pack/plugins/lens/public/expressions.ts b/x-pack/plugins/lens/public/expressions.ts index 2bf1f49ae37c8..40fee07f5d95a 100644 --- a/x-pack/plugins/lens/public/expressions.ts +++ b/x-pack/plugins/lens/public/expressions.ts @@ -6,26 +6,8 @@ */ import type { ExpressionsSetup } from 'src/plugins/expressions/public'; - -import { - axisExtentConfig, - yAxisConfig, - axisTitlesVisibilityConfig, -} from '../common/expressions/xy_chart/axis_config'; -import { gridlinesConfig } from '../common/expressions/xy_chart/grid_lines_config'; -import { labelsOrientationConfig } from '../common/expressions/xy_chart/labels_orientation_config'; -import { - dataLayerConfig, - referenceLineLayerConfig, - annotationLayerConfig, -} from '../common/expressions/xy_chart/layer_config'; -import { legendConfig } from '../common/expressions/xy_chart/legend_config'; -import { tickLabelsConfig } from '../common/expressions/xy_chart/tick_labels_config'; -import { xyChart } from '../common/expressions/xy_chart/xy_chart'; - import { getDatatable } from '../common/expressions/datatable/datatable'; import { datatableColumn } from '../common/expressions/datatable/datatable_column'; - import { mergeTables } from '../common/expressions/merge_tables'; import { renameColumns } from '../common/expressions/rename_columns/rename_columns'; import { formatColumn } from '../common/expressions/format_column'; @@ -41,22 +23,11 @@ export const setupExpressions = ( [lensMultitable].forEach((expressionType) => expressions.registerType(expressionType)); [ - xyChart, mergeTables, counterRate, - yAxisConfig, - dataLayerConfig, - referenceLineLayerConfig, - annotationLayerConfig, formatColumn, - legendConfig, renameColumns, - gridlinesConfig, datatableColumn, - tickLabelsConfig, - axisTitlesVisibilityConfig, - axisExtentConfig, - labelsOrientationConfig, getDatatable(formatFactory), getTimeScale(getTimeZone), ].forEach((expressionFn) => expressions.registerFunction(expressionFn)); diff --git a/x-pack/plugins/lens/public/index.ts b/x-pack/plugins/lens/public/index.ts index a86ba194bf4db..5b1501410df26 100644 --- a/x-pack/plugins/lens/public/index.ts +++ b/x-pack/plugins/lens/public/index.ts @@ -11,7 +11,13 @@ export type { EmbeddableComponentProps, TypedLensByValueInput, } from './embeddable/embeddable_component'; -export type { XYState } from './xy_visualization/types'; +export type { + XYState, + XYReferenceLineLayerConfig, + XYLayerConfig, + XYDataLayerConfig, + XYAnnotationLayerConfig, +} from './xy_visualization/types'; export type { DatasourcePublicAPI, DataType, @@ -21,15 +27,6 @@ export type { Visualization, VisualizationSuggestion, } from './types'; -export type { - AxesSettingsConfig, - XYLayerConfig, - LegendConfig, - SeriesType, - YAxisMode, - XYCurveType, - YConfig, -} from '../common/expressions'; export type { ValueLabelConfig, PieVisualizationState, @@ -70,6 +67,42 @@ export type { FormulaPublicApi, StaticValueIndexPatternColumn, } from './indexpattern_datasource/types'; +export type { + XYArgs, + YConfig, + XYRender, + LayerType, + YAxisMode, + LineStyle, + FillStyle, + SeriesType, + YScaleType, + XScaleType, + AxisConfig, + ValidLayer, + XYCurveType, + XYChartProps, + LegendConfig, + IconPosition, + YConfigResult, + DataLayerArgs, + LensMultiTable, + ValueLabelMode, + AxisExtentMode, + FittingFunction, + AxisExtentConfig, + LegendConfigResult, + AxesSettingsConfig, + GridlinesConfigResult, + DataLayerConfigResult, + TickLabelsConfigResult, + AxisExtentConfigResult, + ReferenceLineLayerArgs, + LabelsOrientationConfig, + LabelsOrientationConfigResult, + ReferenceLineLayerConfigResult, + AxisTitlesVisibilityConfigResult, +} from '../../../../src/plugins/chart_expressions/expression_xy/common'; export type { LensEmbeddableInput } from './embeddable'; export { layerTypes } from '../common'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx index 1321d765e119f..60fdb382322a6 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx @@ -6,11 +6,20 @@ */ import React from 'react'; -import { shallow } from 'enzyme'; +import { mount, shallow } from 'enzyme'; import { FormatSelector } from './format_selector'; import { act } from 'react-dom/test-utils'; import { GenericIndexPatternColumn } from '../..'; +jest.mock('lodash', () => { + const original = jest.requireActual('lodash'); + + return { + ...original, + debounce: (fn: unknown) => fn, + }; +}); + const bytesColumn: GenericIndexPatternColumn = { label: 'Max of bytes', dataType: 'number', @@ -63,4 +72,18 @@ describe('FormatSelector', () => { }); expect(props.onChange).toBeCalledWith({ id: 'bytes', params: { decimals: 0 } }); }); + it('updates the suffix', async () => { + const props = getDefaultProps(); + const component = mount(); + await act(async () => { + component + .find('[data-test-subj="indexPattern-dimension-formatSuffix"]') + .last() + .prop('onChange')!({ + currentTarget: { value: 'GB' }, + } as React.ChangeEvent); + }); + component.update(); + expect(props.onChange).toBeCalledWith({ id: 'bytes', params: { suffix: 'GB' } }); + }); }); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx index efe7966870531..49231e64d53be 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx @@ -7,9 +7,10 @@ import React, { useCallback, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiFormRow, EuiComboBox, EuiSpacer, EuiRange } from '@elastic/eui'; +import { EuiFormRow, EuiComboBox, EuiSpacer, EuiRange, EuiFieldText } from '@elastic/eui'; import { GenericIndexPatternColumn } from '../indexpattern'; import { isColumnFormatted } from '../operations/definitions/helpers'; +import { useDebouncedValue } from '../../shared_components'; const supportedFormats: Record = { number: { @@ -46,6 +47,10 @@ const decimalsLabel = i18n.translate('xpack.lens.indexPattern.decimalPlacesLabel defaultMessage: 'Decimals', }); +const suffixLabel = i18n.translate('xpack.lens.indexPattern.suffixLabel', { + defaultMessage: 'Suffix', +}); + interface FormatSelectorProps { selectedColumn: GenericIndexPatternColumn; onChange: (newFormat?: { id: string; params?: Record }) => void; @@ -62,6 +67,30 @@ export function FormatSelector(props: FormatSelectorProps) { const [decimals, setDecimals] = useState(currentFormat?.params?.decimals ?? 2); + const onChangeSuffix = useCallback( + (suffix: string) => { + if (!currentFormat) { + return; + } + onChange({ + id: currentFormat.id, + params: { + ...currentFormat.params, + suffix, + }, + }); + }, + [currentFormat, onChange] + ); + + const { handleInputChange: setSuffix, inputValue: suffix } = useDebouncedValue( + { + onChange: onChangeSuffix, + value: currentFormat?.params?.suffix ?? '', + }, + { allowFalsyValue: true } + ); + const selectedFormat = currentFormat?.id ? supportedFormats[currentFormat.id] : undefined; const stableOptions = useMemo( () => [ @@ -135,6 +164,7 @@ export function FormatSelector(props: FormatSelectorProps) { onChange({ id: currentFormat.id, params: { + ...currentFormat.params, decimals: validatedValue, }, }); @@ -145,6 +175,18 @@ export function FormatSelector(props: FormatSelectorProps) { prepend={decimalsLabel} aria-label={decimalsLabel} /> + + { + setSuffix(e.currentTarget.value); + }} + data-test-subj="indexPattern-dimension-formatSuffix" + compressed + fullWidth + prepend={suffixLabel} + aria-label={suffixLabel} + /> ) : null}
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 8490b48ad320e..e65d89547d567 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 @@ -12,7 +12,7 @@ import { euiThemeVars } from '@kbn/ui-theme'; import { AggFunctionsMapping } from '../../../../../../../src/plugins/data/public'; import { buildExpressionFunction } from '../../../../../../../src/plugins/expressions/public'; import { OperationDefinition, ParamEditorProps } from './index'; -import { FieldBasedIndexPatternColumn, FormatParams } from './column_types'; +import { FieldBasedIndexPatternColumn, ValueFormatConfig } from './column_types'; import { getFormatFromPreviousColumn, @@ -60,7 +60,7 @@ export interface CardinalityIndexPatternColumn extends FieldBasedIndexPatternCol operationType: typeof OPERATION_TYPE; params?: { emptyAsNull?: boolean; - format?: FormatParams; + format?: ValueFormatConfig; }; } diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts index 333312116949f..029f2b7bed7de 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/column_types.ts @@ -19,17 +19,18 @@ export interface BaseIndexPatternColumn extends Operation { timeShift?: string; } -export interface FormatParams { +export interface ValueFormatConfig { id: string; params?: { decimals: number; + suffix?: string; }; } // Formatting can optionally be added to any column export interface FormattedIndexPatternColumn extends BaseIndexPatternColumn { params?: { - format?: FormatParams; + format?: ValueFormatConfig; }; } diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/count.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/count.tsx index 7ecd5a4970c95..0643e6b2ca365 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/count.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/count.tsx @@ -12,7 +12,7 @@ import { EuiSwitch } from '@elastic/eui'; import { AggFunctionsMapping } from '../../../../../../../src/plugins/data/public'; import { buildExpressionFunction } from '../../../../../../../src/plugins/expressions/public'; import { OperationDefinition, ParamEditorProps } from './index'; -import { FieldBasedIndexPatternColumn, FormatParams } from './column_types'; +import { FieldBasedIndexPatternColumn, ValueFormatConfig } from './column_types'; import { IndexPatternField } from '../../types'; import { getInvalidFieldMessage, @@ -36,7 +36,7 @@ export type CountIndexPatternColumn = FieldBasedIndexPatternColumn & { operationType: 'count'; params?: { emptyAsNull?: boolean; - format?: FormatParams; + format?: ValueFormatConfig; }; }; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/math.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/math.tsx index 7aae35f496923..4797ac348c71f 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/math.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/formula/math.tsx @@ -7,7 +7,7 @@ import type { TinymathAST } from '@kbn/tinymath'; import { OperationDefinition } from '../index'; -import { ReferenceBasedIndexPatternColumn } from '../column_types'; +import { ValueFormatConfig, ReferenceBasedIndexPatternColumn } from '../column_types'; import { IndexPattern } from '../../../types'; export interface MathIndexPatternColumn extends ReferenceBasedIndexPatternColumn { @@ -15,12 +15,7 @@ export interface MathIndexPatternColumn extends ReferenceBasedIndexPatternColumn params: { tinymathAst: TinymathAST | string; // last value on numeric fields can be formatted - format?: { - id: string; - params?: { - decimals: number; - }; - }; + format?: ValueFormatConfig; }; } 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 1ebbf6d87b92f..b8fe5a1584d35 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 @@ -18,7 +18,7 @@ import { import { AggFunctionsMapping } from '../../../../../../../src/plugins/data/public'; import { buildExpressionFunction } from '../../../../../../../src/plugins/expressions/public'; import { OperationDefinition } from './index'; -import { FieldBasedIndexPatternColumn } from './column_types'; +import { FieldBasedIndexPatternColumn, ValueFormatConfig } from './column_types'; import { IndexPatternField, IndexPattern } from '../../types'; import { adjustColumnReferencesForChangedColumn, updateColumnParam } from '../layer_helpers'; import { DataType } from '../../../types'; @@ -108,12 +108,7 @@ export interface LastValueIndexPatternColumn extends FieldBasedIndexPatternColum sortField: string; showArrayValues: boolean; // last value on numeric fields can be formatted - format?: { - id: string; - params?: { - decimals: number; - }; - }; + format?: ValueFormatConfig; }; } 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 2b46e52defdba..438902962fbcf 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 @@ -19,7 +19,11 @@ import { combineErrorMessages, isColumnOfType, } from './helpers'; -import { FieldBasedIndexPatternColumn, BaseIndexPatternColumn, FormatParams } from './column_types'; +import { + FieldBasedIndexPatternColumn, + BaseIndexPatternColumn, + ValueFormatConfig, +} from './column_types'; import { adjustTimeScaleLabelSuffix, adjustTimeScaleOnOtherColumnChange, @@ -31,7 +35,7 @@ type MetricColumn = FieldBasedIndexPatternColumn & { operationType: T; params?: { emptyAsNull?: boolean; - format?: FormatParams; + format?: ValueFormatConfig; }; }; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/static_value.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/static_value.tsx index d41ddaf26fb3f..39122808c9c0b 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/static_value.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/static_value.tsx @@ -8,7 +8,11 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFieldNumber, EuiFormLabel, EuiSpacer } from '@elastic/eui'; import { OperationDefinition } from './index'; -import { ReferenceBasedIndexPatternColumn, GenericIndexPatternColumn } from './column_types'; +import { + ReferenceBasedIndexPatternColumn, + GenericIndexPatternColumn, + ValueFormatConfig, +} from './column_types'; import type { IndexPattern } from '../../types'; import { useDebouncedValue } from '../../../shared_components'; import { getFormatFromPreviousColumn, isValidNumber } from './helpers'; @@ -37,12 +41,7 @@ export interface StaticValueIndexPatternColumn extends ReferenceBasedIndexPatter operationType: 'static_value'; params: { value?: string; - format?: { - id: string; - params?: { - decimals: number; - }; - }; + format?: ValueFormatConfig; }; } diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/types.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/types.ts index 1284870327653..eb4425987cc31 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/types.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/terms/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { FieldBasedIndexPatternColumn } from '../column_types'; +import { FieldBasedIndexPatternColumn, ValueFormatConfig } from '../column_types'; export interface TermsIndexPatternColumn extends FieldBasedIndexPatternColumn { operationType: 'terms'; @@ -22,12 +22,7 @@ export interface TermsIndexPatternColumn extends FieldBasedIndexPatternColumn { missingBucket?: boolean; secondaryFields?: string[]; // Terms on numeric fields can be formatted - format?: { - id: string; - params?: { - decimals: number; - }; - }; + format?: ValueFormatConfig; parentFormat?: { id: string; }; 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 f9fe8701949e1..f229407ce23ff 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts @@ -194,6 +194,10 @@ function getExpressionForLayer( format: format ? [format.id] : [''], columnId: [id], decimals: typeof format?.params?.decimals === 'number' ? [format.params.decimals] : [], + suffix: + format?.params && 'suffix' in format.params && format.params.suffix + ? [format.params.suffix] + : [], parentFormat: parentFormat ? [JSON.stringify(parentFormat)] : [], }, }; diff --git a/x-pack/plugins/lens/public/plugin.ts b/x-pack/plugins/lens/public/plugin.ts index d2bb7cdbb4344..dbecf1e7d779f 100644 --- a/x-pack/plugins/lens/public/plugin.ts +++ b/x-pack/plugins/lens/public/plugin.ts @@ -16,8 +16,12 @@ import type { DataPublicPluginSetup, DataPublicPluginStart, } from '../../../../src/plugins/data/public'; +import { + CONTEXT_MENU_TRIGGER, + EmbeddableSetup, + EmbeddableStart, +} from '../../../../src/plugins/embeddable/public'; import type { DataViewsPublicPluginStart } from '../../../../src/plugins/data_views/public'; -import type { EmbeddableSetup, EmbeddableStart } from '../../../../src/plugins/embeddable/public'; import type { DashboardStart } from '../../../../src/plugins/dashboard/public'; import type { SpacesPluginStart } from '../../spaces/public'; import type { @@ -80,6 +84,7 @@ import type { LensTopNavMenuEntryGenerator, } from './types'; import { getLensAliasConfig } from './vis_type_alias'; +import { createOpenInDiscoverAction } from './trigger_actions/open_in_discover_action'; import { visualizeFieldAction } from './trigger_actions/visualize_field_actions'; import { visualizeTSVBAction } from './trigger_actions/visualize_tsvb_actions'; @@ -259,6 +264,7 @@ export class LensPlugin { eventAnnotation ); const visualizationMap = await this.editorFrameService!.loadVisualizations(); + const datasourceMap = await this.editorFrameService!.loadDatasources(); return { attributeService: getLensAttributeService(coreStart, plugins), @@ -269,6 +275,7 @@ export class LensPlugin { documentToExpression: this.editorFrameService!.documentToExpression, injectFilterReferences: data.query.filterManager.inject.bind(data.query.filterManager), visualizationMap, + datasourceMap, indexPatternService: plugins.dataViews, uiActions: plugins.uiActions, usageCollection, @@ -440,6 +447,14 @@ export class LensPlugin { visualizeTSVBAction(core.application) ); + startDependencies.uiActions.addTriggerAction( + CONTEXT_MENU_TRIGGER, + createOpenInDiscoverAction( + startDependencies.discover!, + core.application.capabilities.discover.show as boolean + ) + ); + return { EmbeddableComponent: getEmbeddableComponent(core, startDependencies), SaveModalComponent: getSaveModalComponent(core, startDependencies), diff --git a/x-pack/plugins/lens/public/shared_components/axis_title_settings.tsx b/x-pack/plugins/lens/public/shared_components/axis_title_settings.tsx index 00cba7db4d17a..ff7b058873bbc 100644 --- a/x-pack/plugins/lens/public/shared_components/axis_title_settings.tsx +++ b/x-pack/plugins/lens/public/shared_components/axis_title_settings.tsx @@ -8,8 +8,9 @@ import React, { useCallback, useState } from 'react'; import { EuiSpacer, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { AxesSettingsConfig } from '../../common/expressions'; +import { AxesSettingsConfig } from '../../../../../src/plugins/chart_expressions/expression_xy/common'; import { LabelMode, useDebouncedValue, VisLabel } from './'; + type AxesSettingsConfigKeys = keyof AxesSettingsConfig; export interface AxisTitleSettingsProps { diff --git a/x-pack/plugins/lens/public/trigger_actions/open_in_discover_action.test.ts b/x-pack/plugins/lens/public/trigger_actions/open_in_discover_action.test.ts new file mode 100644 index 0000000000000..321f87d42fc39 --- /dev/null +++ b/x-pack/plugins/lens/public/trigger_actions/open_in_discover_action.test.ts @@ -0,0 +1,107 @@ +/* + * 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 { DiscoverStart } from '../../../../../src/plugins/discover/public'; +import type { IEmbeddable } from '../../../../../src/plugins/embeddable/public'; +import { ActionExecutionContext } from '../../../../../src/plugins/ui_actions/public'; +import { DOC_TYPE } from '../../common'; +import { Embeddable } from '../embeddable'; +import { createOpenInDiscoverAction } from './open_in_discover_action'; + +describe('open in discover action', () => { + describe('compatibility check', () => { + it('is incompatible with non-lens embeddables', async () => { + const embeddable = { type: 'NOT_LENS' } as IEmbeddable; + + const isCompatible = await createOpenInDiscoverAction({} as DiscoverStart, true).isCompatible( + { + embeddable, + } as ActionExecutionContext<{ embeddable: IEmbeddable }> + ); + + expect(isCompatible).toBeFalsy(); + }); + it('is incompatible if user cant access Discover app', async () => { + // setup + const embeddable = { type: DOC_TYPE } as Embeddable; + embeddable.canViewUnderlyingData = () => Promise.resolve(true); + + let hasDiscoverAccess = true; + // make sure it would work if we had access to Discover + expect( + await createOpenInDiscoverAction({} as DiscoverStart, hasDiscoverAccess).isCompatible({ + embeddable, + } as unknown as ActionExecutionContext<{ embeddable: IEmbeddable }>) + ).toBeTruthy(); + + // make sure no Discover access makes the action incompatible + hasDiscoverAccess = false; + expect( + await createOpenInDiscoverAction({} as DiscoverStart, hasDiscoverAccess).isCompatible({ + embeddable, + } as unknown as ActionExecutionContext<{ embeddable: IEmbeddable }>) + ).toBeFalsy(); + }); + it('checks for ability to view underlying data if lens embeddable', async () => { + // setup + const embeddable = { type: DOC_TYPE } as Embeddable; + + // test false + embeddable.canViewUnderlyingData = jest.fn(() => Promise.resolve(false)); + expect( + await createOpenInDiscoverAction({} as DiscoverStart, true).isCompatible({ + embeddable, + } as unknown as ActionExecutionContext<{ embeddable: IEmbeddable }>) + ).toBeFalsy(); + + expect(embeddable.canViewUnderlyingData).toHaveBeenCalledTimes(1); + + // test true + embeddable.canViewUnderlyingData = jest.fn(() => Promise.resolve(true)); + expect( + await createOpenInDiscoverAction({} as DiscoverStart, true).isCompatible({ + embeddable, + } as unknown as ActionExecutionContext<{ embeddable: IEmbeddable }>) + ).toBeTruthy(); + + expect(embeddable.canViewUnderlyingData).toHaveBeenCalledTimes(1); + }); + }); + + it('navigates to discover when executed', async () => { + const viewUnderlyingDataArgs = { + indexPatternId: 'index-pattern-id', + timeRange: {}, + filters: [], + query: undefined, + columns: [], + }; + + const embeddable = { + getViewUnderlyingDataArgs: jest.fn(() => viewUnderlyingDataArgs), + }; + + const discoverUrl = 'https://discover-redirect-url'; + const discover = { + locator: { + getRedirectUrl: jest.fn(() => discoverUrl), + }, + } as unknown as DiscoverStart; + + globalThis.open = jest.fn(); + + await createOpenInDiscoverAction(discover, true).execute({ + embeddable, + } as unknown as ActionExecutionContext<{ + embeddable: IEmbeddable; + }>); + + expect(embeddable.getViewUnderlyingDataArgs).toHaveBeenCalled(); + expect(discover.locator!.getRedirectUrl).toHaveBeenCalledWith(viewUnderlyingDataArgs); + expect(globalThis.open).toHaveBeenCalledWith(discoverUrl, '_blank'); + }); +}); diff --git a/x-pack/plugins/lens/public/trigger_actions/open_in_discover_action.ts b/x-pack/plugins/lens/public/trigger_actions/open_in_discover_action.ts new file mode 100644 index 0000000000000..947e01fd15bc9 --- /dev/null +++ b/x-pack/plugins/lens/public/trigger_actions/open_in_discover_action.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import type { IEmbeddable } from 'src/plugins/embeddable/public'; +import { createAction } from '../../../../../src/plugins/ui_actions/public'; +import type { Embeddable } from '../embeddable'; +import type { DiscoverStart } from '../../../../../src/plugins/discover/public'; +import { DOC_TYPE } from '../../common'; + +const ACTION_OPEN_IN_DISCOVER = 'ACTION_OPEN_IN_DISCOVER'; + +export const createOpenInDiscoverAction = (discover: DiscoverStart, hasDiscoverAccess: boolean) => + createAction<{ embeddable: IEmbeddable }>({ + type: ACTION_OPEN_IN_DISCOVER, + id: ACTION_OPEN_IN_DISCOVER, + order: 19, // right after Inspect which is 20 + getIconType: () => 'popout', + getDisplayName: () => + i18n.translate('xpack.lens.actions.openInDiscover', { + defaultMessage: 'Open in Discover', + }), + isCompatible: async (context: { embeddable: IEmbeddable }) => { + if (!hasDiscoverAccess) return false; + return ( + context.embeddable.type === DOC_TYPE && + (await (context.embeddable as Embeddable).canViewUnderlyingData()) + ); + }, + execute: async (context: { embeddable: Embeddable }) => { + const args = context.embeddable.getViewUnderlyingDataArgs()!; + const discoverUrl = discover.locator?.getRedirectUrl({ + ...args, + }); + window.open(discoverUrl, '_blank'); + }, + }); diff --git a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/to_expression.test.ts.snap b/x-pack/plugins/lens/public/xy_visualization/__snapshots__/to_expression.test.ts.snap index a1b0431f67138..27cc383834049 100644 --- a/x-pack/plugins/lens/public/xy_visualization/__snapshots__/to_expression.test.ts.snap +++ b/x-pack/plugins/lens/public/xy_visualization/__snapshots__/to_expression.test.ts.snap @@ -20,7 +20,7 @@ Object { true, ], }, - "function": "lens_xy_axisTitlesVisibilityConfig", + "function": "axisTitlesVisibilityConfig", "type": "function", }, ], @@ -60,7 +60,7 @@ Object { true, ], }, - "function": "lens_xy_gridlinesConfig", + "function": "gridlinesConfig", "type": "function", }, ], @@ -85,7 +85,7 @@ Object { -45, ], }, - "function": "lens_xy_labelsOrientationConfig", + "function": "labelsOrientationConfig", "type": "function", }, ], @@ -113,9 +113,6 @@ Object { "layerId": Array [ "first", ], - "layerType": Array [ - "data", - ], "seriesType": Array [ "area", ], @@ -133,7 +130,7 @@ Object { "linear", ], }, - "function": "lens_xy_data_layer", + "function": "dataLayer", "type": "function", }, ], @@ -162,7 +159,7 @@ Object { "showSingleSeries": Array [], "verticalAlignment": Array [], }, - "function": "lens_xy_legendConfig", + "function": "legendConfig", "type": "function", }, ], @@ -184,7 +181,7 @@ Object { true, ], }, - "function": "lens_xy_tickLabelsConfig", + "function": "tickLabelsConfig", "type": "function", }, ], @@ -214,7 +211,7 @@ Object { ], "upperBound": Array [], }, - "function": "lens_xy_axisExtentConfig", + "function": "axisExtentConfig", "type": "function", }, ], @@ -236,7 +233,7 @@ Object { 456, ], }, - "function": "lens_xy_axisExtentConfig", + "function": "axisExtentConfig", "type": "function", }, ], @@ -250,7 +247,7 @@ Object { "", ], }, - "function": "lens_xy_chart", + "function": "xyVis", "type": "function", }, ], diff --git a/x-pack/plugins/lens/public/xy_visualization/annotations/config_panel/index.tsx b/x-pack/plugins/lens/public/xy_visualization/annotations/config_panel/index.tsx index 4cdb2d6c7e0b9..c27165accb81d 100644 --- a/x-pack/plugins/lens/public/xy_visualization/annotations/config_panel/index.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/annotations/config_panel/index.tsx @@ -13,9 +13,8 @@ import type { PaletteRegistry } from 'src/plugins/charts/public'; import moment from 'moment'; import { EventAnnotationConfig } from 'src/plugins/event_annotation/common/types'; import type { VisualizationDimensionEditorProps } from '../../../types'; -import { State, XYState } from '../../types'; +import { State, XYState, XYAnnotationLayerConfig } from '../../types'; import { FormatFactory } from '../../../../common'; -import { XYAnnotationLayerConfig } from '../../../../common/expressions'; import { ColorPicker } from '../../xy_config_panel/color_picker'; import { DimensionEditorSection, NameInput, useDebouncedValue } from '../../../shared_components'; import { isHorizontalChart } from '../../state_helpers'; diff --git a/x-pack/plugins/lens/public/xy_visualization/annotations/expression.scss b/x-pack/plugins/lens/public/xy_visualization/annotations/expression.scss deleted file mode 100644 index fc2b1204bb1d0..0000000000000 --- a/x-pack/plugins/lens/public/xy_visualization/annotations/expression.scss +++ /dev/null @@ -1,37 +0,0 @@ -.lnsXyDecorationRotatedWrapper { - display: inline-block; - overflow: hidden; - line-height: 1.5; - - .lnsXyDecorationRotatedWrapper__label { - display: inline-block; - white-space: nowrap; - transform: translate(0, 100%) rotate(-90deg); - transform-origin: 0 0; - - &::after { - content: ''; - float: left; - margin-top: 100%; - } - } -} - -.lnsXyAnnotationNumberIcon { - border-radius: $euiSize; - min-width: $euiSize; - height: $euiSize; - background-color: currentColor; -} - -.lnsXyAnnotationNumberIcon__text { - font-weight: 500; - font-size: 9px; - letter-spacing: -.5px; - line-height: 11px; -} - -.lnsXyAnnotationIcon_rotate90 { - transform: rotate(45deg); - transform-origin: center; -} diff --git a/x-pack/plugins/lens/public/xy_visualization/annotations/helpers.tsx b/x-pack/plugins/lens/public/xy_visualization/annotations/helpers.tsx index c82228f088e47..8f18450ba5a21 100644 --- a/x-pack/plugins/lens/public/xy_visualization/annotations/helpers.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/annotations/helpers.tsx @@ -8,14 +8,9 @@ import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { layerTypes } from '../../../common'; -import type { - XYDataLayerConfig, - XYAnnotationLayerConfig, - XYLayerConfig, -} from '../../../common/expressions'; import type { FramePublicAPI, Visualization } from '../../types'; import { isHorizontalChart } from '../state_helpers'; -import type { XYState } from '../types'; +import type { XYState, XYDataLayerConfig, XYAnnotationLayerConfig, XYLayerConfig } from '../types'; import { checkScaleOperation, getAnnotationsLayers, diff --git a/x-pack/plugins/lens/public/xy_visualization/axes_configuration.test.ts b/x-pack/plugins/lens/public/xy_visualization/axes_configuration.test.ts index ac3e224663ce4..a733f83b46338 100644 --- a/x-pack/plugins/lens/public/xy_visualization/axes_configuration.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/axes_configuration.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DataLayerArgs } from '../../common/expressions'; +import { DataLayerConfigResult } from '../../../../../src/plugins/chart_expressions/expression_xy/common'; import { layerTypes } from '../../common'; import { Datatable } from '../../../../../src/plugins/expressions/public'; import { getAxesConfiguration } from './axes_configuration'; @@ -219,7 +219,8 @@ describe('axes_configuration', () => { }, }; - const sampleLayer: DataLayerArgs = { + const sampleLayer: DataLayerConfigResult = { + type: 'dataLayer', layerId: 'first', layerType: layerTypes.DATA, seriesType: 'line', @@ -271,7 +272,12 @@ describe('axes_configuration', () => { it('should map right series to right axis', () => { const formatFactory = jest.fn(); const groups = getAxesConfiguration( - [{ ...sampleLayer, yConfig: [{ forAccessor: 'yAccessorId', axisMode: 'right' }] }], + [ + { + ...sampleLayer, + yConfig: [{ forAccessor: 'yAccessorId', axisMode: 'right' }], + }, + ], false, tables, formatFactory diff --git a/x-pack/plugins/lens/public/xy_visualization/axes_configuration.ts b/x-pack/plugins/lens/public/xy_visualization/axes_configuration.ts index 7adc803f31e9f..b9b2c2ae86e42 100644 --- a/x-pack/plugins/lens/public/xy_visualization/axes_configuration.ts +++ b/x-pack/plugins/lens/public/xy_visualization/axes_configuration.ts @@ -6,12 +6,13 @@ */ import { FormatFactory } from '../../common'; -import { AxisExtentConfig, XYDataLayerConfig } from '../../common/expressions'; +import { AxisExtentConfig } from '../../../../../src/plugins/chart_expressions/expression_xy/common'; import { Datatable } from '../../../../../src/plugins/expressions/public'; import type { IFieldFormat, SerializedFieldFormat, } from '../../../../../src/plugins/field_formats/common'; +import { XYDataLayerConfig } from './types'; interface FormattedMetric { layer: string; diff --git a/x-pack/plugins/lens/public/xy_visualization/color_assignment.test.ts b/x-pack/plugins/lens/public/xy_visualization/color_assignment.test.ts index 9b29401d72a95..a329c12b083a5 100644 --- a/x-pack/plugins/lens/public/xy_visualization/color_assignment.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/color_assignment.test.ts @@ -7,15 +7,12 @@ import { getColorAssignments } from './color_assignment'; import type { FormatFactory, LensMultiTable } from '../../common'; -import type { DataLayerArgs } from '../../common/expressions'; import { layerTypes } from '../../common'; +import { XYDataLayerConfig } from './types'; describe('color_assignment', () => { - const layers: DataLayerArgs[] = [ + const layers: XYDataLayerConfig[] = [ { - yScaleType: 'linear', - xScaleType: 'linear', - isHistogram: true, seriesType: 'bar', palette: { type: 'palette', name: 'palette1' }, layerId: '1', @@ -24,9 +21,6 @@ describe('color_assignment', () => { accessors: ['y1', 'y2'], }, { - yScaleType: 'linear', - xScaleType: 'linear', - isHistogram: true, seriesType: 'bar', palette: { type: 'palette', name: 'palette2' }, layerId: '2', diff --git a/x-pack/plugins/lens/public/xy_visualization/color_assignment.ts b/x-pack/plugins/lens/public/xy_visualization/color_assignment.ts index f8d5805279a2e..ed1b7f0244c89 100644 --- a/x-pack/plugins/lens/public/xy_visualization/color_assignment.ts +++ b/x-pack/plugins/lens/public/xy_visualization/color_assignment.ts @@ -11,46 +11,40 @@ import type { Datatable } from 'src/plugins/expressions'; import { euiLightVars } from '@kbn/ui-theme'; import type { AccessorConfig, FramePublicAPI } from '../types'; import { getColumnToLabelMap } from './state_helpers'; -import { FormatFactory, LayerType } from '../../common'; -import type { XYLayerConfig } from '../../common/expressions'; -import { isReferenceLayer, isAnnotationsLayer } from './visualization_helpers'; +import { FormatFactory } from '../../common'; +import { isDataLayer, isReferenceLayer, isAnnotationsLayer } from './visualization_helpers'; import { getAnnotationsAccessorColorConfig } from './annotations/helpers'; import { getReferenceLineAccessorColorConfig } from './reference_line_helpers'; +import { XYDataLayerConfig, XYLayerConfig } from './types'; const isPrimitive = (value: unknown): boolean => value != null && typeof value !== 'object'; -interface LayerColorConfig { - palette?: PaletteOutput; - splitAccessor?: string; - accessors: string[]; - layerId: string; - layerType: LayerType; -} - export const defaultReferenceLineColor = euiLightVars.euiColorDarkShade; export type ColorAssignments = Record< string, { totalSeriesCount: number; - getRank(sortedLayer: LayerColorConfig, seriesKey: string, yAccessor: string): number; + getRank(sortedLayer: XYDataLayerConfig, seriesKey: string, yAccessor: string): number; } >; export function getColorAssignments( - layers: LayerColorConfig[], + layers: XYLayerConfig[], data: { tables: Record }, formatFactory: FormatFactory ): ColorAssignments { - const layersPerPalette: Record = {}; + const layersPerPalette: Record = {}; - layers.forEach((layer) => { - const palette = layer.palette?.name || 'default'; - if (!layersPerPalette[palette]) { - layersPerPalette[palette] = []; - } - layersPerPalette[palette].push(layer); - }); + layers + .filter((layer): layer is XYDataLayerConfig => isDataLayer(layer)) + .forEach((layer) => { + const palette = layer.palette?.name || 'default'; + if (!layersPerPalette[palette]) { + layersPerPalette[palette] = []; + } + layersPerPalette[palette].push(layer); + }); return mapValues(layersPerPalette, (paletteLayers) => { const seriesPerLayer = paletteLayers.map((layer, layerIndex) => { @@ -82,7 +76,7 @@ export function getColorAssignments( ); return { totalSeriesCount, - getRank(sortedLayer: LayerColorConfig, seriesKey: string, yAccessor: string) { + getRank(sortedLayer: XYDataLayerConfig, seriesKey: string, yAccessor: string) { const layerIndex = paletteLayers.findIndex((l) => sortedLayer.layerId === l.layerId); const currentSeriesPerLayer = seriesPerLayer[layerIndex]; const splitRank = currentSeriesPerLayer.splits.indexOf(seriesKey); @@ -125,6 +119,7 @@ export function getAccessorColorConfig( triggerIcon: 'disabled', }; } + const columnToLabel = getColumnToLabelMap(layer, frame.datasourceLayers[layer.layerId]); const rank = colorAssignments[currentPalette.name].getRank( layer, diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.scss b/x-pack/plugins/lens/public/xy_visualization/expression.scss deleted file mode 100644 index 68f5e9863d2bb..0000000000000 --- a/x-pack/plugins/lens/public/xy_visualization/expression.scss +++ /dev/null @@ -1,15 +0,0 @@ -.lnsXyExpression__container { - height: 100%; - width: 100%; - // the FocusTrap is adding extra divs which are making the visualization redraw twice - // with a visible glitch. This make the chart library resilient to this extra reflow - overflow-x: hidden; -} - -.lnsChart__empty { - height: 100%; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx b/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx deleted file mode 100644 index 36e1155750ef0..0000000000000 --- a/x-pack/plugins/lens/public/xy_visualization/expression.test.tsx +++ /dev/null @@ -1,3167 +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 { - AreaSeries, - Axis, - BarSeries, - Position, - LineSeries, - Settings, - ScaleType, - GeometryValue, - XYChartSeriesIdentifier, - SeriesNameFn, - Fit, - HorizontalAlignment, - VerticalAlignment, - LayoutDirection, - LineAnnotation, -} from '@elastic/charts'; -import { PaletteOutput } from 'src/plugins/charts/public'; -import { calculateMinInterval, XYChart, XYChartRenderProps } from './expression'; -import type { LensMultiTable } from '../../common'; -import { layerTypes } from '../../common'; -import { AnnotationLayerArgs, xyChart } from '../../common/expressions'; -import { - dataLayerConfig, - legendConfig, - tickLabelsConfig, - gridlinesConfig, - XYArgs, - LegendConfig, - DataLayerArgs, - AxesSettingsConfig, - XYChartProps, - labelsOrientationConfig, - LabelsOrientationConfig, -} from '../../common/expressions'; -import { Datatable, DatatableRow } from '../../../../../src/plugins/expressions/public'; -import React from 'react'; -import { mount, shallow } from 'enzyme'; -import { createMockExecutionContext } from '../../../../../src/plugins/expressions/common/mocks'; -import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks'; -import { EmptyPlaceholder } from '../../../../../src/plugins/charts/public'; -import { XyEndzones } from './x_domain'; -import { eventAnnotationServiceMock } from '../../../../../src/plugins/event_annotation/public/mocks'; -import { EventAnnotationOutput } from 'src/plugins/event_annotation/common'; - -const onClickValue = jest.fn(); -const onSelectRange = jest.fn(); - -const chartSetupContract = chartPluginMock.createSetupContract(); -const chartStartContract = chartPluginMock.createStartContract(); - -const chartsThemeService = chartSetupContract.theme; -const chartsActiveCursorService = chartStartContract.activeCursor; - -const paletteService = chartPluginMock.createPaletteRegistry(); - -const mockPaletteOutput: PaletteOutput = { - type: 'palette', - name: 'mock', - params: {}, -}; - -const dateHistogramData: LensMultiTable = { - type: 'lens_multitable', - tables: { - timeLayer: { - type: 'datatable', - rows: [ - { - xAccessorId: 1585758120000, - splitAccessorId: "Men's Clothing", - yAccessorId: 1, - }, - { - xAccessorId: 1585758360000, - splitAccessorId: "Women's Accessories", - yAccessorId: 1, - }, - { - xAccessorId: 1585758360000, - splitAccessorId: "Women's Clothing", - yAccessorId: 1, - }, - { - xAccessorId: 1585759380000, - splitAccessorId: "Men's Clothing", - yAccessorId: 1, - }, - { - xAccessorId: 1585759380000, - splitAccessorId: "Men's Shoes", - yAccessorId: 1, - }, - { - xAccessorId: 1585759380000, - splitAccessorId: "Women's Clothing", - yAccessorId: 1, - }, - { - xAccessorId: 1585760700000, - splitAccessorId: "Men's Clothing", - yAccessorId: 1, - }, - { - xAccessorId: 1585760760000, - splitAccessorId: "Men's Clothing", - yAccessorId: 1, - }, - { - xAccessorId: 1585760760000, - splitAccessorId: "Men's Shoes", - yAccessorId: 1, - }, - { - xAccessorId: 1585761120000, - splitAccessorId: "Men's Shoes", - yAccessorId: 1, - }, - ], - columns: [ - { - id: 'xAccessorId', - name: 'order_date per minute', - meta: { - type: 'date', - field: 'order_date', - source: 'esaggs', - index: 'indexPatternId', - sourceParams: { - indexPatternId: 'indexPatternId', - type: 'date_histogram', - appliedTimeRange: { - from: '2020-04-01T16:14:16.246Z', - to: '2020-04-01T17:15:41.263Z', - }, - params: { - field: 'order_date', - timeRange: { from: '2020-04-01T16:14:16.246Z', to: '2020-04-01T17:15:41.263Z' }, - useNormalizedEsInterval: true, - scaleMetricValues: false, - interval: '1m', - drop_partials: false, - min_doc_count: 0, - extended_bounds: {}, - }, - }, - params: { id: 'date', params: { pattern: 'HH:mm' } }, - }, - }, - { - id: 'splitAccessorId', - name: 'Top values of category.keyword', - meta: { - type: 'string', - field: 'category.keyword', - source: 'esaggs', - index: 'indexPatternId', - sourceParams: { - indexPatternId: 'indexPatternId', - type: 'terms', - params: { - field: 'category.keyword', - orderBy: 'yAccessorId', - order: 'desc', - size: 3, - otherBucket: false, - otherBucketLabel: 'Other', - missingBucket: false, - missingBucketLabel: 'Missing', - }, - }, - params: { - id: 'terms', - params: { - id: 'string', - otherBucketLabel: 'Other', - missingBucketLabel: 'Missing', - parsedUrl: { - origin: 'http://localhost:5601', - pathname: '/jiy/app/kibana', - basePath: '/jiy', - }, - }, - }, - }, - }, - { - id: 'yAccessorId', - name: 'Count of records', - meta: { - type: 'number', - source: 'esaggs', - index: 'indexPatternId', - sourceParams: { - indexPatternId: 'indexPatternId', - params: {}, - }, - params: { id: 'number' }, - }, - }, - ], - }, - }, - dateRange: { - fromDate: new Date('2020-04-01T16:14:16.246Z'), - toDate: new Date('2020-04-01T17:15:41.263Z'), - }, -}; - -const dateHistogramLayer: DataLayerArgs = { - layerId: 'timeLayer', - layerType: layerTypes.DATA, - hide: false, - xAccessor: 'xAccessorId', - yScaleType: 'linear', - xScaleType: 'time', - isHistogram: true, - splitAccessor: 'splitAccessorId', - seriesType: 'bar_stacked', - accessors: ['yAccessorId'], - palette: mockPaletteOutput, -}; - -const createSampleDatatableWithRows = (rows: DatatableRow[]): Datatable => ({ - type: 'datatable', - columns: [ - { - id: 'a', - name: 'a', - meta: { type: 'number', params: { id: 'number', params: { pattern: '0,0.000' } } }, - }, - { - id: 'b', - name: 'b', - meta: { type: 'number', params: { id: 'number', params: { pattern: '000,0' } } }, - }, - { - id: 'c', - name: 'c', - meta: { - type: 'date', - field: 'order_date', - sourceParams: { type: 'date-histogram', params: { interval: 'auto' } }, - params: { id: 'string' }, - }, - }, - { id: 'd', name: 'ColD', meta: { type: 'string' } }, - ], - rows, -}); - -const sampleLayer: DataLayerArgs = { - layerId: 'first', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'c', - accessors: ['a', 'b'], - splitAccessor: 'd', - columnToLabel: '{"a": "Label A", "b": "Label B", "d": "Label D"}', - xScaleType: 'ordinal', - yScaleType: 'linear', - isHistogram: false, - palette: mockPaletteOutput, -}; - -const createArgsWithLayers = (layers: DataLayerArgs[] = [sampleLayer]): XYArgs => ({ - xTitle: '', - yTitle: '', - yRightTitle: '', - legend: { - type: 'lens_xy_legendConfig', - isVisible: false, - position: Position.Top, - }, - valueLabels: 'hide', - valuesInLegend: false, - axisTitlesVisibilitySettings: { - type: 'lens_xy_axisTitlesVisibilityConfig', - x: true, - yLeft: true, - yRight: true, - }, - tickLabelsVisibilitySettings: { - type: 'lens_xy_tickLabelsConfig', - x: true, - yLeft: false, - yRight: false, - }, - labelsOrientation: { - type: 'lens_xy_labelsOrientationConfig', - x: 0, - yLeft: -90, - yRight: -45, - }, - gridlinesVisibilitySettings: { - type: 'lens_xy_gridlinesConfig', - x: true, - yLeft: false, - yRight: false, - }, - yLeftExtent: { - mode: 'full', - type: 'lens_xy_axisExtentConfig', - }, - yRightExtent: { - mode: 'full', - type: 'lens_xy_axisExtentConfig', - }, - layers, -}); - -function sampleArgs() { - const data: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: createSampleDatatableWithRows([ - { a: 1, b: 2, c: 'I', d: 'Foo' }, - { a: 1, b: 5, c: 'J', d: 'Bar' }, - ]), - }, - dateRange: { - fromDate: new Date('2019-01-02T05:00:00.000Z'), - toDate: new Date('2019-01-03T05:00:00.000Z'), - }, - }; - - const args: XYArgs = createArgsWithLayers(); - - return { data, args }; -} - -function sampleArgsWithReferenceLine(value: number = 150) { - const { data, args } = sampleArgs(); - - return { - data: { - ...data, - tables: { - ...data.tables, - referenceLine: { - type: 'datatable', - columns: [ - { - id: 'referenceLine-a', - meta: { params: { id: 'number' }, type: 'number' }, - name: 'Static value', - }, - ], - rows: [{ 'referenceLine-a': value }], - }, - }, - } as LensMultiTable, - args: { - ...args, - layers: [ - ...args.layers, - { - layerType: layerTypes.REFERENCELINE, - accessors: ['referenceLine-a'], - layerId: 'referenceLine', - seriesType: 'line', - xScaleType: 'linear', - yScaleType: 'linear', - palette: mockPaletteOutput, - isHistogram: false, - hide: true, - yConfig: [{ axisMode: 'left', forAccessor: 'referenceLine-a', type: 'lens_xy_yConfig' }], - }, - ], - } as XYArgs, - }; -} - -describe('xy_expression', () => { - describe('configs', () => { - test('legendConfig produces the correct arguments', () => { - const args: LegendConfig = { - isVisible: true, - position: Position.Left, - }; - - const result = legendConfig.fn(null, args, createMockExecutionContext()); - - expect(result).toEqual({ - type: 'lens_xy_legendConfig', - ...args, - }); - }); - - test('dataLayerConfig produces the correct arguments', () => { - const args: DataLayerArgs = { - layerId: 'first', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'c', - accessors: ['a', 'b'], - splitAccessor: 'd', - xScaleType: 'linear', - yScaleType: 'linear', - isHistogram: false, - palette: mockPaletteOutput, - }; - - const result = dataLayerConfig.fn(null, args, createMockExecutionContext()); - - expect(result).toEqual({ - type: 'lens_xy_data_layer', - ...args, - }); - }); - }); - - test('tickLabelsConfig produces the correct arguments', () => { - const args: AxesSettingsConfig = { - x: true, - yLeft: false, - yRight: false, - }; - - const result = tickLabelsConfig.fn(null, args, createMockExecutionContext()); - - expect(result).toEqual({ - type: 'lens_xy_tickLabelsConfig', - ...args, - }); - }); - - test('gridlinesConfig produces the correct arguments', () => { - const args: AxesSettingsConfig = { - x: true, - yLeft: false, - yRight: false, - }; - - const result = gridlinesConfig.fn(null, args, createMockExecutionContext()); - - expect(result).toEqual({ - type: 'lens_xy_gridlinesConfig', - ...args, - }); - }); - - test('labelsOrientationConfig produces the correct arguments', () => { - const args: LabelsOrientationConfig = { - x: 0, - yLeft: -90, - yRight: -45, - }; - - const result = labelsOrientationConfig.fn(null, args, createMockExecutionContext()); - - expect(result).toEqual({ - type: 'lens_xy_labelsOrientationConfig', - ...args, - }); - }); - - describe('xyChart', () => { - test('it renders with the specified data and args', () => { - const { data, args } = sampleArgs(); - const result = xyChart.fn(data, args, createMockExecutionContext()); - - expect(result).toEqual({ - type: 'render', - as: 'lens_xy_chart_renderer', - value: { data, args }, - }); - }); - }); - - describe('XYChart component', () => { - let getFormatSpy: jest.Mock; - let convertSpy: jest.Mock; - let defaultProps: Omit; - - const dataWithoutFormats: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: { - type: 'datatable', - columns: [ - { id: 'a', name: 'a', meta: { type: 'number' } }, - { id: 'b', name: 'b', meta: { type: 'number' } }, - { id: 'c', name: 'c', meta: { type: 'string' } }, - { id: 'd', name: 'd', meta: { type: 'string' } }, - ], - rows: [ - { a: 1, b: 2, c: 'I', d: 'Row 1' }, - { a: 1, b: 5, c: 'J', d: 'Row 2' }, - ], - }, - }, - }; - const dataWithFormats: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: { - type: 'datatable', - columns: [ - { id: 'a', name: 'a', meta: { type: 'number' } }, - { id: 'b', name: 'b', meta: { type: 'number' } }, - { id: 'c', name: 'c', meta: { type: 'string' } }, - { id: 'd', name: 'd', meta: { type: 'string', params: { id: 'custom' } } }, - ], - rows: [ - { a: 1, b: 2, c: 'I', d: 'Row 1' }, - { a: 1, b: 5, c: 'J', d: 'Row 2' }, - ], - }, - }, - }; - - const getRenderedComponent = (data: LensMultiTable, args: XYArgs) => { - return shallow(); - }; - - beforeEach(() => { - convertSpy = jest.fn((x) => x); - getFormatSpy = jest.fn(); - getFormatSpy.mockReturnValue({ convert: convertSpy }); - - defaultProps = { - formatFactory: getFormatSpy, - timeZone: 'UTC', - renderMode: 'view', - chartsThemeService, - chartsActiveCursorService, - paletteService, - minInterval: 50, - onClickValue, - onSelectRange, - syncColors: false, - useLegacyTimeAxis: false, - eventAnnotationService: eventAnnotationServiceMock, - }; - }); - - test('it renders line', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - expect(component).toMatchSnapshot(); - expect(component.find(LineSeries)).toHaveLength(2); - expect(component.find(LineSeries).at(0).prop('yAccessors')).toEqual(['a']); - expect(component.find(LineSeries).at(1).prop('yAccessors')).toEqual(['b']); - }); - - describe('date range', () => { - const timeSampleLayer: DataLayerArgs = { - layerId: 'first', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'c', - accessors: ['a', 'b'], - splitAccessor: 'd', - columnToLabel: '{"a": "Label A", "b": "Label B", "d": "Label D"}', - xScaleType: 'time', - yScaleType: 'linear', - isHistogram: false, - palette: mockPaletteOutput, - }; - const multiLayerArgs = createArgsWithLayers([ - timeSampleLayer, - { - ...timeSampleLayer, - layerId: 'second', - seriesType: 'bar', - xScaleType: 'time', - }, - ]); - test('it uses the full date range', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - c.id !== 'c' - ? c - : { - ...c, - meta: { - type: 'date', - source: 'esaggs', - sourceParams: { - type: 'date_histogram', - params: {}, - appliedTimeRange: { - from: '2019-01-02T05:00:00.000Z', - to: '2019-01-03T05:00:00.000Z', - }, - }, - }, - } - ), - }, - }, - }} - args={{ - ...args, - layers: [ - { ...(args.layers[0] as DataLayerArgs), seriesType: 'line', xScaleType: 'time' }, - ], - }} - minInterval={undefined} - /> - ); - expect(component.find(Settings).prop('xDomain')).toMatchInlineSnapshot(` - Object { - "max": 1546491600000, - "min": 1546405200000, - "minInterval": undefined, - } - `); - }); - - test('it uses passed in minInterval', () => { - const data: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: createSampleDatatableWithRows([{ a: 1, b: 2, c: 'I', d: 'Foo' }]), - second: createSampleDatatableWithRows([]), - }, - }; - - const component = shallow(); - - // real auto interval is 30mins = 1800000 - expect(component.find(Settings).prop('xDomain')).toMatchInlineSnapshot(` - Object { - "max": NaN, - "min": NaN, - "minInterval": 50, - } - `); - }); - - describe('axis time', () => { - const defaultTimeLayer: DataLayerArgs = { - layerId: 'first', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'c', - accessors: ['a', 'b'], - splitAccessor: 'd', - columnToLabel: '{"a": "Label A", "b": "Label B", "d": "Label D"}', - xScaleType: 'time', - yScaleType: 'linear', - isHistogram: true, - palette: mockPaletteOutput, - }; - test('it should disable the new time axis for a line time layer when isHistogram is set to false', () => { - const { data } = sampleArgs(); - - const instance = shallow( - - ); - - const axisStyle = instance.find(Axis).first().prop('timeAxisLayerCount'); - - expect(axisStyle).toBe(0); - }); - test('it should enable the new time axis for a line time layer when isHistogram is set to true', () => { - const { data } = sampleArgs(); - const timeLayerArgs = createArgsWithLayers([defaultTimeLayer]); - - const instance = shallow( - - ); - - const axisStyle = instance.find(Axis).first().prop('timeAxisLayerCount'); - - expect(axisStyle).toBe(3); - }); - test('it should disable the new time axis for a vertical bar with break down dimension', () => { - const { data } = sampleArgs(); - const timeLayer: DataLayerArgs = { - ...defaultTimeLayer, - seriesType: 'bar', - }; - const timeLayerArgs = createArgsWithLayers([timeLayer]); - - const instance = shallow( - - ); - - const axisStyle = instance.find(Axis).first().prop('timeAxisLayerCount'); - - expect(axisStyle).toBe(0); - }); - - test('it should enable the new time axis for a stacked vertical bar with break down dimension', () => { - const { data } = sampleArgs(); - const timeLayer: DataLayerArgs = { - ...defaultTimeLayer, - seriesType: 'bar_stacked', - }; - const timeLayerArgs = createArgsWithLayers([timeLayer]); - - const instance = shallow( - - ); - - const axisStyle = instance.find(Axis).first().prop('timeAxisLayerCount'); - - expect(axisStyle).toBe(3); - }); - }); - describe('endzones', () => { - const { args } = sampleArgs(); - const table = createSampleDatatableWithRows([ - { a: 1, b: 2, c: new Date('2021-04-22').valueOf(), d: 'Foo' }, - { a: 1, b: 2, c: new Date('2021-04-23').valueOf(), d: 'Foo' }, - { a: 1, b: 2, c: new Date('2021-04-24').valueOf(), d: 'Foo' }, - ]); - const data: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: { - ...table, - columns: table.columns.map((c) => - c.id !== 'c' - ? c - : { - ...c, - meta: { - type: 'date', - source: 'esaggs', - sourceParams: { - type: 'date_histogram', - params: {}, - appliedTimeRange: { - from: '2021-04-22T12:00:00.000Z', - to: '2021-04-24T12:00:00.000Z', - }, - }, - }, - } - ), - }, - }, - dateRange: { - // first and last bucket are partial - fromDate: new Date('2021-04-22T12:00:00.000Z'), - toDate: new Date('2021-04-24T12:00:00.000Z'), - }, - }; - const timeArgs: XYArgs = { - ...args, - layers: [ - { - ...(args.layers[0] as DataLayerArgs), - seriesType: 'line', - xScaleType: 'time', - isHistogram: true, - splitAccessor: undefined, - }, - ], - }; - - test('it extends interval if data is exceeding it', () => { - const component = shallow( - - ); - - expect(component.find(Settings).prop('xDomain')).toEqual({ - // shortened to 24th midnight (elastic-charts automatically adds one min interval) - max: new Date('2021-04-24').valueOf(), - // extended to 22nd midnight because of first bucket - min: new Date('2021-04-22').valueOf(), - minInterval: 24 * 60 * 60 * 1000, - }); - }); - - test('it renders endzone component bridging gap between domain and extended domain', () => { - const component = shallow( - - ); - - expect(component.find(XyEndzones).dive().find('Endzones').props()).toEqual( - expect.objectContaining({ - domainStart: new Date('2021-04-22T12:00:00.000Z').valueOf(), - domainEnd: new Date('2021-04-24T12:00:00.000Z').valueOf(), - domainMin: new Date('2021-04-22').valueOf(), - domainMax: new Date('2021-04-24').valueOf(), - }) - ); - }); - - test('should pass enabled histogram mode and min interval to endzones component', () => { - const component = shallow( - - ); - - expect(component.find(XyEndzones).dive().find('Endzones').props()).toEqual( - expect.objectContaining({ - interval: 24 * 60 * 60 * 1000, - isFullBin: false, - }) - ); - }); - - test('should pass disabled histogram mode and min interval to endzones component', () => { - const component = shallow( - - ); - - expect(component.find(XyEndzones).dive().find('Endzones').props()).toEqual( - expect.objectContaining({ - interval: 24 * 60 * 60 * 1000, - isFullBin: true, - }) - ); - }); - - test('it does not render endzones if disabled via settings', () => { - const component = shallow( - - ); - - expect(component.find(XyEndzones).length).toEqual(0); - }); - }); - }); - - describe('y axis extents', () => { - test('it passes custom y axis extents to elastic-charts axis spec', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ - fit: false, - min: 123, - max: 456, - }); - }); - - test('it passes fit to bounds y axis extents to elastic-charts axis spec', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ - fit: true, - min: NaN, - max: NaN, - }); - }); - - test('it does not allow fit for area chart', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ - fit: false, - min: NaN, - max: NaN, - }); - }); - - test('it does not allow positive lower bound for bar', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ - fit: false, - min: NaN, - max: NaN, - }); - }); - - test('it does include referenceLine values when in full extent mode', () => { - const { data, args } = sampleArgsWithReferenceLine(); - - const component = shallow(); - expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ - fit: false, - min: 0, - max: 150, - }); - }); - - test('it should ignore referenceLine values when set to custom extents', () => { - const { data, args } = sampleArgsWithReferenceLine(); - - const component = shallow( - - ); - expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ - fit: false, - min: 123, - max: 456, - }); - }); - - test('it should work for negative values in referenceLines', () => { - const { data, args } = sampleArgsWithReferenceLine(-150); - - const component = shallow(); - expect(component.find(Axis).find('[id="left"]').prop('domain')).toEqual({ - fit: false, - min: -150, - max: 5, - }); - }); - }); - - test('it has xDomain undefined if the x is not a time scale or a histogram', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - const xDomain = component.find(Settings).prop('xDomain'); - expect(xDomain).toEqual(undefined); - }); - - test('it uses min interval if interval is passed in and visualization is histogram', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - expect(component.find(Settings).prop('xDomain')).toEqual({ - minInterval: 101, - min: NaN, - max: NaN, - }); - }); - - test('disabled legend extra by default', () => { - const { data, args } = sampleArgs(); - const component = shallow(); - expect(component.find(Settings).at(0).prop('showLegendExtra')).toEqual(false); - }); - - test('ignores legend extra for ordinal chart', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component.find(Settings).at(0).prop('showLegendExtra')).toEqual(false); - }); - - test('shows legend extra for histogram chart', () => { - const { args } = sampleArgs(); - const component = shallow( - - ); - expect(component.find(Settings).at(0).prop('showLegendExtra')).toEqual(true); - }); - - test('it renders bar', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component).toMatchSnapshot(); - expect(component.find(BarSeries)).toHaveLength(2); - expect(component.find(BarSeries).at(0).prop('yAccessors')).toEqual(['a']); - expect(component.find(BarSeries).at(1).prop('yAccessors')).toEqual(['b']); - }); - - test('it renders area', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component).toMatchSnapshot(); - expect(component.find(AreaSeries)).toHaveLength(2); - expect(component.find(AreaSeries).at(0).prop('yAccessors')).toEqual(['a']); - expect(component.find(AreaSeries).at(1).prop('yAccessors')).toEqual(['b']); - }); - - test('it renders horizontal bar', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component).toMatchSnapshot(); - expect(component.find(BarSeries)).toHaveLength(2); - expect(component.find(BarSeries).at(0).prop('yAccessors')).toEqual(['a']); - expect(component.find(BarSeries).at(1).prop('yAccessors')).toEqual(['b']); - expect(component.find(Settings).prop('rotation')).toEqual(90); - }); - - test('it renders regular bar empty placeholder for no results', () => { - const { data, args } = sampleArgs(); - - // send empty data to the chart - data.tables.first.rows = []; - - const component = shallow(); - - expect(component.find(BarSeries)).toHaveLength(0); - expect(component.find(EmptyPlaceholder).prop('icon')).toBeDefined(); - }); - - test('onBrushEnd returns correct context data for date histogram data', () => { - const { args } = sampleArgs(); - - const wrapper = mountWithIntl( - - ); - wrapper.find(Settings).first().prop('onBrushEnd')!({ x: [1585757732783, 1585758880838] }); - - expect(onSelectRange).toHaveBeenCalledWith({ - column: 0, - table: dateHistogramData.tables.timeLayer, - range: [1585757732783, 1585758880838], - }); - }); - - test('onBrushEnd returns correct context data for number histogram data', () => { - const { args } = sampleArgs(); - - const numberLayer: DataLayerArgs = { - layerId: 'numberLayer', - layerType: layerTypes.DATA, - hide: false, - xAccessor: 'xAccessorId', - yScaleType: 'linear', - xScaleType: 'linear', - isHistogram: true, - seriesType: 'bar_stacked', - accessors: ['yAccessorId'], - palette: mockPaletteOutput, - }; - - const numberHistogramData: LensMultiTable = { - type: 'lens_multitable', - tables: { - numberLayer: { - type: 'datatable', - rows: [ - { - xAccessorId: 5, - yAccessorId: 1, - }, - { - xAccessorId: 7, - yAccessorId: 1, - }, - { - xAccessorId: 8, - yAccessorId: 1, - }, - { - xAccessorId: 10, - yAccessorId: 1, - }, - ], - columns: [ - { - id: 'xAccessorId', - name: 'bytes', - meta: { type: 'number' }, - }, - { - id: 'yAccessorId', - name: 'Count of records', - meta: { type: 'number' }, - }, - ], - }, - }, - dateRange: { - fromDate: new Date('2020-04-01T16:14:16.246Z'), - toDate: new Date('2020-04-01T17:15:41.263Z'), - }, - }; - - const wrapper = mountWithIntl( - - ); - - wrapper.find(Settings).first().prop('onBrushEnd')!({ x: [5, 8] }); - - expect(onSelectRange).toHaveBeenCalledWith({ - column: 0, - table: numberHistogramData.tables.numberLayer, - range: [5, 8], - }); - }); - - test('onBrushEnd is not set on non-interactive mode', () => { - const { args, data } = sampleArgs(); - - const wrapper = mountWithIntl( - - ); - - expect(wrapper.find(Settings).first().prop('onBrushEnd')).toBeUndefined(); - }); - - test('allowBrushingLastHistogramBin is true for date histogram data', () => { - const { args } = sampleArgs(); - - const wrapper = mountWithIntl( - - ); - expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBin')).toEqual(true); - }); - - test('onElementClick returns correct context data', () => { - const geometry: GeometryValue = { x: 5, y: 1, accessor: 'y1', mark: null, datum: {} }; - const series = { - key: 'spec{d}yAccessor{d}splitAccessors{b-2}', - specId: 'd', - yAccessor: 'd', - splitAccessors: {}, - seriesKeys: [2, 'd'], - }; - - const { args, data } = sampleArgs(); - - const wrapper = mountWithIntl( - - ); - - wrapper.find(Settings).first().prop('onElementClick')!([ - [geometry, series as XYChartSeriesIdentifier], - ]); - - expect(onClickValue).toHaveBeenCalledWith({ - data: [ - { - column: 1, - row: 1, - table: data.tables.first, - value: 5, - }, - { - column: 1, - row: 0, - table: data.tables.first, - value: 2, - }, - ], - }); - }); - - test('onElementClick returns correct context data for date histogram', () => { - const geometry: GeometryValue = { - x: 1585758120000, - y: 1, - accessor: 'y1', - mark: null, - datum: {}, - }; - const series = { - key: 'spec{d}yAccessor{d}splitAccessors{b-2}', - specId: 'd', - yAccessor: 'yAccessorId', - splitAccessors: {}, - seriesKeys: ['yAccessorId'], - }; - - const { args } = sampleArgs(); - - const wrapper = mountWithIntl( - - ); - - wrapper.find(Settings).first().prop('onElementClick')!([ - [geometry, series as XYChartSeriesIdentifier], - ]); - - expect(onClickValue).toHaveBeenCalledWith({ - data: [ - { - column: 0, - row: 0, - table: dateHistogramData.tables.timeLayer, - value: 1585758120000, - }, - ], - }); - }); - - test('onElementClick returns correct context data for numeric histogram', () => { - const { args } = sampleArgs(); - - const numberLayer: DataLayerArgs = { - layerId: 'numberLayer', - layerType: layerTypes.DATA, - hide: false, - xAccessor: 'xAccessorId', - yScaleType: 'linear', - xScaleType: 'linear', - isHistogram: true, - seriesType: 'bar_stacked', - accessors: ['yAccessorId'], - palette: mockPaletteOutput, - }; - - const numberHistogramData: LensMultiTable = { - type: 'lens_multitable', - tables: { - numberLayer: { - type: 'datatable', - rows: [ - { - xAccessorId: 5, - yAccessorId: 1, - }, - { - xAccessorId: 7, - yAccessorId: 1, - }, - { - xAccessorId: 8, - yAccessorId: 1, - }, - { - xAccessorId: 10, - yAccessorId: 1, - }, - ], - columns: [ - { - id: 'xAccessorId', - name: 'bytes', - meta: { type: 'number' }, - }, - { - id: 'yAccessorId', - name: 'Count of records', - meta: { type: 'number' }, - }, - ], - }, - }, - dateRange: { - fromDate: new Date('2020-04-01T16:14:16.246Z'), - toDate: new Date('2020-04-01T17:15:41.263Z'), - }, - }; - const geometry: GeometryValue = { - x: 5, - y: 1, - accessor: 'y1', - mark: null, - datum: {}, - }; - const series = { - key: 'spec{d}yAccessor{d}splitAccessors{b-2}', - specId: 'd', - yAccessor: 'yAccessorId', - splitAccessors: {}, - seriesKeys: ['yAccessorId'], - }; - - const wrapper = mountWithIntl( - - ); - - wrapper.find(Settings).first().prop('onElementClick')!([ - [geometry, series as XYChartSeriesIdentifier], - ]); - - expect(onClickValue).toHaveBeenCalledWith({ - data: [ - { - column: 0, - row: 0, - table: numberHistogramData.tables.numberLayer, - value: 5, - }, - ], - timeFieldName: undefined, - }); - }); - - test('returns correct original data for ordinal x axis with special formatter', () => { - const geometry: GeometryValue = { x: 'BAR', y: 1, accessor: 'y1', mark: null, datum: {} }; - const series = { - key: 'spec{d}yAccessor{d}splitAccessors{b-2}', - specId: 'd', - yAccessor: 'a', - splitAccessors: {}, - seriesKeys: ['a'], - }; - - const { args, data } = sampleArgs(); - - convertSpy.mockImplementation((x) => (typeof x === 'string' ? x.toUpperCase() : x)); - - const wrapper = mountWithIntl( - - ); - - wrapper.find(Settings).first().prop('onElementClick')!([ - [geometry, series as XYChartSeriesIdentifier], - ]); - - expect(onClickValue).toHaveBeenCalledWith({ - data: [ - { - column: 3, - row: 1, - table: data.tables.first, - value: 'Bar', - }, - ], - }); - }); - - test('sets up correct yScaleType equal to binary_linear for bytes formatting', () => { - const { args, data } = sampleArgs(); - data.tables.first.columns[0].meta = { - type: 'number', - params: { id: 'bytes', params: { pattern: '0,0.00b' } }, - }; - - const wrapper = mountWithIntl( - - ); - - expect(wrapper.find(LineSeries).at(0).prop('yScaleType')).toEqual('linear_binary'); - }); - - test('allowBrushingLastHistogramBin should be fakse for ordinal data', () => { - const { args, data } = sampleArgs(); - - const wrapper = mountWithIntl( - - ); - - expect(wrapper.find(Settings).at(0).prop('allowBrushingLastHistogramBin')).toEqual(false); - }); - - test('onElementClick is not triggering event on non-interactive mode', () => { - const { args, data } = sampleArgs(); - - const wrapper = mountWithIntl( - - ); - - expect(wrapper.find(Settings).first().prop('onElementClick')).toBeUndefined(); - }); - - test('legendAction is not triggering event on non-interactive mode', () => { - const { args, data } = sampleArgs(); - - const wrapper = mountWithIntl( - - ); - - expect(wrapper.find(Settings).first().prop('legendAction')).toBeUndefined(); - }); - - test('it renders stacked bar', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component).toMatchSnapshot(); - expect(component.find(BarSeries)).toHaveLength(2); - expect(component.find(BarSeries).at(0).prop('stackAccessors')).toHaveLength(1); - expect(component.find(BarSeries).at(1).prop('stackAccessors')).toHaveLength(1); - }); - - test('it renders stacked area', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component).toMatchSnapshot(); - expect(component.find(AreaSeries)).toHaveLength(2); - expect(component.find(AreaSeries).at(0).prop('stackAccessors')).toHaveLength(1); - expect(component.find(AreaSeries).at(1).prop('stackAccessors')).toHaveLength(1); - }); - - test('it renders stacked horizontal bar', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component).toMatchSnapshot(); - expect(component.find(BarSeries)).toHaveLength(2); - expect(component.find(BarSeries).at(0).prop('stackAccessors')).toHaveLength(1); - expect(component.find(BarSeries).at(1).prop('stackAccessors')).toHaveLength(1); - expect(component.find(Settings).prop('rotation')).toEqual(90); - }); - - test('it renders stacked bar empty placeholder for no results', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - - expect(component.find(BarSeries)).toHaveLength(0); - expect(component.find(EmptyPlaceholder).prop('icon')).toBeDefined(); - }); - - test('it passes time zone to the series', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component.find(LineSeries).at(0).prop('timeZone')).toEqual('CEST'); - expect(component.find(LineSeries).at(1).prop('timeZone')).toEqual('CEST'); - }); - - test('it applies histogram mode to the series for single series', () => { - const { data, args } = sampleArgs(); - const firstLayer: DataLayerArgs = { - ...args.layers[0], - accessors: ['b'], - seriesType: 'bar', - isHistogram: true, - } as DataLayerArgs; - delete firstLayer.splitAccessor; - const component = shallow( - - ); - expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(true); - }); - - test('it does not apply histogram mode to more than one bar series for unstacked bar chart', () => { - const { data, args } = sampleArgs(); - const firstLayer: DataLayerArgs = { - ...args.layers[0], - seriesType: 'bar', - isHistogram: true, - } as DataLayerArgs; - delete firstLayer.splitAccessor; - const component = shallow( - - ); - expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(false); - expect(component.find(BarSeries).at(1).prop('enableHistogramMode')).toEqual(false); - }); - - test('it applies histogram mode to more than one the series for unstacked line/area chart', () => { - const { data, args } = sampleArgs(); - const firstLayer: DataLayerArgs = { - ...args.layers[0], - seriesType: 'line', - isHistogram: true, - } as DataLayerArgs; - delete firstLayer.splitAccessor; - const secondLayer: DataLayerArgs = { - ...args.layers[0], - seriesType: 'line', - isHistogram: true, - } as DataLayerArgs; - delete secondLayer.splitAccessor; - const component = shallow( - - ); - expect(component.find(LineSeries).at(0).prop('enableHistogramMode')).toEqual(true); - expect(component.find(LineSeries).at(1).prop('enableHistogramMode')).toEqual(true); - }); - - test('it applies histogram mode to the series for stacked series', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(true); - expect(component.find(BarSeries).at(1).prop('enableHistogramMode')).toEqual(true); - }); - - test('it does not apply histogram mode for splitted series', () => { - const { data, args } = sampleArgs(); - const component = shallow( - - ); - expect(component.find(BarSeries).at(0).prop('enableHistogramMode')).toEqual(false); - expect(component.find(BarSeries).at(1).prop('enableHistogramMode')).toEqual(false); - }); - - describe('y axes', () => { - test('single axis if possible', () => { - const args = createArgsWithLayers(); - - const component = getRenderedComponent(dataWithoutFormats, args); - const axes = component.find(Axis); - expect(axes).toHaveLength(2); - }); - - test('multiple axes because of config', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a', 'b'], - yConfig: [ - { - forAccessor: 'a', - axisMode: 'left', - }, - { - forAccessor: 'b', - axisMode: 'right', - }, - ], - }, - ], - } as XYArgs; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - const axes = component.find(Axis); - expect(axes).toHaveLength(3); - expect(component.find(LineSeries).at(0).prop('groupId')).toEqual( - axes.at(1).prop('groupId') - ); - expect(component.find(LineSeries).at(1).prop('groupId')).toEqual( - axes.at(2).prop('groupId') - ); - }); - - test('multiple axes because of incompatible formatters', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['c', 'd'], - }, - ], - } as XYArgs; - - const component = getRenderedComponent(dataWithFormats, newArgs); - const axes = component.find(Axis); - expect(axes).toHaveLength(3); - expect(component.find(LineSeries).at(0).prop('groupId')).toEqual( - axes.at(1).prop('groupId') - ); - expect(component.find(LineSeries).at(1).prop('groupId')).toEqual( - axes.at(2).prop('groupId') - ); - }); - - test('single axis despite different formatters if enforced', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['c', 'd'], - yConfig: [ - { - forAccessor: 'c', - axisMode: 'left', - }, - { - forAccessor: 'd', - axisMode: 'left', - }, - ], - }, - ], - } as XYArgs; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - const axes = component.find(Axis); - expect(axes).toHaveLength(2); - }); - }); - - describe('y series coloring', () => { - test('color is applied to chart for multiple series', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - splitAccessor: undefined, - accessors: ['a', 'b'], - yConfig: [ - { - forAccessor: 'a', - color: '#550000', - }, - { - forAccessor: 'b', - color: '#FFFF00', - }, - ], - }, - { - ...args.layers[0], - splitAccessor: undefined, - accessors: ['c'], - yConfig: [ - { - forAccessor: 'c', - color: '#FEECDF', - }, - ], - }, - ], - } as XYArgs; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - expect( - (component.find(LineSeries).at(0).prop('color') as Function)!({ - yAccessor: 'a', - seriesKeys: ['a'], - }) - ).toEqual('#550000'); - expect( - (component.find(LineSeries).at(1).prop('color') as Function)!({ - yAccessor: 'b', - seriesKeys: ['b'], - }) - ).toEqual('#FFFF00'); - expect( - (component.find(LineSeries).at(2).prop('color') as Function)!({ - yAccessor: 'c', - seriesKeys: ['c'], - }) - ).toEqual('#FEECDF'); - }); - test('color is not applied to chart when splitAccessor is defined or when yConfig is not configured', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a'], - yConfig: [ - { - forAccessor: 'a', - color: '#550000', - }, - ], - }, - { - ...args.layers[0], - splitAccessor: undefined, - accessors: ['c'], - }, - ], - } as XYArgs; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - expect( - (component.find(LineSeries).at(0).prop('color') as Function)!({ - yAccessor: 'a', - seriesKeys: ['a'], - }) - ).toEqual('blue'); - expect( - (component.find(LineSeries).at(1).prop('color') as Function)!({ - yAccessor: 'c', - seriesKeys: ['c'], - }) - ).toEqual('blue'); - }); - }); - - describe('provides correct series naming', () => { - const nameFnArgs = { - seriesKeys: [], - key: '', - specId: 'a', - yAccessor: '', - splitAccessors: new Map(), - }; - - test('simplest xy chart without human-readable name', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a'], - splitAccessor: undefined, - columnToLabel: '', - }, - ], - }; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; - - // In this case, the ID is used as the name. This shouldn't happen in practice - expect(nameFn({ ...nameFnArgs, seriesKeys: ['a'] }, false)).toEqual(''); - expect(nameFn({ ...nameFnArgs, seriesKeys: ['nonsense'] }, false)).toEqual(''); - }); - - test('simplest xy chart with empty name', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a'], - splitAccessor: undefined, - columnToLabel: '{"a":""}', - }, - ], - }; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; - - // In this case, the ID is used as the name. This shouldn't happen in practice - expect(nameFn({ ...nameFnArgs, seriesKeys: ['a'] }, false)).toEqual(''); - expect(nameFn({ ...nameFnArgs, seriesKeys: ['nonsense'] }, false)).toEqual(''); - }); - - test('simplest xy chart with human-readable name', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a'], - splitAccessor: undefined, - columnToLabel: '{"a":"Column A"}', - }, - ], - }; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; - - expect(nameFn({ ...nameFnArgs, seriesKeys: ['a'] }, false)).toEqual('Column A'); - }); - - test('multiple y accessors', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a', 'b'], - splitAccessor: undefined, - columnToLabel: '{"a": "Label A"}', - }, - ], - }; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - const nameFn1 = component.find(LineSeries).at(0).prop('name') as SeriesNameFn; - const nameFn2 = component.find(LineSeries).at(1).prop('name') as SeriesNameFn; - - // This accessor has a human-readable name - expect(nameFn1({ ...nameFnArgs, seriesKeys: ['a'] }, false)).toEqual('Label A'); - // This accessor does not - expect(nameFn2({ ...nameFnArgs, seriesKeys: ['b'] }, false)).toEqual(''); - expect(nameFn1({ ...nameFnArgs, seriesKeys: ['nonsense'] }, false)).toEqual(''); - }); - - test('split series without formatting and single y accessor', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a'], - splitAccessor: 'd', - columnToLabel: '{"a": "Label A"}', - }, - ], - }; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; - - expect(nameFn({ ...nameFnArgs, seriesKeys: ['split1', 'a'] }, false)).toEqual('split1'); - }); - - test('split series with formatting and single y accessor', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a'], - splitAccessor: 'd', - columnToLabel: '{"a": "Label A"}', - }, - ], - }; - - const component = getRenderedComponent(dataWithFormats, newArgs); - const nameFn = component.find(LineSeries).prop('name') as SeriesNameFn; - - convertSpy.mockReturnValueOnce('formatted'); - expect(nameFn({ ...nameFnArgs, seriesKeys: ['split1', 'a'] }, false)).toEqual('formatted'); - expect(getFormatSpy).toHaveBeenCalledWith({ id: 'custom' }); - }); - - test('split series without formatting with multiple y accessors', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a', 'b'], - splitAccessor: 'd', - columnToLabel: '{"a": "Label A","b": "Label B"}', - }, - ], - }; - - const component = getRenderedComponent(dataWithoutFormats, newArgs); - const nameFn1 = component.find(LineSeries).at(0).prop('name') as SeriesNameFn; - const nameFn2 = component.find(LineSeries).at(0).prop('name') as SeriesNameFn; - - expect(nameFn1({ ...nameFnArgs, seriesKeys: ['split1', 'a'] }, false)).toEqual( - 'split1 - Label A' - ); - expect(nameFn2({ ...nameFnArgs, seriesKeys: ['split1', 'b'] }, false)).toEqual( - 'split1 - Label B' - ); - }); - - test('split series with formatting with multiple y accessors', () => { - const args = createArgsWithLayers(); - const newArgs = { - ...args, - layers: [ - { - ...args.layers[0], - accessors: ['a', 'b'], - splitAccessor: 'd', - columnToLabel: '{"a": "Label A","b": "Label B"}', - }, - ], - }; - - const component = getRenderedComponent(dataWithFormats, newArgs); - const nameFn1 = component.find(LineSeries).at(0).prop('name') as SeriesNameFn; - const nameFn2 = component.find(LineSeries).at(1).prop('name') as SeriesNameFn; - - convertSpy.mockReturnValueOnce('formatted1').mockReturnValueOnce('formatted2'); - expect(nameFn1({ ...nameFnArgs, seriesKeys: ['split1', 'a'] }, false)).toEqual( - 'formatted1 - Label A' - ); - expect(nameFn2({ ...nameFnArgs, seriesKeys: ['split1', 'b'] }, false)).toEqual( - 'formatted2 - Label B' - ); - }); - }); - - test('it set the scale of the x axis according to the args prop', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - expect(component.find(LineSeries).at(0).prop('xScaleType')).toEqual(ScaleType.Ordinal); - expect(component.find(LineSeries).at(1).prop('xScaleType')).toEqual(ScaleType.Ordinal); - }); - - test('it set the scale of the y axis according to the args prop', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - expect(component.find(LineSeries).at(0).prop('yScaleType')).toEqual(ScaleType.Sqrt); - expect(component.find(LineSeries).at(1).prop('yScaleType')).toEqual(ScaleType.Sqrt); - }); - - test('it gets the formatter for the x axis', () => { - const { data, args } = sampleArgs(); - - shallow(); - - expect(getFormatSpy).toHaveBeenCalledWith({ id: 'string' }); - }); - - test('it gets the formatter for the y axis if there is only one accessor', () => { - const { data, args } = sampleArgs(); - - shallow( - - ); - expect(getFormatSpy).toHaveBeenCalledWith({ - id: 'number', - params: { pattern: '0,0.000' }, - }); - }); - - test('it should pass the formatter function to the axis', () => { - const { data, args } = sampleArgs(); - - const instance = shallow(); - - const tickFormatter = instance.find(Axis).first().prop('tickFormat'); - - if (!tickFormatter) { - throw new Error('tickFormatter prop not found'); - } - - tickFormatter('I'); - - expect(convertSpy).toHaveBeenCalledWith('I'); - }); - - test('it should set the tickLabel visibility on the x axis if the tick labels is hidden', () => { - const { data, args } = sampleArgs(); - - args.tickLabelsVisibilitySettings = { - x: false, - yLeft: true, - yRight: true, - type: 'lens_xy_tickLabelsConfig', - }; - - const instance = shallow(); - - const axisStyle = instance.find(Axis).first().prop('style'); - - expect(axisStyle).toMatchObject({ - tickLabel: { - visible: false, - }, - }); - }); - - test('it should set the tickLabel visibility on the y axis if the tick labels is hidden', () => { - const { data, args } = sampleArgs(); - - args.tickLabelsVisibilitySettings = { - x: true, - yLeft: false, - yRight: false, - type: 'lens_xy_tickLabelsConfig', - }; - - const instance = shallow(); - - const axisStyle = instance.find(Axis).at(1).prop('style'); - - expect(axisStyle).toMatchObject({ - tickLabel: { - visible: false, - }, - }); - }); - - test('it should set the tickLabel visibility on the x axis if the tick labels is shown', () => { - const { data, args } = sampleArgs(); - - args.tickLabelsVisibilitySettings = { - x: true, - yLeft: true, - yRight: true, - type: 'lens_xy_tickLabelsConfig', - }; - - const instance = shallow(); - - const axisStyle = instance.find(Axis).first().prop('style'); - - expect(axisStyle).toMatchObject({ - tickLabel: { - visible: true, - }, - }); - }); - - test('it should set the tickLabel orientation on the x axis', () => { - const { data, args } = sampleArgs(); - - args.labelsOrientation = { - x: -45, - yLeft: 0, - yRight: -90, - type: 'lens_xy_labelsOrientationConfig', - }; - - const instance = shallow(); - - const axisStyle = instance.find(Axis).first().prop('style'); - - expect(axisStyle).toMatchObject({ - tickLabel: { - rotation: -45, - }, - }); - }); - - test('it should set the tickLabel visibility on the y axis if the tick labels is shown', () => { - const { data, args } = sampleArgs(); - - args.tickLabelsVisibilitySettings = { - x: false, - yLeft: true, - yRight: true, - type: 'lens_xy_tickLabelsConfig', - }; - - const instance = shallow(); - - const axisStyle = instance.find(Axis).at(1).prop('style'); - - expect(axisStyle).toMatchObject({ - tickLabel: { - visible: true, - }, - }); - }); - - test('it should set the tickLabel orientation on the y axis', () => { - const { data, args } = sampleArgs(); - - args.labelsOrientation = { - x: -45, - yLeft: -90, - yRight: -90, - type: 'lens_xy_labelsOrientationConfig', - }; - - const instance = shallow(); - - const axisStyle = instance.find(Axis).at(1).prop('style'); - - expect(axisStyle).toMatchObject({ - tickLabel: { - rotation: -90, - }, - }); - }); - - test('it should remove invalid rows', () => { - const data: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: { - type: 'datatable', - columns: [ - { id: 'a', name: 'a', meta: { type: 'number' } }, - { id: 'b', name: 'b', meta: { type: 'number' } }, - { id: 'c', name: 'c', meta: { type: 'string' } }, - ], - rows: [ - { a: undefined, b: 2, c: 'I', d: 'Row 1' }, - { a: 1, b: 5, c: 'J', d: 'Row 2' }, - ], - }, - second: { - type: 'datatable', - columns: [ - { id: 'a', name: 'a', meta: { type: 'number' } }, - { id: 'b', name: 'b', meta: { type: 'number' } }, - { id: 'c', name: 'c', meta: { type: 'string' } }, - ], - rows: [ - { a: undefined, b: undefined, c: undefined }, - { a: undefined, b: undefined, c: undefined }, - ], - }, - }, - }; - - const args: XYArgs = { - xTitle: '', - yTitle: '', - yRightTitle: '', - legend: { type: 'lens_xy_legendConfig', isVisible: false, position: Position.Top }, - valueLabels: 'hide', - tickLabelsVisibilitySettings: { - type: 'lens_xy_tickLabelsConfig', - x: true, - yLeft: true, - yRight: true, - }, - gridlinesVisibilitySettings: { - type: 'lens_xy_gridlinesConfig', - x: true, - yLeft: false, - yRight: false, - }, - labelsOrientation: { - type: 'lens_xy_labelsOrientationConfig', - x: 0, - yLeft: 0, - yRight: 0, - }, - yLeftExtent: { - mode: 'full', - type: 'lens_xy_axisExtentConfig', - }, - yRightExtent: { - mode: 'full', - type: 'lens_xy_axisExtentConfig', - }, - layers: [ - { - layerId: 'first', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'a', - accessors: ['c'], - splitAccessor: 'b', - columnToLabel: '', - xScaleType: 'ordinal', - yScaleType: 'linear', - isHistogram: false, - palette: mockPaletteOutput, - }, - { - layerId: 'second', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'a', - accessors: ['c'], - splitAccessor: 'b', - columnToLabel: '', - xScaleType: 'ordinal', - yScaleType: 'linear', - isHistogram: false, - palette: mockPaletteOutput, - }, - ], - }; - - const component = shallow(); - - const series = component.find(LineSeries); - - // Only one series should be rendered, even though 2 are configured - // This one series should only have one row, even though 2 are sent - expect(series.prop('data')).toEqual([{ a: 1, b: 5, c: 'J', d: 'Row 2' }]); - }); - - test('it should not remove rows with falsy but non-undefined values', () => { - const data: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: { - type: 'datatable', - columns: [ - { id: 'a', name: 'a', meta: { type: 'number' } }, - { id: 'b', name: 'b', meta: { type: 'number' } }, - { id: 'c', name: 'c', meta: { type: 'number' } }, - ], - rows: [ - { a: 0, b: 2, c: 5 }, - { a: 1, b: 0, c: 7 }, - ], - }, - }, - }; - - const args: XYArgs = { - xTitle: '', - yTitle: '', - yRightTitle: '', - legend: { type: 'lens_xy_legendConfig', isVisible: false, position: Position.Top }, - valueLabels: 'hide', - tickLabelsVisibilitySettings: { - type: 'lens_xy_tickLabelsConfig', - x: true, - yLeft: false, - yRight: false, - }, - gridlinesVisibilitySettings: { - type: 'lens_xy_gridlinesConfig', - x: true, - yLeft: false, - yRight: false, - }, - labelsOrientation: { - type: 'lens_xy_labelsOrientationConfig', - x: 0, - yLeft: 0, - yRight: 0, - }, - yLeftExtent: { - mode: 'full', - type: 'lens_xy_axisExtentConfig', - }, - yRightExtent: { - mode: 'full', - type: 'lens_xy_axisExtentConfig', - }, - layers: [ - { - layerId: 'first', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'a', - accessors: ['c'], - splitAccessor: 'b', - columnToLabel: '', - xScaleType: 'ordinal', - yScaleType: 'linear', - isHistogram: false, - palette: mockPaletteOutput, - }, - ], - }; - - const component = shallow(); - - const series = component.find(LineSeries); - - expect(series.prop('data')).toEqual([ - { a: 0, b: 2, c: 5 }, - { a: 1, b: 0, c: 7 }, - ]); - }); - - test('it should show legend for split series, even with one row', () => { - const data: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: { - type: 'datatable', - columns: [ - { id: 'a', name: 'a', meta: { type: 'number' } }, - { id: 'b', name: 'b', meta: { type: 'number' } }, - { id: 'c', name: 'c', meta: { type: 'string' } }, - ], - rows: [{ a: 1, b: 5, c: 'J' }], - }, - }, - }; - - const args: XYArgs = { - xTitle: '', - yTitle: '', - yRightTitle: '', - legend: { type: 'lens_xy_legendConfig', isVisible: true, position: Position.Top }, - valueLabels: 'hide', - tickLabelsVisibilitySettings: { - type: 'lens_xy_tickLabelsConfig', - x: true, - yLeft: false, - yRight: false, - }, - gridlinesVisibilitySettings: { - type: 'lens_xy_gridlinesConfig', - x: true, - yLeft: false, - yRight: false, - }, - labelsOrientation: { - type: 'lens_xy_labelsOrientationConfig', - x: 0, - yLeft: 0, - yRight: 0, - }, - yLeftExtent: { - mode: 'full', - type: 'lens_xy_axisExtentConfig', - }, - yRightExtent: { - mode: 'full', - type: 'lens_xy_axisExtentConfig', - }, - layers: [ - { - layerId: 'first', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'a', - accessors: ['c'], - splitAccessor: 'b', - columnToLabel: '', - xScaleType: 'ordinal', - yScaleType: 'linear', - isHistogram: false, - palette: mockPaletteOutput, - }, - ], - }; - - const component = shallow(); - - expect(component.find(Settings).prop('showLegend')).toEqual(true); - }); - - test('it should always show legend if showSingleSeries is set', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - - expect(component.find(Settings).prop('showLegend')).toEqual(true); - }); - - test('it should populate the correct legendPosition if isInside is set', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - - expect(component.find(Settings).prop('legendPosition')).toEqual({ - vAlign: VerticalAlignment.Top, - hAlign: HorizontalAlignment.Right, - direction: LayoutDirection.Vertical, - floating: true, - floatingColumns: 1, - }); - }); - - test('it not show legend if isVisible is set to false', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - - expect(component.find(Settings).prop('showLegend')).toEqual(false); - }); - - test('it should show legend on right side', () => { - const { data, args } = sampleArgs(); - - const component = shallow( - - ); - - expect(component.find(Settings).prop('legendPosition')).toEqual('top'); - }); - - test('it should apply the fitting function to all non-bar series', () => { - const data: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: createSampleDatatableWithRows([ - { a: 1, b: 2, c: 'I', d: 'Foo' }, - { a: 1, b: 5, c: 'J', d: 'Bar' }, - ]), - }, - }; - - const args: XYArgs = createArgsWithLayers([ - { ...sampleLayer, accessors: ['a'] }, - { ...sampleLayer, seriesType: 'bar', accessors: ['a'] }, - { ...sampleLayer, seriesType: 'area', accessors: ['a'] }, - { ...sampleLayer, seriesType: 'area_stacked', accessors: ['a'] }, - ]); - - const component = shallow( - - ); - - expect(component.find(LineSeries).prop('fit')).toEqual({ type: Fit.Carry }); - expect(component.find(BarSeries).prop('fit')).toEqual(undefined); - expect(component.find(AreaSeries).at(0).prop('fit')).toEqual({ type: Fit.Carry }); - expect(component.find(AreaSeries).at(0).prop('stackAccessors')).toEqual([]); - expect(component.find(AreaSeries).at(1).prop('fit')).toEqual({ type: Fit.Carry }); - expect(component.find(AreaSeries).at(1).prop('stackAccessors')).toEqual(['c']); - }); - - test('it should apply None fitting function if not specified', () => { - const { data, args } = sampleArgs(); - - (args.layers[0] as DataLayerArgs).accessors = ['a']; - - const component = shallow( - - ); - - expect(component.find(LineSeries).prop('fit')).toEqual({ type: Fit.None }); - }); - - test('it should apply the xTitle if is specified', () => { - const { data, args } = sampleArgs(); - - args.xTitle = 'My custom x-axis title'; - - const component = shallow( - - ); - - expect(component.find(Axis).at(0).prop('title')).toEqual('My custom x-axis title'); - }); - - test('it should hide the X axis title if the corresponding switch is off', () => { - const { data, args } = sampleArgs(); - - args.axisTitlesVisibilitySettings = { - x: false, - yLeft: true, - yRight: true, - type: 'lens_xy_axisTitlesVisibilityConfig', - }; - - const component = shallow( - - ); - - const axisStyle = component.find(Axis).first().prop('style'); - - expect(axisStyle).toMatchObject({ - axisTitle: { - visible: false, - }, - }); - }); - - test('it should show the X axis gridlines if the setting is on', () => { - const { data, args } = sampleArgs(); - - args.gridlinesVisibilitySettings = { - x: true, - yLeft: false, - yRight: false, - type: 'lens_xy_gridlinesConfig', - }; - - const component = shallow( - - ); - - expect(component.find(Axis).at(0).prop('gridLine')).toMatchObject({ - visible: true, - }); - }); - - test('it should format the boolean values correctly', () => { - const data: LensMultiTable = { - type: 'lens_multitable', - tables: { - first: { - type: 'datatable', - columns: [ - { - id: 'a', - name: 'a', - meta: { type: 'number', params: { id: 'number', params: { pattern: '0,0.000' } } }, - }, - { - id: 'b', - name: 'b', - meta: { type: 'number', params: { id: 'number', params: { pattern: '000,0' } } }, - }, - { - id: 'c', - name: 'c', - meta: { - type: 'boolean', - params: { id: 'boolean' }, - }, - }, - ], - rows: [ - { a: 5, b: 2, c: 0 }, - { a: 19, b: 5, c: 1 }, - ], - }, - }, - dateRange: { - fromDate: new Date('2019-01-02T05:00:00.000Z'), - toDate: new Date('2019-01-03T05:00:00.000Z'), - }, - }; - const timeSampleLayer: DataLayerArgs = { - layerId: 'first', - layerType: layerTypes.DATA, - seriesType: 'line', - xAccessor: 'c', - accessors: ['a', 'b'], - xScaleType: 'ordinal', - yScaleType: 'linear', - isHistogram: false, - palette: mockPaletteOutput, - }; - const args = createArgsWithLayers([timeSampleLayer]); - - const getCustomFormatSpy = jest.fn(); - getCustomFormatSpy.mockReturnValue({ convert: jest.fn((x) => Boolean(x)) }); - - const component = shallow( - - ); - - expect(component.find(LineSeries).at(1).prop('data')).toEqual([ - { - a: 5, - b: 2, - c: false, - }, - { - a: 19, - b: 5, - c: true, - }, - ]); - }); - - describe('annotations', () => { - const sampleStyledAnnotation: EventAnnotationOutput = { - time: '2022-03-18T08:25:00.000Z', - label: 'Event 1', - icon: 'triangle', - type: 'manual_event_annotation', - color: 'red', - lineStyle: 'dashed', - lineWidth: 3, - }; - const sampleAnnotationLayers: AnnotationLayerArgs[] = [ - { - layerType: layerTypes.ANNOTATIONS, - layerId: 'annotation', - annotations: [ - { - time: '2022-03-18T08:25:17.140Z', - label: 'Annotation', - type: 'manual_event_annotation', - }, - ], - }, - ]; - function sampleArgsWithAnnotation(annotationLayers = sampleAnnotationLayers) { - const { args } = sampleArgs(); - return { - data: dateHistogramData, - args: { - ...args, - layers: [dateHistogramLayer, ...annotationLayers], - } as XYArgs, - }; - } - test('should render basic annotation', () => { - const { data, args } = sampleArgsWithAnnotation(); - const component = mount(); - expect(component.find('LineAnnotation')).toMatchSnapshot(); - }); - test('should render simplified annotation when hide is true', () => { - const { data, args } = sampleArgsWithAnnotation(); - args.layers[0].hide = true; - const component = mount(); - expect(component.find('LineAnnotation')).toMatchSnapshot(); - }); - - test('should render grouped annotations preserving the shared styles', () => { - const { data, args } = sampleArgsWithAnnotation([ - { - layerType: layerTypes.ANNOTATIONS, - layerId: 'annotation', - annotations: [ - sampleStyledAnnotation, - { ...sampleStyledAnnotation, time: '2022-03-18T08:25:00.020Z', label: 'Event 2' }, - { - ...sampleStyledAnnotation, - time: '2022-03-18T08:25:00.001Z', - label: 'Event 3', - }, - ], - }, - ]); - const component = mount(); - const groupedAnnotation = component.find(LineAnnotation); - - expect(groupedAnnotation.length).toEqual(1); - // styles are passed because they are shared, dataValues & header is rounded to the interval - expect(groupedAnnotation).toMatchSnapshot(); - // renders numeric icon for grouped annotations - const marker = mount(
{groupedAnnotation.prop('marker')}
); - const numberIcon = marker.find('NumberIcon'); - expect(numberIcon.length).toEqual(1); - expect(numberIcon.text()).toEqual('3'); - - // checking tooltip - const renderLinks = mount(
{groupedAnnotation.prop('customTooltipDetails')!()}
); - expect(renderLinks.text()).toEqual( - ' Event 1 2022-03-18T08:25:00.000Z Event 3 2022-03-18T08:25:00.001Z Event 2 2022-03-18T08:25:00.020Z' - ); - }); - test('should render grouped annotations with default styles', () => { - const { data, args } = sampleArgsWithAnnotation([ - { - layerType: layerTypes.ANNOTATIONS, - layerId: 'annotation', - annotations: [sampleStyledAnnotation], - }, - { - layerType: layerTypes.ANNOTATIONS, - layerId: 'annotation', - annotations: [ - { - ...sampleStyledAnnotation, - icon: 'square', - color: 'blue', - lineStyle: 'dotted', - lineWidth: 10, - time: '2022-03-18T08:25:00.001Z', - label: 'Event 2', - }, - ], - }, - ]); - const component = mount(); - const groupedAnnotation = component.find(LineAnnotation); - - expect(groupedAnnotation.length).toEqual(1); - // styles are default because they are different for both annotations - expect(groupedAnnotation).toMatchSnapshot(); - }); - test('should not render hidden annotations', () => { - const { data, args } = sampleArgsWithAnnotation([ - { - layerType: layerTypes.ANNOTATIONS, - layerId: 'annotation', - annotations: [ - sampleStyledAnnotation, - { ...sampleStyledAnnotation, time: '2022-03-18T08:30:00.020Z', label: 'Event 2' }, - { - ...sampleStyledAnnotation, - time: '2022-03-18T08:35:00.001Z', - label: 'Event 3', - isHidden: true, - }, - ], - }, - ]); - const component = mount(); - const annotations = component.find(LineAnnotation); - - expect(annotations.length).toEqual(2); - }); - }); - }); - - describe('calculateMinInterval', () => { - let xyProps: XYChartProps; - - beforeEach(() => { - xyProps = sampleArgs(); - (xyProps.args.layers[0] as DataLayerArgs).xScaleType = 'time'; - }); - it('should use first valid layer and determine interval', async () => { - xyProps.data.tables.first.columns[2].meta.source = 'esaggs'; - xyProps.data.tables.first.columns[2].meta.sourceParams = { - type: 'date_histogram', - params: { - used_interval: '5m', - }, - }; - const result = await calculateMinInterval(xyProps); - expect(result).toEqual(5 * 60 * 1000); - }); - - it('should return interval of number histogram if available on first x axis columns', async () => { - (xyProps.args.layers[0] as DataLayerArgs).xScaleType = 'linear'; - xyProps.data.tables.first.columns[2].meta = { - source: 'esaggs', - type: 'number', - field: 'someField', - sourceParams: { - type: 'histogram', - params: { - interval: 'auto', - used_interval: 5, - }, - }, - }; - const result = await calculateMinInterval(xyProps); - expect(result).toEqual(5); - }); - - it('should return undefined if data table is empty', async () => { - xyProps.data.tables.first.rows = []; - xyProps.data.tables.first.columns[2].meta.source = 'esaggs'; - xyProps.data.tables.first.columns[2].meta.sourceParams = { - type: 'date_histogram', - params: { - used_interval: '5m', - }, - }; - const result = await calculateMinInterval(xyProps); - expect(result).toEqual(undefined); - }); - - it('should return undefined if interval can not be checked', async () => { - const result = await calculateMinInterval(xyProps); - expect(result).toEqual(undefined); - }); - - it('should return undefined if date column is not found', async () => { - xyProps.data.tables.first.columns.splice(2, 1); - const result = await calculateMinInterval(xyProps); - expect(result).toEqual(undefined); - }); - - it('should return undefined if x axis is not a date', async () => { - (xyProps.args.layers[0] as DataLayerArgs).xScaleType = 'ordinal'; - xyProps.data.tables.first.columns.splice(2, 1); - const result = await calculateMinInterval(xyProps); - expect(result).toEqual(undefined); - }); - }); -}); diff --git a/x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.tsx b/x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.tsx deleted file mode 100644 index 7817db573e419..0000000000000 --- a/x-pack/plugins/lens/public/xy_visualization/expression_reference_lines.tsx +++ /dev/null @@ -1,213 +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 './expression_reference_lines.scss'; -import React from 'react'; -import { groupBy } from 'lodash'; -import { RectAnnotation, AnnotationDomainType, LineAnnotation, Position } from '@elastic/charts'; -import type { PaletteRegistry } from 'src/plugins/charts/public'; -import type { FieldFormat } from 'src/plugins/field_formats/common'; -import type { ReferenceLineLayerArgs } from '../../common/expressions'; -import type { LensMultiTable } from '../../common/types'; -import { defaultReferenceLineColor } from './color_assignment'; -import { - MarkerBody, - Marker, - LINES_MARKER_SIZE, - mapVerticalToHorizontalPlacement, - getBaseIconPlacement, -} from './annotations_helpers'; - -export interface ReferenceLineAnnotationsProps { - layers: ReferenceLineLayerArgs[]; - data: LensMultiTable; - formatters: Record<'left' | 'right' | 'bottom', FieldFormat | undefined>; - paletteService: PaletteRegistry; - syncColors: boolean; - axesMap: Record<'left' | 'right', boolean>; - isHorizontal: boolean; - paddingMap: Partial>; -} - -export const ReferenceLineAnnotations = ({ - layers, - data, - formatters, - paletteService, - syncColors, - axesMap, - isHorizontal, - paddingMap, -}: ReferenceLineAnnotationsProps) => { - return ( - <> - {layers.flatMap((layer) => { - if (!layer.yConfig) { - return []; - } - const { columnToLabel, yConfig: yConfigs, layerId } = layer; - const columnToLabelMap: Record = columnToLabel - ? JSON.parse(columnToLabel) - : {}; - const table = data.tables[layerId]; - - const row = table.rows[0]; - - const yConfigByValue = yConfigs.sort( - ({ forAccessor: idA }, { forAccessor: idB }) => row[idA] - row[idB] - ); - - const groupedByDirection = groupBy(yConfigByValue, 'fill'); - if (groupedByDirection.below) { - groupedByDirection.below.reverse(); - } - - return yConfigByValue.flatMap((yConfig, i) => { - // Find the formatter for the given axis - const groupId = - yConfig.axisMode === 'bottom' - ? undefined - : yConfig.axisMode === 'right' - ? 'right' - : 'left'; - - const formatter = formatters[groupId || 'bottom']; - - // get the position for vertical chart - const markerPositionVertical = getBaseIconPlacement( - yConfig.iconPosition, - axesMap, - yConfig.axisMode - ); - // the padding map is built for vertical chart - const hasReducedPadding = paddingMap[markerPositionVertical] === LINES_MARKER_SIZE; - - const props = { - groupId, - marker: ( - - ), - markerBody: ( - - ), - // rotate the position if required - markerPosition: isHorizontal - ? mapVerticalToHorizontalPlacement(markerPositionVertical) - : markerPositionVertical, - }; - const annotations = []; - - const dashStyle = - yConfig.lineStyle === 'dashed' - ? [(yConfig.lineWidth || 1) * 3, yConfig.lineWidth || 1] - : yConfig.lineStyle === 'dotted' - ? [yConfig.lineWidth || 1, yConfig.lineWidth || 1] - : undefined; - - const sharedStyle = { - strokeWidth: yConfig.lineWidth || 1, - stroke: yConfig.color || defaultReferenceLineColor, - dash: dashStyle, - }; - - annotations.push( - ({ - dataValue: row[yConfig.forAccessor], - header: columnToLabelMap[yConfig.forAccessor], - details: formatter?.convert(row[yConfig.forAccessor]) || row[yConfig.forAccessor], - }))} - domainType={ - yConfig.axisMode === 'bottom' - ? AnnotationDomainType.XDomain - : AnnotationDomainType.YDomain - } - style={{ - line: { - ...sharedStyle, - opacity: 1, - }, - }} - /> - ); - - if (yConfig.fill && yConfig.fill !== 'none') { - const isFillAbove = yConfig.fill === 'above'; - const indexFromSameType = groupedByDirection[yConfig.fill].findIndex( - ({ forAccessor }) => forAccessor === yConfig.forAccessor - ); - const shouldCheckNextReferenceLine = - indexFromSameType < groupedByDirection[yConfig.fill].length - 1; - annotations.push( - { - const nextValue = shouldCheckNextReferenceLine - ? row[groupedByDirection[yConfig.fill!][indexFromSameType + 1].forAccessor] - : undefined; - if (yConfig.axisMode === 'bottom') { - return { - coordinates: { - x0: isFillAbove ? row[yConfig.forAccessor] : nextValue, - y0: undefined, - x1: isFillAbove ? nextValue : row[yConfig.forAccessor], - y1: undefined, - }, - header: columnToLabelMap[yConfig.forAccessor], - details: - formatter?.convert(row[yConfig.forAccessor]) || row[yConfig.forAccessor], - }; - } - return { - coordinates: { - x0: undefined, - y0: isFillAbove ? row[yConfig.forAccessor] : nextValue, - x1: undefined, - y1: isFillAbove ? nextValue : row[yConfig.forAccessor], - }, - header: columnToLabelMap[yConfig.forAccessor], - details: - formatter?.convert(row[yConfig.forAccessor]) || row[yConfig.forAccessor], - }; - })} - style={{ - ...sharedStyle, - fill: yConfig.color || defaultReferenceLineColor, - opacity: 0.1, - }} - /> - ); - } - return annotations; - }); - })} - - ); -}; diff --git a/x-pack/plugins/lens/public/xy_visualization/expression_thresholds.scss b/x-pack/plugins/lens/public/xy_visualization/expression_thresholds.scss deleted file mode 100644 index 41b30ce40676b..0000000000000 --- a/x-pack/plugins/lens/public/xy_visualization/expression_thresholds.scss +++ /dev/null @@ -1,18 +0,0 @@ -.lnsXyDecorationRotatedWrapper { - display: inline-block; - overflow: hidden; - line-height: $euiLineHeight; - - .lnsXyDecorationRotatedWrapper__label { - display: inline-block; - white-space: nowrap; - transform: translate(0, 100%) rotate(-90deg); - transform-origin: 0 0; - - &::after { - content: ''; - float: left; - margin-top: 100%; - } - } -} \ No newline at end of file diff --git a/x-pack/plugins/lens/public/xy_visualization/index.ts b/x-pack/plugins/lens/public/xy_visualization/index.ts index cfeb1387f689c..daae9a5ef56ff 100644 --- a/x-pack/plugins/lens/public/xy_visualization/index.ts +++ b/x-pack/plugins/lens/public/xy_visualization/index.ts @@ -11,7 +11,6 @@ import type { ExpressionsSetup } from '../../../../../src/plugins/expressions/pu import type { EditorFrameSetup } from '../types'; import type { ChartsPluginSetup } from '../../../../../src/plugins/charts/public'; import type { LensPluginStartDependencies } from '../plugin'; -import { getTimeZone } from '../utils'; import type { FormatFactory } from '../../common'; import { LEGACY_TIME_AXIS } from '../../../../../src/plugins/charts/common'; @@ -26,26 +25,14 @@ export interface XyVisualizationPluginSetupPlugins { export class XyVisualization { setup( core: CoreSetup, - { expressions, formatFactory, editorFrame }: XyVisualizationPluginSetupPlugins + { editorFrame }: XyVisualizationPluginSetupPlugins ) { editorFrame.registerVisualization(async () => { - const { getXyChartRenderer, getXyVisualization } = await import('../async_services'); + const { getXyVisualization } = await import('../async_services'); const [, { charts, fieldFormats, eventAnnotation }] = await core.getStartServices(); const palettes = await charts.palettes.getPalettes(); const eventAnnotationService = await eventAnnotation.getService(); const useLegacyTimeAxis = core.uiSettings.get(LEGACY_TIME_AXIS); - expressions.registerRenderer( - getXyChartRenderer({ - formatFactory, - chartsThemeService: charts.theme, - chartsActiveCursorService: charts.activeCursor, - paletteService: palettes, - eventAnnotationService, - timeZone: getTimeZone(core.uiSettings), - useLegacyTimeAxis, - kibanaTheme: core.theme, - }) - ); return getXyVisualization({ paletteService: palettes, eventAnnotationService, diff --git a/x-pack/plugins/lens/public/xy_visualization/reference_line_helpers.test.ts b/x-pack/plugins/lens/public/xy_visualization/reference_line_helpers.test.ts index 9def75615e6c8..368b213428ed7 100644 --- a/x-pack/plugins/lens/public/xy_visualization/reference_line_helpers.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/reference_line_helpers.test.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { XYDataLayerConfig } from '../../common/expressions'; import { FramePublicAPI } from '../types'; import { computeOverallDataDomain, getStaticValue } from './reference_line_helpers'; +import { XYDataLayerConfig } from './types'; function getActiveData(json: Array<{ id: string; rows: Array> }>) { return json.reduce((memo, { id, rows }) => { @@ -277,6 +277,11 @@ describe('reference_line helpers', () => { layerType: 'data', xAccessor: 'a', accessors: [], + type: 'dataLayer', + yScaleType: 'linear', + xScaleType: 'linear', + isHistogram: false, + palette: { type: 'palette', name: 'palette1' }, } as XYDataLayerConfig, ], 'x', // this is influenced by the callback @@ -300,6 +305,11 @@ describe('reference_line helpers', () => { layerType: 'data', xAccessor: 'a', accessors: [], + type: 'dataLayer', + yScaleType: 'linear', + xScaleType: 'linear', + isHistogram: false, + palette: { type: 'palette', name: 'palette1' }, } as XYDataLayerConfig, ], 'x', diff --git a/x-pack/plugins/lens/public/xy_visualization/reference_line_helpers.tsx b/x-pack/plugins/lens/public/xy_visualization/reference_line_helpers.tsx index 8b6a96ce24d44..af679d1354792 100644 --- a/x-pack/plugins/lens/public/xy_visualization/reference_line_helpers.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/reference_line_helpers.tsx @@ -9,15 +9,14 @@ import { groupBy, partition } from 'lodash'; import { i18n } from '@kbn/i18n'; import { layerTypes } from '../../common'; import type { - XYDataLayerConfig, - XYReferenceLineLayerConfig, + YAxisMode, YConfig, -} from '../../common/expressions'; +} from '../../../../../src/plugins/chart_expressions/expression_xy/common'; import { Datatable } from '../../../../../src/plugins/expressions/public'; import type { DatasourcePublicAPI, FramePublicAPI, Visualization } from '../types'; import { groupAxesByType } from './axes_configuration'; import { isHorizontalChart, isPercentageSeries, isStackedChart } from './state_helpers'; -import type { XYState } from './types'; +import type { XYState, XYDataLayerConfig, XYReferenceLineLayerConfig } from './types'; import { checkScaleOperation, getAxisName, @@ -49,6 +48,7 @@ export function getGroupsToShow groupsAvailable[label] || config?.length) .map((layer) => ({ ...layer, valid: groupsAvailable[layer.label] })); @@ -339,6 +339,13 @@ export const setReferenceDimension: Visualization['setDimension'] = ({ ? newLayer.yConfig?.find(({ forAccessor }) => forAccessor === previousColumn) : false; if (!hasYConfig) { + const axisMode: YAxisMode = + groupId === 'xReferenceLine' + ? 'bottom' + : groupId === 'yReferenceLineRight' + ? 'right' + : 'left'; + newLayer.yConfig = [ ...(newLayer.yConfig || []), { @@ -346,15 +353,11 @@ export const setReferenceDimension: Visualization['setDimension'] = ({ ...previousYConfig, // but keep the new group & id config forAccessor: columnId, - axisMode: - groupId === 'xReferenceLine' - ? 'bottom' - : groupId === 'yReferenceLineRight' - ? 'right' - : 'left', + axisMode, }, ]; } + return { ...prevState, layers: prevState.layers.map((l) => (l.layerId === layerId ? newLayer : l)), diff --git a/x-pack/plugins/lens/public/xy_visualization/state_helpers.ts b/x-pack/plugins/lens/public/xy_visualization/state_helpers.ts index e0984e62cb9cc..d3c8efae33836 100644 --- a/x-pack/plugins/lens/public/xy_visualization/state_helpers.ts +++ b/x-pack/plugins/lens/public/xy_visualization/state_helpers.ts @@ -9,13 +9,15 @@ import { EuiIconType } from '@elastic/eui/src/components/icon/icon'; import type { FramePublicAPI, DatasourcePublicAPI } from '../types'; import type { SeriesType, - XYLayerConfig, YConfig, ValidLayer, +} from '../../../../../src/plugins/chart_expressions/expression_xy/common'; +import { + visualizationTypes, + XYLayerConfig, XYDataLayerConfig, XYReferenceLineLayerConfig, -} from '../../common/expressions'; -import { visualizationTypes } from './types'; +} from './types'; import { getDataLayers, isAnnotationsLayer, isDataLayer } from './visualization_helpers'; export function isHorizontalSeries(seriesType: SeriesType) { diff --git a/x-pack/plugins/lens/public/xy_visualization/to_expression.test.ts b/x-pack/plugins/lens/public/xy_visualization/to_expression.test.ts index 2e3db8f2f6f93..c04781198c78f 100644 --- a/x-pack/plugins/lens/public/xy_visualization/to_expression.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/to_expression.test.ts @@ -13,9 +13,9 @@ import { OperationDescriptor } from '../types'; import { createMockDatasource, createMockFramePublicAPI } from '../mocks'; import { layerTypes } from '../../common'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; +import { eventAnnotationServiceMock } from '../../../../../src/plugins/event_annotation/public/mocks'; import { defaultReferenceLineColor } from './color_assignment'; import { themeServiceMock } from '../../../../../src/core/public/mocks'; -import { eventAnnotationServiceMock } from 'src/plugins/event_annotation/public/mocks'; describe('#toExpression', () => { const xyVisualization = getXyVisualization({ diff --git a/x-pack/plugins/lens/public/xy_visualization/to_expression.ts b/x-pack/plugins/lens/public/xy_visualization/to_expression.ts index ade90ff98e553..ec9093a999c84 100644 --- a/x-pack/plugins/lens/public/xy_visualization/to_expression.ts +++ b/x-pack/plugins/lens/public/xy_visualization/to_expression.ts @@ -8,18 +8,20 @@ import { Ast } from '@kbn/interpreter'; import { ScaleType } from '@elastic/charts'; import { PaletteRegistry } from 'src/plugins/charts/public'; + import { EventAnnotationServiceType } from 'src/plugins/event_annotation/public'; -import { State } from './types'; +import { + State, + XYDataLayerConfig, + XYReferenceLineLayerConfig, + XYAnnotationLayerConfig, +} from './types'; import { OperationMetadata, DatasourcePublicAPI } from '../types'; import { getColumnToLabelMap } from './state_helpers'; import type { ValidLayer, - XYAnnotationLayerConfig, - XYReferenceLineLayerConfig, YConfig, - XYDataLayerConfig, -} from '../../common/expressions'; -import { layerTypes } from '../../common'; +} from '../../../../../src/plugins/chart_expressions/expression_xy/common'; import { hasIcon } from './xy_config_panel/shared/icon_select'; import { defaultReferenceLineColor } from './color_assignment'; import { getDefaultVisualValuesForLayer } from '../shared_components/datasource_default_values'; @@ -31,6 +33,7 @@ import { } from './visualization_helpers'; import { defaultAnnotationLabel } from './annotations/config_panel'; import { getUniqueLabels } from './annotations/helpers'; +import { layerTypes } from '../../common'; export const getSortedAccessors = ( datasource: DatasourcePublicAPI, @@ -195,7 +198,7 @@ export const buildExpression = ( chain: [ { type: 'function', - function: 'lens_xy_chart', + function: 'xyVis', arguments: { title: [attributes?.title || ''], description: [attributes?.description || ''], @@ -208,7 +211,7 @@ export const buildExpression = ( chain: [ { type: 'function', - function: 'lens_xy_legendConfig', + function: 'legendConfig', arguments: { isVisible: [state.legend.isVisible], showSingleSeries: state.legend.showSingleSeries @@ -249,7 +252,7 @@ export const buildExpression = ( chain: [ { type: 'function', - function: 'lens_xy_axisExtentConfig', + function: 'axisExtentConfig', arguments: { mode: [state?.yLeftExtent?.mode || 'full'], lowerBound: @@ -271,7 +274,7 @@ export const buildExpression = ( chain: [ { type: 'function', - function: 'lens_xy_axisExtentConfig', + function: 'axisExtentConfig', arguments: { mode: [state?.yRightExtent?.mode || 'full'], lowerBound: @@ -293,7 +296,7 @@ export const buildExpression = ( chain: [ { type: 'function', - function: 'lens_xy_axisTitlesVisibilityConfig', + function: 'axisTitlesVisibilityConfig', arguments: { x: [state?.axisTitlesVisibilitySettings?.x ?? true], yLeft: [state?.axisTitlesVisibilitySettings?.yLeft ?? true], @@ -309,7 +312,7 @@ export const buildExpression = ( chain: [ { type: 'function', - function: 'lens_xy_tickLabelsConfig', + function: 'tickLabelsConfig', arguments: { x: [state?.tickLabelsVisibilitySettings?.x ?? true], yLeft: [state?.tickLabelsVisibilitySettings?.yLeft ?? true], @@ -325,7 +328,7 @@ export const buildExpression = ( chain: [ { type: 'function', - function: 'lens_xy_gridlinesConfig', + function: 'gridlinesConfig', arguments: { x: [state?.gridlinesVisibilitySettings?.x ?? true], yLeft: [state?.gridlinesVisibilitySettings?.yLeft ?? true], @@ -341,7 +344,7 @@ export const buildExpression = ( chain: [ { type: 'function', - function: 'lens_xy_labelsOrientationConfig', + function: 'labelsOrientationConfig', arguments: { x: [state?.labelsOrientation?.x ?? 0], yLeft: [state?.labelsOrientation?.yLeft ?? 0], @@ -388,7 +391,7 @@ const referenceLineLayerToExpression = ( chain: [ { type: 'function', - function: 'lens_xy_referenceLine_layer', + function: 'referenceLineLayer', arguments: { layerId: [layer.layerId], yConfig: layer.yConfig @@ -396,7 +399,6 @@ const referenceLineLayerToExpression = ( yConfigToExpression(yConfig, defaultReferenceLineColor) ) : [], - layerType: [layerTypes.REFERENCELINE], accessors: layer.accessors, columnToLabel: [JSON.stringify(getColumnToLabelMap(layer, datasourceLayer))], }, @@ -414,11 +416,10 @@ const annotationLayerToExpression = ( chain: [ { type: 'function', - function: 'lens_xy_annotation_layer', + function: 'annotationLayer', arguments: { hide: [Boolean(layer.hide)], layerId: [layer.layerId], - layerType: [layerTypes.ANNOTATIONS], annotations: layer.annotations ? layer.annotations.map( (ann): Ast => @@ -462,7 +463,7 @@ const dataLayerToExpression = ( chain: [ { type: 'function', - function: 'lens_xy_data_layer', + function: 'dataLayer', arguments: { layerId: [layer.layerId], hide: [Boolean(layer.hide)], @@ -477,7 +478,6 @@ const dataLayerToExpression = ( ? layer.yConfig.map((yConfig) => yConfigToExpression(yConfig)) : [], seriesType: [layer.seriesType], - layerType: [layerTypes.DATA], accessors: layer.accessors, columnToLabel: [JSON.stringify(columnToLabel)], ...(layer.palette @@ -515,7 +515,7 @@ const yConfigToExpression = (yConfig: YConfig, defaultColor?: string): Ast => { chain: [ { type: 'function', - function: 'lens_xy_yConfig', + function: 'yConfig', arguments: { forAccessor: [yConfig.forAccessor], axisMode: yConfig.axisMode ? [yConfig.axisMode] : [], diff --git a/x-pack/plugins/lens/public/xy_visualization/types.ts b/x-pack/plugins/lens/public/xy_visualization/types.ts index 2b9d5687979be..9fcb1951d5ac2 100644 --- a/x-pack/plugins/lens/public/xy_visualization/types.ts +++ b/x-pack/plugins/lens/public/xy_visualization/types.ts @@ -18,19 +18,52 @@ import { LensIconChartBarHorizontalPercentage } from '../assets/chart_bar_horizo import { LensIconChartLine } from '../assets/chart_line'; import type { VisualizationType, Suggestion } from '../types'; +import { PaletteOutput } from '../../../../../src/plugins/charts/common'; import type { SeriesType, LegendConfig, AxisExtentConfig, - XYLayerConfig, XYCurveType, AxesSettingsConfig, FittingFunction, LabelsOrientationConfig, EndValue, -} from '../../common/expressions'; + YConfig, +} from '../../../../../src/plugins/chart_expressions/expression_xy/common'; +import { EventAnnotationConfig } from '../../../../../src/plugins/event_annotation/common'; import type { ValueLabelConfig } from '../../common/types'; +export interface XYDataLayerConfig { + layerId: string; + accessors: string[]; + layerType: 'data'; + seriesType: SeriesType; + xAccessor?: string; + hide?: boolean; + yConfig?: YConfig[]; + splitAccessor?: string; + palette?: PaletteOutput; +} + +export interface XYReferenceLineLayerConfig { + layerId: string; + accessors: string[]; + yConfig?: YConfig[]; + layerType: 'referenceLine'; +} + +export interface XYAnnotationLayerConfig { + layerId: string; + layerType: 'annotations'; + annotations: EventAnnotationConfig[]; + hide?: boolean; +} + +export type XYLayerConfig = + | XYDataLayerConfig + | XYReferenceLineLayerConfig + | XYAnnotationLayerConfig; + // Persisted parts of the state export interface XYState { preferredSeriesType: SeriesType; @@ -56,6 +89,7 @@ export interface XYState { } export type State = XYState; + const groupLabelForBar = i18n.translate('xpack.lens.xyVisualization.barGroupLabel', { defaultMessage: 'Bar', }); diff --git a/x-pack/plugins/lens/public/xy_visualization/visualization.test.ts b/x-pack/plugins/lens/public/xy_visualization/visualization.test.ts index b5b17c4536288..18cd16c17b365 100644 --- a/x-pack/plugins/lens/public/xy_visualization/visualization.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/visualization.test.ts @@ -8,13 +8,15 @@ import { getXyVisualization } from './visualization'; import { Position } from '@elastic/charts'; import { Operation, VisualizeEditorContext, Suggestion, OperationDescriptor } from '../types'; -import type { State, XYState, XYSuggestion } from './types'; import type { - SeriesType, - XYDataLayerConfig, + State, + XYState, + XYSuggestion, XYLayerConfig, + XYDataLayerConfig, XYReferenceLineLayerConfig, -} from '../../common/expressions'; +} from './types'; +import type { SeriesType } from '../../../../../src/plugins/chart_expressions/expression_xy/common'; import { layerTypes } from '../../common'; import { createMockDatasource, createMockFramePublicAPI } from '../mocks'; import { LensIconChartBar } from '../assets/chart_bar'; @@ -45,7 +47,7 @@ const exampleAnnotation2: EventAnnotationConfig = { label: 'Annotation2', }; -function exampleState(): State { +function exampleState(): XYState { return { legend: { position: Position.Bottom, isVisible: true }, valueLabels: 'hide', @@ -58,7 +60,7 @@ function exampleState(): State { splitAccessor: 'd', xAccessor: 'a', accessors: ['b', 'c'], - } as XYDataLayerConfig, + }, ], }; } @@ -127,7 +129,7 @@ describe('xy_visualization', () => { }); describe('#getVisualizationTypeId', () => { - function mixedState(...types: SeriesType[]) { + function mixedState(...types: SeriesType[]): XYState { const state = exampleState(); return { ...state, @@ -1039,7 +1041,7 @@ describe('xy_visualization', () => { ...baseState.layers[0], accessors: ['a'], seriesType: 'bar_percentage_stacked', - } as XYDataLayerConfig, + } as XYLayerConfig, ], }, frame, @@ -1648,7 +1650,7 @@ describe('xy_visualization', () => { ...baseState.layers[0], splitAccessor: undefined, ...layerConfigOverride, - } as XYDataLayerConfig, + } as XYLayerConfig, ], }, frame, diff --git a/x-pack/plugins/lens/public/xy_visualization/visualization.tsx b/x-pack/plugins/lens/public/xy_visualization/visualization.tsx index 78fd50f7cfece..1a6af0dc36475 100644 --- a/x-pack/plugins/lens/public/xy_visualization/visualization.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/visualization.tsx @@ -16,14 +16,18 @@ import { ThemeServiceStart } from 'kibana/public'; import { EventAnnotationServiceType } from '../../../../../src/plugins/event_annotation/public'; import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import { VIS_EVENT_TO_TRIGGER } from '../../../../../src/plugins/visualizations/public'; -import type { FillStyle, XYLayerConfig } from '../../common/expressions/xy_chart'; import { getSuggestions } from './xy_suggestions'; import { XyToolbar } from './xy_config_panel'; import { DimensionEditor } from './xy_config_panel/dimension_editor'; import { LayerHeader } from './xy_config_panel/layer_header'; import type { Visualization, AccessorConfig, FramePublicAPI } from '../types'; -import { State, visualizationTypes, XYSuggestion } from './types'; -import { SeriesType, XYDataLayerConfig, YAxisMode } from '../../common/expressions'; +import { + FillStyle, + SeriesType, + YAxisMode, + YConfig, +} from '../../../../../src/plugins/chart_expressions/expression_xy/common'; +import { State, visualizationTypes, XYSuggestion, XYLayerConfig, XYDataLayerConfig } from './types'; import { layerTypes } from '../../common'; import { isHorizontalChart } from './state_helpers'; import { toExpression, toPreviewExpression, getSortedAccessors } from './to_expression'; @@ -61,7 +65,7 @@ import { validateLayersForDimension, } from './visualization_helpers'; import { groupAxesByType } from './axes_configuration'; -import { XYState } from '..'; +import { XYState } from './types'; import { ReferenceLinePanel } from './xy_config_panel/reference_line_panel'; import { DimensionTrigger } from '../shared_components/dimension_trigger'; import { AnnotationsPanel, defaultAnnotationLabel } from './annotations/config_panel'; @@ -202,12 +206,18 @@ export const getXyVisualization = ({ accessors: sortedAccessors, }); + if (isReferenceLayer(layer)) { + return getReferenceConfiguration({ state, frame, layer, sortedAccessors }); + } + + const dataLayer: XYDataLayerConfig = layer; + const dataLayers = getDataLayers(state.layers); const isHorizontal = isHorizontalChart(state.layers); const { left, right } = groupAxesByType([layer], frame.activeData); // Check locally if it has one accessor OR one accessor per axis const layerHasOnlyOneAccessor = Boolean( - layer.accessors.length < 2 || + dataLayer.accessors.length < 2 || (left.length && left.length < 2) || (right.length && right.length < 2) ); @@ -219,9 +229,10 @@ export const getXyVisualization = ({ // check that the other layers are compatible with this one (l) => { if ( - l.seriesType === layer.seriesType && - Boolean(l.xAccessor) === Boolean(layer.xAccessor) && - Boolean(l.splitAccessor) === Boolean(layer.splitAccessor) + isDataLayer(l) && + l.seriesType === dataLayer.seriesType && + Boolean(l.xAccessor) === Boolean(dataLayer.xAccessor) && + Boolean(l.splitAccessor) === Boolean(dataLayer.splitAccessor) ) { const { left: localLeft, right: localRight } = groupAxesByType([l], frame.activeData); // return true only if matching axis are found @@ -240,9 +251,9 @@ export const getXyVisualization = ({ { groupId: 'x', groupLabel: getAxisName('x', { isHorizontal }), - accessors: layer.xAccessor ? [{ columnId: layer.xAccessor }] : [], + accessors: dataLayer.xAccessor ? [{ columnId: dataLayer.xAccessor }] : [], filterOperations: isBucketed, - supportsMoreColumns: !layer.xAccessor, + supportsMoreColumns: !dataLayer.xAccessor, dataTestSubj: 'lnsXY_xDimensionPanel', }, { @@ -260,21 +271,21 @@ export const getXyVisualization = ({ groupLabel: i18n.translate('xpack.lens.xyChart.splitSeries', { defaultMessage: 'Break down by', }), - accessors: layer.splitAccessor + accessors: dataLayer.splitAccessor ? [ { - columnId: layer.splitAccessor, + columnId: dataLayer.splitAccessor, triggerIcon: 'colorBy' as const, palette: paletteService - .get(layer.palette?.name || 'default') - .getCategoricalColors(10, layer.palette?.params), + .get(dataLayer.palette?.name || 'default') + .getCategoricalColors(10, dataLayer.palette?.params), }, ] : [], filterOperations: isBucketed, - supportsMoreColumns: !layer.splitAccessor, + supportsMoreColumns: !dataLayer.splitAccessor, dataTestSubj: 'lnsXY_splitDimensionPanel', - required: layer.seriesType.includes('percentage') && hasOnlyOneAccessor, + required: dataLayer.seriesType.includes('percentage') && hasOnlyOneAccessor, enableDimensionEditor: true, }, ], @@ -288,7 +299,9 @@ export const getXyVisualization = ({ setDimension(props) { const { prevState, layerId, columnId, groupId } = props; - const foundLayer = prevState.layers.find((l) => l.layerId === layerId); + const foundLayer: XYLayerConfig | undefined = prevState.layers.find( + (l) => l.layerId === layerId + ); if (!foundLayer) { return prevState; } @@ -300,7 +313,7 @@ export const getXyVisualization = ({ return setAnnotationsDimension(props); } - const newLayer = { ...foundLayer }; + const newLayer: XYDataLayerConfig = Object.assign({}, foundLayer); if (groupId === 'x') { newLayer.xAccessor = columnId; } @@ -324,7 +337,7 @@ export const getXyVisualization = ({ } const isReferenceLine = metrics.some((metric) => metric.agg === 'static_value'); const axisMode = axisPosition as YAxisMode; - const yConfig = metrics.map((metric, idx) => { + const yConfig = metrics.map((metric, idx) => { return { color: metric.color, forAccessor: metric.accessor ?? foundLayer.accessors[idx], diff --git a/x-pack/plugins/lens/public/xy_visualization/visualization_helpers.tsx b/x-pack/plugins/lens/public/xy_visualization/visualization_helpers.tsx index 23c2446ca2363..d680494ef8315 100644 --- a/x-pack/plugins/lens/public/xy_visualization/visualization_helpers.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/visualization_helpers.tsx @@ -8,18 +8,17 @@ import { i18n } from '@kbn/i18n'; import { uniq } from 'lodash'; import { DatasourcePublicAPI, OperationMetadata, VisualizationType } from '../types'; -import { State, visualizationTypes, XYState } from './types'; -import { isHorizontalChart } from './state_helpers'; import { - AnnotationLayerArgs, - DataLayerArgs, - SeriesType, + State, + visualizationTypes, + XYState, XYAnnotationLayerConfig, - XYDataLayerConfig, - XYLayerArgs, XYLayerConfig, + XYDataLayerConfig, XYReferenceLineLayerConfig, -} from '../../common/expressions'; +} from './types'; +import { isHorizontalChart } from './state_helpers'; +import { SeriesType } from '../../../../../src/plugins/chart_expressions/expression_xy/common'; import { layerTypes } from '..'; import { LensIconChartBarHorizontal } from '../assets/chart_bar_horizontal'; import { LensIconChartMixedXy } from '../assets/chart_mixed_xy'; @@ -131,15 +130,12 @@ export function checkScaleOperation( }; } -export const isDataLayer = (layer: Pick): layer is XYDataLayerConfig => +export const isDataLayer = (layer: XYLayerConfig): layer is XYDataLayerConfig => layer.layerType === layerTypes.DATA || !layer.layerType; -export const getDataLayers = (layers: Array>) => +export const getDataLayers = (layers: XYLayerConfig[]) => (layers || []).filter((layer): layer is XYDataLayerConfig => isDataLayer(layer)); -export const getDataLayersArgs = (layers: XYLayerArgs[]) => - (layers || []).filter((layer): layer is DataLayerArgs => isDataLayer(layer)); - export const getFirstDataLayer = (layers: XYLayerConfig[]) => (layers || []).find((layer): layer is XYDataLayerConfig => isDataLayer(layer)); @@ -157,9 +153,6 @@ export const isAnnotationsLayer = ( export const getAnnotationsLayers = (layers: Array>) => (layers || []).filter((layer): layer is XYAnnotationLayerConfig => isAnnotationsLayer(layer)); -export const getAnnotationsLayersArgs = (layers: XYLayerArgs[]) => - (layers || []).filter((layer): layer is AnnotationLayerArgs => isAnnotationsLayer(layer)); - export interface LayerTypeToLayer { [layerTypes.DATA]: (layer: XYDataLayerConfig) => XYDataLayerConfig; [layerTypes.REFERENCELINE]: (layer: XYReferenceLineLayerConfig) => XYReferenceLineLayerConfig; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.tsx index ef692b59a7eb7..340a9211fcdee 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/axis_settings_popover.tsx @@ -17,7 +17,11 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isEqual } from 'lodash'; -import { XYLayerConfig, AxesSettingsConfig, AxisExtentConfig } from '../../../common/expressions'; +import { + AxesSettingsConfig, + AxisExtentConfig, +} from '../../../../../../src/plugins/chart_expressions/expression_xy/common'; +import { XYLayerConfig } from '../types'; import { ToolbarPopover, useDebouncedValue, @@ -31,6 +35,7 @@ import { EuiIconAxisRight } from '../../assets/axis_right'; import { EuiIconAxisTop } from '../../assets/axis_top'; import { ToolbarButtonProps } from '../../../../../../src/plugins/kibana_react/public'; import { validateExtent } from '../axes_configuration'; + import './axis_settings_popover.scss'; type AxesSettingsConfigKeys = keyof AxesSettingsConfig; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/color_picker.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/color_picker.tsx index b448ebfbd455e..3f801fb92876d 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/color_picker.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/color_picker.tsx @@ -11,7 +11,7 @@ import { EuiFormRow, EuiColorPicker, EuiColorPickerProps, EuiToolTip, EuiIcon } import type { PaletteRegistry } from 'src/plugins/charts/public'; import { defaultAnnotationColor } from '../../../../../../src/plugins/event_annotation/public'; import type { VisualizationDimensionEditorProps } from '../../types'; -import { State } from '../types'; +import { State, XYDataLayerConfig } from '../types'; import { FormatFactory } from '../../../common'; import { getSeriesColor } from '../state_helpers'; import { @@ -67,6 +67,7 @@ export const ColorPicker = ({ return defaultAnnotationColor; } + const dataLayer: XYDataLayerConfig = layer; const sortedAccessors: string[] = getSortedAccessors( frame.datasourceLayers[layer.layerId] ?? layer.accessors, layer @@ -81,8 +82,8 @@ export const ColorPicker = ({ colorAssignments, frame, { - ...layer, - accessors: sortedAccessors.filter((sorted) => layer.accessors.includes(sorted)), + ...dataLayer, + accessors: sortedAccessors.filter((sorted) => dataLayer.accessors.includes(sorted)), }, paletteService ); diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/dimension_editor.tsx index 1618bd4d0e540..b3e13ece50434 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/dimension_editor.tsx @@ -10,12 +10,18 @@ import { i18n } from '@kbn/i18n'; import { EuiButtonGroup, EuiFormRow, htmlIdGenerator } from '@elastic/eui'; import type { PaletteRegistry } from 'src/plugins/charts/public'; import type { VisualizationDimensionEditorProps } from '../../types'; -import { State, XYState } from '../types'; +import { State, XYState, XYDataLayerConfig } from '../types'; import { FormatFactory } from '../../../common'; -import { XYDataLayerConfig, YAxisMode, YConfig } from '../../../common/expressions'; +import { + YAxisMode, + YConfig, +} from '../../../../../../src/plugins/chart_expressions/expression_xy/common'; import { isHorizontalChart } from '../state_helpers'; import { ColorPicker } from './color_picker'; import { PalettePicker, useDebouncedValue } from '../../shared_components'; +import { isAnnotationsLayer, isReferenceLayer } from '../visualization_helpers'; +import { ReferenceLinePanel } from './reference_line_panel'; +import { AnnotationsPanel } from '../annotations/config_panel'; type UnwrapArray = T extends Array ? P : T; @@ -43,16 +49,14 @@ export function DimensionEditor( ) { const { state, setState, layerId, accessor } = props; const index = state.layers.findIndex((l) => l.layerId === layerId); + const layer = state.layers[index] as XYDataLayerConfig; const { inputValue: localState, handleInputChange: setLocalState } = useDebouncedValue({ value: props.state, onChange: props.setState, }); - const localLayer = localState.layers.find((l) => l.layerId === layerId) as XYDataLayerConfig; - const localYConfig = localLayer?.yConfig?.find( - (yAxisConfig) => yAxisConfig.forAccessor === accessor - ); + const localYConfig = layer?.yConfig?.find((yAxisConfig) => yAxisConfig.forAccessor === accessor); const axisMode = localYConfig?.axisMode || 'auto'; const setConfig = useCallback( @@ -60,7 +64,7 @@ export function DimensionEditor( if (yConfig == null) { return; } - const newYConfigs = [...(localLayer.yConfig || [])]; + const newYConfigs = [...(layer.yConfig || [])]; const existingIndex = newYConfigs.findIndex( (yAxisConfig) => yAxisConfig.forAccessor === accessor ); @@ -72,11 +76,20 @@ export function DimensionEditor( ...yConfig, }); } - setLocalState(updateLayer(localState, { ...localLayer, yConfig: newYConfigs }, index)); + setLocalState(updateLayer(localState, { ...layer, yConfig: newYConfigs }, index)); }, - [accessor, index, localState, localLayer, setLocalState] + [accessor, index, localState, layer, setLocalState] ); + if (isAnnotationsLayer(layer)) { + return ; + } + + if (isReferenceLayer(layer)) { + return ; + } + + const localLayer: XYDataLayerConfig = layer; if (props.groupId === 'breakdown') { return ( <> diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/index.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/index.tsx index 1684d822b5576..42cf49c04fbd8 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/index.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/index.tsx @@ -11,7 +11,10 @@ import { Position, ScaleType, VerticalAlignment, HorizontalAlignment } from '@el import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import type { VisualizationToolbarProps, FramePublicAPI } from '../../types'; import { State, XYState } from '../types'; -import { AxesSettingsConfig, AxisExtentConfig } from '../../../common/expressions'; +import { + AxesSettingsConfig, + AxisExtentConfig, +} from '../../../../../../src/plugins/chart_expressions/expression_xy/common'; import { isHorizontalChart } from '../state_helpers'; import { LegendSettingsPopover } from '../../shared_components'; import { AxisSettingsPopover } from './axis_settings_popover'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/layer_header.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/layer_header.tsx index c4e5268cfb8af..2aabf255c5993 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/layer_header.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/layer_header.tsx @@ -9,8 +9,8 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiIcon, EuiPopover, EuiSelectable, EuiText, EuiPopoverTitle } from '@elastic/eui'; import type { VisualizationLayerWidgetProps, VisualizationType } from '../../types'; -import { State, visualizationTypes } from '../types'; -import { SeriesType, XYDataLayerConfig } from '../../../common/expressions'; +import { State, visualizationTypes, XYDataLayerConfig } from '../types'; +import { SeriesType } from '../../../../../../src/plugins/chart_expressions/expression_xy/common'; import { isHorizontalChart, isHorizontalSeries } from '../state_helpers'; import { trackUiEvent } from '../../lens_ui_telemetry'; import { StaticHeader } from '../../shared_components'; @@ -58,8 +58,9 @@ function AnnotationsLayerHeader() { function DataLayerHeader(props: VisualizationLayerWidgetProps) { const [isPopoverOpen, setPopoverIsOpen] = useState(false); const { state, layerId } = props; - const index = state.layers.findIndex((l) => l.layerId === layerId); - const layer = state.layers[index] as XYDataLayerConfig; + const layers = state.layers as XYDataLayerConfig[]; + const index = layers.findIndex((l) => l.layerId === layerId); + const layer = layers[index]; const currentVisType = visualizationTypes.find(({ id }) => id === layer.seriesType)!; const horizontalOnly = isHorizontalChart(state.layers); diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/reference_line_panel.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/reference_line_panel.tsx index 78020034c3d43..ffca2c0531b7c 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/reference_line_panel.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/reference_line_panel.tsx @@ -10,10 +10,12 @@ import { i18n } from '@kbn/i18n'; import { EuiButtonGroup, EuiFormRow } from '@elastic/eui'; import type { PaletteRegistry } from 'src/plugins/charts/public'; import type { VisualizationDimensionEditorProps } from '../../types'; -import { State, XYState } from '../types'; +import { State, XYState, XYReferenceLineLayerConfig } from '../types'; import { FormatFactory } from '../../../common'; -import { YConfig } from '../../../common/expressions'; -import { FillStyle, XYReferenceLineLayerConfig } from '../../../common/expressions/xy_chart'; +import { + FillStyle, + YConfig, +} from '../../../../../../src/plugins/chart_expressions/expression_xy/common'; import { ColorPicker } from './color_picker'; import { updateLayer } from '.'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/line_style_settings.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/line_style_settings.tsx index 766d5462db787..8ae86c2fd5b46 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/line_style_settings.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/line_style_settings.tsx @@ -14,7 +14,8 @@ import { EuiFlexItem, EuiFormRow, } from '@elastic/eui'; -import { LineStyle } from '../../../../common/expressions/xy_chart'; +import { LineStyle } from '../../../../../../../src/plugins/chart_expressions/expression_xy/common'; + import { idPrefix } from '../dimension_editor'; interface LineStyleConfig { diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/marker_decoration_settings.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/marker_decoration_settings.tsx index 134d72b7de64b..b3736cdbf3dfe 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/marker_decoration_settings.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/marker_decoration_settings.tsx @@ -8,7 +8,10 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiButtonGroup, EuiFormRow } from '@elastic/eui'; -import { IconPosition, YAxisMode } from '../../../../common/expressions/xy_chart'; +import { + IconPosition, + YAxisMode, +} from '../../../../../../../src/plugins/chart_expressions/expression_xy/common'; import { TooltipWrapper } from '../../../shared_components'; import { hasIcon, IconSelect, IconSet } from './icon_select'; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/end_value.ts b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/end_value_definitions.ts similarity index 85% rename from x-pack/plugins/lens/common/expressions/xy_chart/end_value.ts rename to x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/end_value_definitions.ts index 1ef664cb2e2ba..1ecd260b04a30 100644 --- a/x-pack/plugins/lens/common/expressions/xy_chart/end_value.ts +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/end_value_definitions.ts @@ -6,10 +6,9 @@ */ import { i18n } from '@kbn/i18n'; +import type { EndValue } from '../../../../../../../src/plugins/chart_expressions/expression_xy/common'; -export type EndValue = typeof endValueDefinitions[number]['id']; - -export const endValueDefinitions = [ +export const endValueDefinitions: Array<{ id: EndValue } & Record> = [ { id: 'None', title: i18n.translate('xpack.lens.endValue.none', { @@ -37,4 +36,4 @@ export const endValueDefinitions = [ defaultMessage: 'Extend series with the first/last value to the edge of the chart', }), }, -] as const; +]; diff --git a/x-pack/plugins/lens/common/expressions/xy_chart/fitting_function.ts b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/fitting_function_definitions.ts similarity index 88% rename from x-pack/plugins/lens/common/expressions/xy_chart/fitting_function.ts rename to x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/fitting_function_definitions.ts index 0cfea62d578d7..a357f7c2f92ca 100644 --- a/x-pack/plugins/lens/common/expressions/xy_chart/fitting_function.ts +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/fitting_function_definitions.ts @@ -6,10 +6,9 @@ */ import { i18n } from '@kbn/i18n'; +import type { FittingFunction } from '../../../../../../../src/plugins/chart_expressions/expression_xy/common'; -export type FittingFunction = typeof fittingFunctionDefinitions[number]['id']; - -export const fittingFunctionDefinitions = [ +export const fittingFunctionDefinitions: Array<{ id: FittingFunction } & Record> = [ { id: 'None', title: i18n.translate('xpack.lens.fittingFunctionsTitle.none', { @@ -55,4 +54,4 @@ export const fittingFunctionDefinitions = [ defaultMessage: 'Fill gaps with the next value', }), }, -] as const; +]; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/index.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/index.tsx index 0bdd513c1f881..00903e1107c91 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/index.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/index.tsx @@ -13,7 +13,7 @@ import { LineCurveOption } from './line_curve_option'; import { FillOpacityOption } from './fill_opacity_option'; import { XYState } from '../../types'; import { hasHistogramSeries } from '../../state_helpers'; -import { ValidLayer } from '../../../../common/expressions'; +import { ValidLayer } from '../../../../../../../src/plugins/chart_expressions/expression_xy/common'; import type { FramePublicAPI } from '../../../types'; import { getDataLayers } from '../../visualization_helpers'; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/line_curve_option.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/line_curve_option.tsx index 96926412afb8a..9e69c427d99fe 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/line_curve_option.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/line_curve_option.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiSwitch } from '@elastic/eui'; -import type { XYCurveType } from '../../../../common/expressions'; +import type { XYCurveType } from '../../../../../../../src/plugins/chart_expressions/expression_xy/common'; export interface LineCurveOptionProps { /** diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/missing_values_option.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/missing_values_option.tsx index 9bd59cb5c4a08..645b740fc9dad 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/missing_values_option.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/missing_values_option.tsx @@ -8,8 +8,12 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiIconTip, EuiSuperSelect, EuiSwitch, EuiText } from '@elastic/eui'; -import { fittingFunctionDefinitions, endValueDefinitions } from '../../../../common/expressions'; -import type { FittingFunction, EndValue } from '../../../../common/expressions'; +import { fittingFunctionDefinitions } from './fitting_function_definitions'; +import { endValueDefinitions } from './end_value_definitions'; +import type { + FittingFunction, + EndValue, +} from '../../../../../../../src/plugins/chart_expressions/expression_xy/common'; export interface MissingValuesOptionProps { fittingFunction?: FittingFunction; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/visual_options_popover.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/visual_options_popover.test.tsx index 4e2be2f0e4749..5b91ee70c6945 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/visual_options_popover.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/visual_options_popover/visual_options_popover.test.tsx @@ -10,13 +10,12 @@ import { shallowWithIntl as shallow } from '@kbn/test-jest-helpers'; import { Position } from '@elastic/charts'; import type { FramePublicAPI } from '../../../types'; import { createMockDatasource, createMockFramePublicAPI } from '../../../mocks'; -import { State } from '../../types'; +import { State, XYLayerConfig } from '../../types'; import { VisualOptionsPopover } from '.'; import { ToolbarPopover, ValueLabelsSettings } from '../../../shared_components'; import { MissingValuesOptions } from './missing_values_option'; import { FillOpacityOption } from './fill_opacity_option'; import { layerTypes } from '../../../../common'; -import { XYDataLayerConfig } from '../../../../common/expressions'; describe('Visual options popover', () => { let frame: FramePublicAPI; @@ -53,7 +52,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [{ ...state.layers[0], seriesType: 'bar_stacked' } as XYDataLayerConfig], + layers: [{ ...state.layers[0], seriesType: 'bar_stacked' } as XYLayerConfig], }} /> ); @@ -69,9 +68,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [ - { ...state.layers[0], seriesType: 'area_percentage_stacked' } as XYDataLayerConfig, - ], + layers: [{ ...state.layers[0], seriesType: 'area_percentage_stacked' } as XYLayerConfig], }} /> ); @@ -88,9 +85,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [ - { ...state.layers[0], seriesType: 'area_percentage_stacked' } as XYDataLayerConfig, - ], + layers: [{ ...state.layers[0], seriesType: 'area_percentage_stacked' } as XYLayerConfig], }} /> ); @@ -106,9 +101,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [ - { ...state.layers[0], seriesType: 'area_percentage_stacked' } as XYDataLayerConfig, - ], + layers: [{ ...state.layers[0], seriesType: 'area_percentage_stacked' } as XYLayerConfig], }} /> ); @@ -145,7 +138,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [{ ...state.layers[0], seriesType: 'bar_horizontal' } as XYDataLayerConfig], + layers: [{ ...state.layers[0], seriesType: 'bar_horizontal' } as XYLayerConfig], fittingFunction: 'Carry', }} /> @@ -162,7 +155,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [{ ...state.layers[0], seriesType: 'bar_horizontal' } as XYDataLayerConfig], + layers: [{ ...state.layers[0], seriesType: 'bar_horizontal' } as XYLayerConfig], fittingFunction: 'Carry', }} /> @@ -179,7 +172,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [{ ...state.layers[0], seriesType: 'line' } as XYDataLayerConfig], + layers: [{ ...state.layers[0], seriesType: 'line' } as XYLayerConfig], fittingFunction: 'Carry', }} /> @@ -197,7 +190,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [{ ...state.layers[0], seriesType: 'bar_horizontal' } as XYDataLayerConfig], + layers: [{ ...state.layers[0], seriesType: 'bar_horizontal' } as XYLayerConfig], fittingFunction: 'Carry', }} /> @@ -214,7 +207,7 @@ describe('Visual options popover', () => { setState={jest.fn()} state={{ ...state, - layers: [{ ...state.layers[0], seriesType: 'area' } as XYDataLayerConfig], + layers: [{ ...state.layers[0], seriesType: 'area' } as XYLayerConfig], fittingFunction: 'Carry', }} /> @@ -237,7 +230,7 @@ describe('Visual options popover', () => { state={{ ...state, layers: [ - { ...state.layers[0], seriesType: 'bar' } as XYDataLayerConfig, + { ...state.layers[0], seriesType: 'bar' } as XYLayerConfig, { seriesType: 'bar', layerType: layerTypes.DATA, diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/xy_config_panel.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/xy_config_panel.test.tsx index a73d14ad15573..953828db48a72 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/xy_config_panel.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_config_panel/xy_config_panel.test.tsx @@ -12,13 +12,12 @@ import { XyToolbar } from '.'; import { DimensionEditor } from './dimension_editor'; import { AxisSettingsPopover } from './axis_settings_popover'; import { FramePublicAPI } from '../../types'; -import { State, XYState } from '../types'; +import { State, XYState, XYDataLayerConfig } from '../types'; import { Position } from '@elastic/charts'; import { createMockFramePublicAPI, createMockDatasource } from '../../mocks'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import { EuiColorPicker } from '@elastic/eui'; import { layerTypes } from '../../../common'; -import { XYDataLayerConfig } from '../../../common/expressions'; describe('XY Config panels', () => { let frame: FramePublicAPI; diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts index 2c3483e40b955..941e50d6e5285 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts @@ -7,7 +7,13 @@ import { getSuggestions } from './xy_suggestions'; import type { TableSuggestionColumn, VisualizationSuggestion, TableSuggestion } from '../types'; -import { State, XYState, visualizationTypes } from './types'; +import { + State, + XYState, + visualizationTypes, + XYAnnotationLayerConfig, + XYDataLayerConfig, +} from './types'; import { generateId } from '../id_generator'; import { getXyVisualization } from './xy_visualization'; import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks'; @@ -16,7 +22,6 @@ import { PaletteOutput } from 'src/plugins/charts/public'; import { layerTypes } from '../../common'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; import { themeServiceMock } from '../../../../../src/core/public/mocks'; -import { XYAnnotationLayerConfig, XYDataLayerConfig } from '../../common/expressions'; jest.mock('../id_generator'); diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.ts b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.ts index bd5a37c206c6c..610e21c1fe138 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.ts +++ b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.ts @@ -16,8 +16,8 @@ import { TableSuggestion, TableChangeType, } from '../types'; -import { State, XYState, visualizationTypes } from './types'; -import type { SeriesType, XYDataLayerConfig } from '../../common/expressions'; +import { State, XYState, visualizationTypes, XYLayerConfig, XYDataLayerConfig } from './types'; +import type { SeriesType } from '../../../../../src/plugins/chart_expressions/expression_xy/common'; import { layerTypes } from '../../common'; import { getIconForSeries } from './state_helpers'; import { getDataLayers, isDataLayer } from './visualization_helpers'; @@ -499,26 +499,29 @@ function buildSuggestion({ splitBy = xValue; xValue = undefined; } - const existingLayer: XYDataLayerConfig | {} = - getExistingLayer(currentState, layerId) || ({} as XYDataLayerConfig); + const existingLayer = getExistingLayer(currentState, layerId) || null; const accessors = yValues.map((col) => col.columnId); - const newLayer = { - ...existingLayer, - palette: mainPalette || ('palette' in existingLayer ? existingLayer.palette : undefined), + const newLayer: XYDataLayerConfig = { + ...(existingLayer || {}), + palette: + mainPalette || + (existingLayer && 'palette' in existingLayer + ? (existingLayer as XYDataLayerConfig).palette + : undefined), layerId, seriesType, xAccessor: xValue?.columnId, splitAccessor: splitBy?.columnId, accessors, yConfig: - 'yConfig' in existingLayer && existingLayer.yConfig + existingLayer && 'yConfig' in existingLayer && existingLayer.yConfig ? existingLayer.yConfig.filter(({ forAccessor }) => accessors.indexOf(forAccessor) !== -1) : undefined, layerType: layerTypes.DATA, }; // Maintain consistent order for any layers that were saved - const keptLayers = currentState + const keptLayers: XYLayerConfig[] = currentState ? currentState.layers // Remove layers that aren't being suggested .filter( @@ -568,7 +571,8 @@ function buildSuggestion({ yRight: true, }, preferredSeriesType: seriesType, - layers: Object.keys(existingLayer).length ? keptLayers : [...keptLayers, newLayer], + layers: + existingLayer && Object.keys(existingLayer).length ? keptLayers : [...keptLayers, newLayer], }; return { diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_visualization.ts b/x-pack/plugins/lens/public/xy_visualization/xy_visualization.ts index 894b003b4b371..7b9fa15413a57 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_visualization.ts +++ b/x-pack/plugins/lens/public/xy_visualization/xy_visualization.ts @@ -5,6 +5,5 @@ * 2.0. */ -export * from './expression'; export * from './types'; export * from './visualization'; diff --git a/x-pack/plugins/lens/server/expressions/expressions.ts b/x-pack/plugins/lens/server/expressions/expressions.ts index c68fed23a7fdb..9b23c1741556a 100644 --- a/x-pack/plugins/lens/server/expressions/expressions.ts +++ b/x-pack/plugins/lens/server/expressions/expressions.ts @@ -7,19 +7,9 @@ import type { CoreSetup } from 'kibana/server'; import { - xyChart, counterRate, - yAxisConfig, - dataLayerConfig, - referenceLineLayerConfig, - annotationLayerConfig, formatColumn, - legendConfig, renameColumns, - gridlinesConfig, - datatableColumn, - tickLabelsConfig, - axisTitlesVisibilityConfig, getTimeScale, getDatatable, lensMultitable, @@ -36,19 +26,9 @@ export const setupExpressions = ( [lensMultitable].forEach((expressionType) => expressions.registerType(expressionType)); [ - xyChart, counterRate, - yAxisConfig, - dataLayerConfig, - referenceLineLayerConfig, - annotationLayerConfig, formatColumn, - legendConfig, renameColumns, - gridlinesConfig, - datatableColumn, - tickLabelsConfig, - axisTitlesVisibilityConfig, getDatatable(getFormatFactory(core)), getTimeScale(getTimeZoneFactory(core)), ].forEach((expressionFn) => expressions.registerFunction(expressionFn)); diff --git a/x-pack/plugins/lens/server/migrations/saved_object_migrations.test.ts b/x-pack/plugins/lens/server/migrations/saved_object_migrations.test.ts index 61342af5033dd..6760dfd084b94 100644 --- a/x-pack/plugins/lens/server/migrations/saved_object_migrations.test.ts +++ b/x-pack/plugins/lens/server/migrations/saved_object_migrations.test.ts @@ -200,10 +200,10 @@ describe('Lens migrations', () => { } | lens_rename_columns idMap="{\\"col-0-1d9cc16c-1460-41de-88f8-471932ecbc97\\":{\\"label\\":\\"products.created_on\\",\\"dataType\\":\\"date\\",\\"operationType\\":\\"date_histogram\\",\\"sourceField\\":\\"products.created_on\\",\\"isBucketed\\":true,\\"scale\\":\\"interval\\",\\"params\\":{\\"interval\\":\\"auto\\"},\\"id\\":\\"1d9cc16c-1460-41de-88f8-471932ecbc97\\"},\\"col-1-66115819-8481-4917-a6dc-8ffb10dd02df\\":{\\"label\\":\\"Count of records\\",\\"dataType\\":\\"number\\",\\"operationType\\":\\"count\\",\\"suggestedPriority\\":0,\\"isBucketed\\":false,\\"scale\\":\\"ratio\\",\\"sourceField\\":\\"Records\\",\\"id\\":\\"66115819-8481-4917-a6dc-8ffb10dd02df\\"}}" } - | lens_xy_chart + | xyVis xTitle="products.created_on" yTitle="Count of records" - legend={lens_xy_legendConfig isVisible=true position="right"} + legend={legendConfig isVisible=true position="right"} layers={lens_xy_layer layerId="bd09dc71-a7e2-42d0-83bd-85df8291f03c" hide=false @@ -293,7 +293,7 @@ describe('Lens migrations', () => { | kibana_context query="{\\"query\\":\\"\\",\\"language\\":\\"kuery\\"}" filters="[]" | lens_merge_tables layerIds="bd09dc71-a7e2-42d0-83bd-85df8291f03c" tables={esaggs index="ff959d40-b880-11e8-a6d9-e546fe2bba5f" metricsAtAllLevels=false partialRows=false includeFormatHints=true aggConfigs="[{\\"id\\":\\"1d9cc16c-1460-41de-88f8-471932ecbc97\\",\\"enabled\\":true,\\"type\\":\\"date_histogram\\",\\"schema\\":\\"segment\\",\\"params\\":{\\"field\\":\\"products.created_on\\",\\"useNormalizedEsInterval\\":true,\\"interval\\":\\"auto\\",\\"drop_partials\\":false,\\"min_doc_count\\":0,\\"extended_bounds\\":{}}},{\\"id\\":\\"66115819-8481-4917-a6dc-8ffb10dd02df\\",\\"enabled\\":true,\\"type\\":\\"count\\",\\"schema\\":\\"metric\\",\\"params\\":{}}]" timeFields=\"products.created_on\"} -| lens_xy_chart xTitle="products.created_on" yTitle="Count of records" legend={lens_xy_legendConfig isVisible=true position="right"} layers={}`, +| xyVis xTitle="products.created_on" yTitle="Count of records" legend={legendConfig isVisible=true position="right"} layers={}`, }, }; const result = migrations['7.8.0'](input, context); @@ -309,7 +309,7 @@ describe('Lens migrations', () => { attributes: { description: '', expression: - 'kibana\n| kibana_context query="{\\"query\\":\\"NOT bytes > 5000\\",\\"language\\":\\"kuery\\"}" \n filters="[{\\"meta\\":{\\"index\\":\\"90943e30-9a47-11e8-b64d-95841ca0b247\\",\\"alias\\":null,\\"negate\\":true,\\"disabled\\":false,\\"type\\":\\"phrase\\",\\"key\\":\\"geo.src\\",\\"params\\":{\\"query\\":\\"CN\\"}},\\"query\\":{\\"match_phrase\\":{\\"geo.src\\":\\"CN\\"}},\\"$state\\":{\\"store\\":\\"appState\\"}},{\\"meta\\":{\\"index\\":\\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\\",\\"alias\\":null,\\"negate\\":true,\\"disabled\\":false,\\"type\\":\\"phrase\\",\\"key\\":\\"geoip.country_iso_code\\",\\"params\\":{\\"query\\":\\"US\\"}},\\"query\\":{\\"match_phrase\\":{\\"geoip.country_iso_code\\":\\"US\\"}},\\"$state\\":{\\"store\\":\\"appState\\"}}]"\n| lens_merge_tables layerIds="9a27f85d-35a9-4246-81b2-48e7ee9b0707"\n layerIds="3b7791e9-326e-40d5-a787-b7594e48d906" \n tables={esaggs index="90943e30-9a47-11e8-b64d-95841ca0b247" metricsAtAllLevels=true partialRows=true includeFormatHints=true aggConfigs="[{\\"id\\":\\"96352896-c508-4fca-90d8-66e9ebfce621\\",\\"enabled\\":true,\\"type\\":\\"terms\\",\\"schema\\":\\"segment\\",\\"params\\":{\\"field\\":\\"geo.src\\",\\"orderBy\\":\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\",\\"order\\":\\"desc\\",\\"size\\":5,\\"otherBucket\\":false,\\"otherBucketLabel\\":\\"Other\\",\\"missingBucket\\":false,\\"missingBucketLabel\\":\\"Missing\\"}},{\\"id\\":\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\",\\"enabled\\":true,\\"type\\":\\"count\\",\\"schema\\":\\"metric\\",\\"params\\":{}}]" | lens_rename_columns idMap="{\\"col-0-96352896-c508-4fca-90d8-66e9ebfce621\\":{\\"label\\":\\"Top values of geo.src\\",\\"dataType\\":\\"string\\",\\"operationType\\":\\"terms\\",\\"scale\\":\\"ordinal\\",\\"sourceField\\":\\"geo.src\\",\\"isBucketed\\":true,\\"params\\":{\\"size\\":5,\\"orderBy\\":{\\"type\\":\\"column\\",\\"columnId\\":\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\"},\\"orderDirection\\":\\"desc\\"},\\"id\\":\\"96352896-c508-4fca-90d8-66e9ebfce621\\"},\\"col-1-4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\":{\\"label\\":\\"Count of records\\",\\"dataType\\":\\"number\\",\\"operationType\\":\\"count\\",\\"isBucketed\\":false,\\"scale\\":\\"ratio\\",\\"sourceField\\":\\"Records\\",\\"id\\":\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\"}}"}\n tables={esaggs index="ff959d40-b880-11e8-a6d9-e546fe2bba5f" metricsAtAllLevels=true partialRows=true includeFormatHints=true aggConfigs="[{\\"id\\":\\"77d8383e-f66e-471e-ae50-c427feedb5ba\\",\\"enabled\\":true,\\"type\\":\\"terms\\",\\"schema\\":\\"segment\\",\\"params\\":{\\"field\\":\\"geoip.country_iso_code\\",\\"orderBy\\":\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\",\\"order\\":\\"desc\\",\\"size\\":5,\\"otherBucket\\":false,\\"otherBucketLabel\\":\\"Other\\",\\"missingBucket\\":false,\\"missingBucketLabel\\":\\"Missing\\"}},{\\"id\\":\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\",\\"enabled\\":true,\\"type\\":\\"count\\",\\"schema\\":\\"metric\\",\\"params\\":{}}]" | lens_rename_columns idMap="{\\"col-0-77d8383e-f66e-471e-ae50-c427feedb5ba\\":{\\"label\\":\\"Top values of geoip.country_iso_code\\",\\"dataType\\":\\"string\\",\\"operationType\\":\\"terms\\",\\"scale\\":\\"ordinal\\",\\"sourceField\\":\\"geoip.country_iso_code\\",\\"isBucketed\\":true,\\"params\\":{\\"size\\":5,\\"orderBy\\":{\\"type\\":\\"column\\",\\"columnId\\":\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\"},\\"orderDirection\\":\\"desc\\"},\\"id\\":\\"77d8383e-f66e-471e-ae50-c427feedb5ba\\"},\\"col-1-a5c1b82d-51de-4448-a99d-6391432c3a03\\":{\\"label\\":\\"Count of records\\",\\"dataType\\":\\"number\\",\\"operationType\\":\\"count\\",\\"isBucketed\\":false,\\"scale\\":\\"ratio\\",\\"sourceField\\":\\"Records\\",\\"id\\":\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\"}}"}\n| lens_xy_chart xTitle="Top values of geo.src" yTitle="Count of records" legend={lens_xy_legendConfig isVisible=true position="right"} fittingFunction="None" \n layers={lens_xy_layer layerId="9a27f85d-35a9-4246-81b2-48e7ee9b0707" hide=false xAccessor="96352896-c508-4fca-90d8-66e9ebfce621" yScaleType="linear" xScaleType="ordinal" isHistogram=false seriesType="bar" accessors="4ce9b4c7-2ebf-4d48-8669-0ea69d973353" columnToLabel="{\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\":\\"Count of records\\"}"}\n layers={lens_xy_layer layerId="3b7791e9-326e-40d5-a787-b7594e48d906" hide=false xAccessor="77d8383e-f66e-471e-ae50-c427feedb5ba" yScaleType="linear" xScaleType="ordinal" isHistogram=false seriesType="bar" accessors="a5c1b82d-51de-4448-a99d-6391432c3a03" columnToLabel="{\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\":\\"Count of records [1]\\"}"}', + 'kibana\n| kibana_context query="{\\"query\\":\\"NOT bytes > 5000\\",\\"language\\":\\"kuery\\"}" \n filters="[{\\"meta\\":{\\"index\\":\\"90943e30-9a47-11e8-b64d-95841ca0b247\\",\\"alias\\":null,\\"negate\\":true,\\"disabled\\":false,\\"type\\":\\"phrase\\",\\"key\\":\\"geo.src\\",\\"params\\":{\\"query\\":\\"CN\\"}},\\"query\\":{\\"match_phrase\\":{\\"geo.src\\":\\"CN\\"}},\\"$state\\":{\\"store\\":\\"appState\\"}},{\\"meta\\":{\\"index\\":\\"ff959d40-b880-11e8-a6d9-e546fe2bba5f\\",\\"alias\\":null,\\"negate\\":true,\\"disabled\\":false,\\"type\\":\\"phrase\\",\\"key\\":\\"geoip.country_iso_code\\",\\"params\\":{\\"query\\":\\"US\\"}},\\"query\\":{\\"match_phrase\\":{\\"geoip.country_iso_code\\":\\"US\\"}},\\"$state\\":{\\"store\\":\\"appState\\"}}]"\n| lens_merge_tables layerIds="9a27f85d-35a9-4246-81b2-48e7ee9b0707"\n layerIds="3b7791e9-326e-40d5-a787-b7594e48d906" \n tables={esaggs index="90943e30-9a47-11e8-b64d-95841ca0b247" metricsAtAllLevels=true partialRows=true includeFormatHints=true aggConfigs="[{\\"id\\":\\"96352896-c508-4fca-90d8-66e9ebfce621\\",\\"enabled\\":true,\\"type\\":\\"terms\\",\\"schema\\":\\"segment\\",\\"params\\":{\\"field\\":\\"geo.src\\",\\"orderBy\\":\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\",\\"order\\":\\"desc\\",\\"size\\":5,\\"otherBucket\\":false,\\"otherBucketLabel\\":\\"Other\\",\\"missingBucket\\":false,\\"missingBucketLabel\\":\\"Missing\\"}},{\\"id\\":\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\",\\"enabled\\":true,\\"type\\":\\"count\\",\\"schema\\":\\"metric\\",\\"params\\":{}}]" | lens_rename_columns idMap="{\\"col-0-96352896-c508-4fca-90d8-66e9ebfce621\\":{\\"label\\":\\"Top values of geo.src\\",\\"dataType\\":\\"string\\",\\"operationType\\":\\"terms\\",\\"scale\\":\\"ordinal\\",\\"sourceField\\":\\"geo.src\\",\\"isBucketed\\":true,\\"params\\":{\\"size\\":5,\\"orderBy\\":{\\"type\\":\\"column\\",\\"columnId\\":\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\"},\\"orderDirection\\":\\"desc\\"},\\"id\\":\\"96352896-c508-4fca-90d8-66e9ebfce621\\"},\\"col-1-4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\":{\\"label\\":\\"Count of records\\",\\"dataType\\":\\"number\\",\\"operationType\\":\\"count\\",\\"isBucketed\\":false,\\"scale\\":\\"ratio\\",\\"sourceField\\":\\"Records\\",\\"id\\":\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\"}}"}\n tables={esaggs index="ff959d40-b880-11e8-a6d9-e546fe2bba5f" metricsAtAllLevels=true partialRows=true includeFormatHints=true aggConfigs="[{\\"id\\":\\"77d8383e-f66e-471e-ae50-c427feedb5ba\\",\\"enabled\\":true,\\"type\\":\\"terms\\",\\"schema\\":\\"segment\\",\\"params\\":{\\"field\\":\\"geoip.country_iso_code\\",\\"orderBy\\":\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\",\\"order\\":\\"desc\\",\\"size\\":5,\\"otherBucket\\":false,\\"otherBucketLabel\\":\\"Other\\",\\"missingBucket\\":false,\\"missingBucketLabel\\":\\"Missing\\"}},{\\"id\\":\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\",\\"enabled\\":true,\\"type\\":\\"count\\",\\"schema\\":\\"metric\\",\\"params\\":{}}]" | lens_rename_columns idMap="{\\"col-0-77d8383e-f66e-471e-ae50-c427feedb5ba\\":{\\"label\\":\\"Top values of geoip.country_iso_code\\",\\"dataType\\":\\"string\\",\\"operationType\\":\\"terms\\",\\"scale\\":\\"ordinal\\",\\"sourceField\\":\\"geoip.country_iso_code\\",\\"isBucketed\\":true,\\"params\\":{\\"size\\":5,\\"orderBy\\":{\\"type\\":\\"column\\",\\"columnId\\":\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\"},\\"orderDirection\\":\\"desc\\"},\\"id\\":\\"77d8383e-f66e-471e-ae50-c427feedb5ba\\"},\\"col-1-a5c1b82d-51de-4448-a99d-6391432c3a03\\":{\\"label\\":\\"Count of records\\",\\"dataType\\":\\"number\\",\\"operationType\\":\\"count\\",\\"isBucketed\\":false,\\"scale\\":\\"ratio\\",\\"sourceField\\":\\"Records\\",\\"id\\":\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\"}}"}\n| xyVis xTitle="Top values of geo.src" yTitle="Count of records" legend={legendConfig isVisible=true position="right"} fittingFunction="None" \n layers={lens_xy_layer layerId="9a27f85d-35a9-4246-81b2-48e7ee9b0707" hide=false xAccessor="96352896-c508-4fca-90d8-66e9ebfce621" yScaleType="linear" xScaleType="ordinal" isHistogram=false seriesType="bar" accessors="4ce9b4c7-2ebf-4d48-8669-0ea69d973353" columnToLabel="{\\"4ce9b4c7-2ebf-4d48-8669-0ea69d973353\\":\\"Count of records\\"}"}\n layers={lens_xy_layer layerId="3b7791e9-326e-40d5-a787-b7594e48d906" hide=false xAccessor="77d8383e-f66e-471e-ae50-c427feedb5ba" yScaleType="linear" xScaleType="ordinal" isHistogram=false seriesType="bar" accessors="a5c1b82d-51de-4448-a99d-6391432c3a03" columnToLabel="{\\"a5c1b82d-51de-4448-a99d-6391432c3a03\\":\\"Count of records [1]\\"}"}', state: { datasourceMetaData: { filterableIndexPatterns: [ diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index 76e25f8b08639..eae5536012314 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -14,86 +14,33 @@ "../../../typings/**/*" ], "references": [ - { - "path": "../spaces/tsconfig.json" - }, - { - "path": "../../../src/core/tsconfig.json" - }, - { - "path": "../task_manager/tsconfig.json" - }, - { - "path": "../global_search/tsconfig.json" - }, - { - "path": "../saved_objects_tagging/tsconfig.json" - }, - { - "path": "../../../src/plugins/data/tsconfig.json" - }, - { - "path": "../../../src/plugins/data_views/tsconfig.json" - }, - { - "path": "../../../src/plugins/data_view_field_editor/tsconfig.json" - }, - { - "path": "../../../src/plugins/charts/tsconfig.json" - }, - { - "path": "../../../src/plugins/expressions/tsconfig.json" - }, - { - "path": "../../../src/plugins/navigation/tsconfig.json" - }, - { - "path": "../../../src/plugins/url_forwarding/tsconfig.json" - }, - { - "path": "../../../src/plugins/visualizations/tsconfig.json" - }, - { - "path": "../../../src/plugins/dashboard/tsconfig.json" - }, - { - "path": "../../../src/plugins/ui_actions/tsconfig.json" - }, - { - "path": "../../../src/plugins/embeddable/tsconfig.json" - }, - { - "path": "../../../src/plugins/share/tsconfig.json" - }, - { - "path": "../../../src/plugins/usage_collection/tsconfig.json" - }, - { - "path": "../../../src/plugins/saved_objects/tsconfig.json" - }, - { - "path": "../../../src/plugins/kibana_utils/tsconfig.json" - }, - { - "path": "../../../src/plugins/kibana_react/tsconfig.json" - }, - { - "path": "../../../src/plugins/embeddable/tsconfig.json" - }, - { - "path": "../../../src/plugins/presentation_util/tsconfig.json" - }, - { - "path": "../../../src/plugins/field_formats/tsconfig.json" - }, - { - "path": "../../../src/plugins/chart_expressions/expression_heatmap/tsconfig.json" - }, - { - "path": "../../../src/plugins/chart_expressions/expression_gauge/tsconfig.json" - }, - { - "path": "../../../src/plugins/event_annotation/tsconfig.json" - } + { "path": "../spaces/tsconfig.json" }, + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../task_manager/tsconfig.json" }, + { "path": "../global_search/tsconfig.json"}, + { "path": "../saved_objects_tagging/tsconfig.json"}, + { "path": "../../../src/plugins/data/tsconfig.json"}, + { "path": "../../../src/plugins/data_views/tsconfig.json"}, + { "path": "../../../src/plugins/data_view_field_editor/tsconfig.json"}, + { "path": "../../../src/plugins/charts/tsconfig.json"}, + { "path": "../../../src/plugins/expressions/tsconfig.json"}, + { "path": "../../../src/plugins/navigation/tsconfig.json" }, + { "path": "../../../src/plugins/url_forwarding/tsconfig.json" }, + { "path": "../../../src/plugins/visualizations/tsconfig.json" }, + { "path": "../../../src/plugins/dashboard/tsconfig.json" }, + { "path": "../../../src/plugins/ui_actions/tsconfig.json" }, + { "path": "../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../../src/plugins/share/tsconfig.json" }, + { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, + { "path": "../../../src/plugins/saved_objects/tsconfig.json"}, + { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../../../src/plugins/embeddable/tsconfig.json"}, + { "path": "../../../src/plugins/presentation_util/tsconfig.json"}, + { "path": "../../../src/plugins/field_formats/tsconfig.json"}, + { "path": "../../../src/plugins/chart_expressions/expression_xy/tsconfig.json"}, + { "path": "../../../src/plugins/chart_expressions/expression_heatmap/tsconfig.json"}, + { "path": "../../../src/plugins/chart_expressions/expression_gauge/tsconfig.json"}, + { "path": "../../../src/plugins/event_annotation/tsconfig.json" } ] } \ No newline at end of file diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/file_upload_wizard/config.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/file_upload_wizard/config.tsx index e0852b6f9300f..fa11f192c9a99 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/file_upload_wizard/config.tsx +++ b/x-pack/plugins/maps/public/classes/layers/wizards/file_upload_wizard/config.tsx @@ -25,7 +25,7 @@ export const uploadLayerWizardConfig: LayerWizard = { }), getIsDisabled: async () => { const hasImportPermission = await getFileUpload().hasImportPermission({ - checkCreateIndexPattern: true, + checkCreateDataView: true, checkHasManagePipeline: false, }); return !hasImportPermission; diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/new_vector_layer_wizard/config.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/new_vector_layer_wizard/config.tsx index c5aa0fc7db1fd..18bb3cde2ca87 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/new_vector_layer_wizard/config.tsx +++ b/x-pack/plugins/maps/public/classes/layers/wizards/new_vector_layer_wizard/config.tsx @@ -28,7 +28,7 @@ export const newVectorLayerWizardConfig: LayerWizard = { }), getIsDisabled: async () => { const hasImportPermission = await getFileUpload().hasImportPermission({ - checkCreateIndexPattern: true, + checkCreateDataView: true, checkHasManagePipeline: false, }); return !hasImportPermission; diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/new_vector_layer_wizard/wizard.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/new_vector_layer_wizard/wizard.tsx index 2fd783a657034..d098984faaa7a 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/new_vector_layer_wizard/wizard.tsx +++ b/x-pack/plugins/maps/public/classes/layers/wizards/new_vector_layer_wizard/wizard.tsx @@ -74,7 +74,7 @@ export class NewVectorLayerEditor extends Component; } @@ -190,6 +191,7 @@ export interface AllocatedModel { last_access?: number; number_of_pending_requests: number; start_time: number; + throughput_last_minute: number; }; } diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx index d3c8d9c17e17a..a50844bdac26f 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { FC, useEffect, useState } from 'react'; +import React, { FC, useEffect, useState, useMemo, useCallback } from 'react'; import { omit, pick } from 'lodash'; import { EuiBadge, @@ -17,18 +17,19 @@ import { EuiPanel, EuiSpacer, EuiTabbedContent, - EuiTitle, EuiTabbedContentTab, + EuiTitle, } from '@elastic/eui'; import type { EuiDescriptionListProps } from '@elastic/eui/src/components/description_list/description_list'; import { FormattedMessage } from '@kbn/i18n-react'; import type { ModelItemFull } from './models_list'; -import { timeFormatter } from '../../../../common/util/date_utils'; import { isDefined } from '../../../../common/types/guards'; import { isPopulatedObject } from '../../../../common'; import { ModelPipelines } from './pipelines'; import { AllocatedModels } from '../nodes_overview/allocated_models'; import type { AllocatedModel } from '../../../../common/types/trained_models'; +import { useFieldFormatter } from '../../contexts/kibana/use_field_formatter'; +import { FIELD_FORMAT_IDS } from '../../../../../../../src/plugins/field_formats/common'; interface ExpandedRowProps { item: ModelItemFull; @@ -47,48 +48,62 @@ const badgeFormatter = (items: string[]) => { ); }; -const formatterDictionary: Record JSX.Element | string | undefined> = { - tags: badgeFormatter, - roles: badgeFormatter, - create_time: timeFormatter, - timestamp: timeFormatter, -}; +export function useListItemsFormatter() { + const bytesFormatter = useFieldFormatter(FIELD_FORMAT_IDS.BYTES); + const dateFormatter = useFieldFormatter(FIELD_FORMAT_IDS.DATE); -export function formatToListItems( - items: Record | object -): EuiDescriptionListProps['listItems'] { - return Object.entries(items) - .filter(([, value]) => isDefined(value)) - .map(([title, value]) => { - if (title in formatterDictionary) { - return { - title, - description: formatterDictionary[title](value), - }; - } - return { - title, - description: - typeof value === 'object' ? ( - - {JSON.stringify(value, null, 2)} - - ) : ( - value.toString() - ), - }; - }); + const formatterDictionary: Record JSX.Element | string | undefined> = + useMemo( + () => ({ + tags: badgeFormatter, + roles: badgeFormatter, + create_time: dateFormatter, + timestamp: dateFormatter, + model_size_bytes: bytesFormatter, + required_native_memory_bytes: bytesFormatter, + }), + [] + ); + + return useCallback( + (items: Record | object): EuiDescriptionListProps['listItems'] => { + return Object.entries(items) + .filter(([, value]) => isDefined(value)) + .map(([title, value]) => { + if (title in formatterDictionary) { + return { + title, + description: formatterDictionary[title](value), + }; + } + return { + title, + description: + typeof value === 'object' ? ( + + {JSON.stringify(value, null, 2)} + + ) : ( + value.toString() + ), + }; + }); + }, + [formatterDictionary] + ); } export const ExpandedRow: FC = ({ item }) => { const [modelItems, setModelItems] = useState([]); + const formatToListItems = useListItemsFormatter(); + const { inference_config: inferenceConfig, stats, @@ -140,6 +155,7 @@ export const ExpandedRow: FC = ({ item }) => { 'last_access', 'number_of_pending_requests', 'start_time', + 'throughput_last_minute', ]), name: nodeName, } as AllocatedModel['node'], diff --git a/x-pack/plugins/ml/public/application/trained_models/nodes_overview/allocated_models.tsx b/x-pack/plugins/ml/public/application/trained_models/nodes_overview/allocated_models.tsx index 4fb77c02779f9..79c2cbc1e4a42 100644 --- a/x-pack/plugins/ml/public/application/trained_models/nodes_overview/allocated_models.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/nodes_overview/allocated_models.tsx @@ -35,7 +35,7 @@ export const AllocatedModels: FC = ({ name: i18n.translate('xpack.ml.trainedModels.nodesList.modelsList.nodeNameHeader', { defaultMessage: 'Node name', }), - width: '200px', + width: '150px', sortable: true, truncateText: false, 'data-test-subj': 'mlAllocatedModelsTableNodeName', @@ -46,7 +46,7 @@ export const AllocatedModels: FC = ({ name: i18n.translate('xpack.ml.trainedModels.nodesList.modelsList.modelNameHeader', { defaultMessage: 'Name', }), - width: '300px', + width: '250px', sortable: true, truncateText: false, 'data-test-subj': 'mlAllocatedModelsTableName', @@ -63,13 +63,16 @@ export const AllocatedModels: FC = ({ }, }, { - field: 'state', - name: i18n.translate('xpack.ml.trainedModels.nodesList.modelsList.modelStateHeader', { - defaultMessage: 'State', - }), + field: 'node.throughput_last_minute', + name: i18n.translate( + 'xpack.ml.trainedModels.nodesList.modelsList.throughputLastMinuteHeader', + { + defaultMessage: 'Throughput', + } + ), width: '100px', truncateText: false, - 'data-test-subj': 'mlAllocatedModelsTableState', + 'data-test-subj': 'mlAllocatedModelsTableThroughput', }, { name: i18n.translate( @@ -117,7 +120,7 @@ export const AllocatedModels: FC = ({ width: '200px', 'data-test-subj': 'mlAllocatedModelsTableInferenceCount', render: (v: AllocatedModel) => { - return dateFormatter(v.node.last_access); + return v.node.last_access ? dateFormatter(v.node.last_access) : '-'; }, }, { diff --git a/x-pack/plugins/ml/public/application/trained_models/nodes_overview/expanded_row.tsx b/x-pack/plugins/ml/public/application/trained_models/nodes_overview/expanded_row.tsx index dde486aeec39b..b8920acde568e 100644 --- a/x-pack/plugins/ml/public/application/trained_models/nodes_overview/expanded_row.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/nodes_overview/expanded_row.tsx @@ -17,7 +17,7 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { cloneDeep } from 'lodash'; import { NodeItem } from './nodes_list'; -import { formatToListItems } from '../models_management/expanded_row'; +import { useListItemsFormatter } from '../models_management/expanded_row'; import { AllocatedModels } from './allocated_models'; import { useFieldFormatter } from '../../contexts/kibana/use_field_formatter'; import { FIELD_FORMAT_IDS } from '../../../../../../../src/plugins/field_formats/common'; @@ -29,6 +29,8 @@ interface ExpandedRowProps { export const ExpandedRow: FC = ({ item }) => { const bytesFormatter = useFieldFormatter(FIELD_FORMAT_IDS.BYTES); + const formatToListItems = useListItemsFormatter(); + const { allocated_models: allocatedModels, attributes, diff --git a/x-pack/plugins/ml/server/models/filter/filter_manager.ts b/x-pack/plugins/ml/server/models/filter/filter_manager.ts index a4e902ff44994..84f5ae9d7e5a7 100644 --- a/x-pack/plugins/ml/server/models/filter/filter_manager.ts +++ b/x-pack/plugins/ml/server/models/filter/filter_manager.ts @@ -45,108 +45,89 @@ export class FilterManager { constructor(private _mlClient: MlClient) {} async getFilter(filterId: string) { - try { - const { - filters: [filter], - } = await this._mlClient.getFilters({ filter_id: filterId }); - if (filter === undefined) { - // could be an empty list rather than a 404 if a wildcard was used, - // so throw our own 404 - throw Boom.notFound(`Filter with the id "${filterId}" not found`); - } - - const { jobs } = await this._mlClient.getJobs(); - const filtersInUse = this.buildFiltersInUse(jobs); - - return { - ...filter, - used_by: filtersInUse[filter.filter_id], - item_count: 0, - } as FilterStats; - } catch (error) { - throw Boom.badRequest(error); + const { + filters: [filter], + } = await this._mlClient.getFilters({ filter_id: filterId }); + if (filter === undefined) { + // could be an empty list rather than a 404 if a wildcard was used, + // so throw our own 404 + throw Boom.notFound(`Filter with the id "${filterId}" not found`); } + + const { jobs } = await this._mlClient.getJobs(); + const filtersInUse = this.buildFiltersInUse(jobs); + + return { + ...filter, + used_by: filtersInUse[filter.filter_id], + item_count: 0, + } as FilterStats; } async getAllFilters() { - try { - const body = await this._mlClient.getFilters({ size: 1000 }); - return body.filters; - } catch (error) { - throw Boom.badRequest(error); - } + const body = await this._mlClient.getFilters({ size: 1000 }); + return body.filters; } async getAllFilterStats() { - try { - const [JOBS, FILTERS] = [0, 1]; - const results = await Promise.all([ - this._mlClient.getJobs(), - this._mlClient.getFilters({ size: 1000 }), - ]); - - // Build a map of filter_ids against jobs and detectors using that filter. - let filtersInUse: FiltersInUse = {}; - if (results[JOBS] && (results[JOBS] as estypes.MlGetJobsResponse).jobs) { - filtersInUse = this.buildFiltersInUse((results[JOBS] as estypes.MlGetJobsResponse).jobs); - } - - // For each filter, return just - // filter_id - // description - // item_count - // jobs using the filter - const filterStats: FilterStats[] = []; - if (results[FILTERS] && (results[FILTERS] as estypes.MlGetFiltersResponse).filters) { - (results[FILTERS] as estypes.MlGetFiltersResponse).filters.forEach((filter: Filter) => { - const stats: FilterStats = { - filter_id: filter.filter_id, - description: filter.description, - item_count: filter.items.length, - used_by: filtersInUse[filter.filter_id], - }; - filterStats.push(stats); - }); - } - - return filterStats; - } catch (error) { - throw Boom.badRequest(error); + const [JOBS, FILTERS] = [0, 1]; + const results = await Promise.all([ + this._mlClient.getJobs(), + this._mlClient.getFilters({ size: 1000 }), + ]); + + // Build a map of filter_ids against jobs and detectors using that filter. + let filtersInUse: FiltersInUse = {}; + if (results[JOBS] && (results[JOBS] as estypes.MlGetJobsResponse).jobs) { + filtersInUse = this.buildFiltersInUse((results[JOBS] as estypes.MlGetJobsResponse).jobs); + } + + // For each filter, return just + // filter_id + // description + // item_count + // jobs using the filter + const filterStats: FilterStats[] = []; + if (results[FILTERS] && (results[FILTERS] as estypes.MlGetFiltersResponse).filters) { + (results[FILTERS] as estypes.MlGetFiltersResponse).filters.forEach((filter: Filter) => { + const stats: FilterStats = { + filter_id: filter.filter_id, + description: filter.description, + item_count: filter.items.length, + used_by: filtersInUse[filter.filter_id], + }; + filterStats.push(stats); + }); } + + return filterStats; } async newFilter(filter: FormFilter) { const { filterId, ...body } = filter; - try { - // Returns the newly created filter. - return await this._mlClient.putFilter({ filter_id: filterId, body }); - } catch (error) { - throw Boom.badRequest(error); - } + + // Returns the newly created filter. + return await this._mlClient.putFilter({ filter_id: filterId, body }); } async updateFilter(filterId: string, filter: UpdateFilter) { - try { - const body: FilterRequest = { filter_id: filterId }; - if (filter.description !== undefined) { - body.description = filter.description; - } - if (filter.addItems !== undefined) { - body.add_items = filter.addItems; - } - if (filter.removeItems !== undefined) { - body.remove_items = filter.removeItems; - } - - // Returns the newly updated filter. - const resp = await this._mlClient.updateFilter({ - filter_id: filterId, - body, - }); - return resp; - } catch (error) { - throw Boom.badRequest(error); + const body: FilterRequest = { filter_id: filterId }; + if (filter.description !== undefined) { + body.description = filter.description; } + if (filter.addItems !== undefined) { + body.add_items = filter.addItems; + } + if (filter.removeItems !== undefined) { + body.remove_items = filter.removeItems; + } + + // Returns the newly updated filter. + const resp = await this._mlClient.updateFilter({ + filter_id: filterId, + body, + }); + return resp; } async deleteFilter(filterId: string) { diff --git a/x-pack/plugins/observability/common/index.ts b/x-pack/plugins/observability/common/index.ts index 3f31eb5f9140c..1ca110f40bdbf 100644 --- a/x-pack/plugins/observability/common/index.ts +++ b/x-pack/plugins/observability/common/index.ts @@ -15,6 +15,7 @@ export { enableComparisonByDefault, enableInfrastructureView, defaultApmServiceEnvironment, + apmServiceInventoryOptimizedSorting, } from './ui_settings_keys'; export const casesFeatureId = 'observabilityCases'; diff --git a/x-pack/plugins/observability/common/ui_settings_keys.ts b/x-pack/plugins/observability/common/ui_settings_keys.ts index b1328aec7420b..54eaa9046d874 100644 --- a/x-pack/plugins/observability/common/ui_settings_keys.ts +++ b/x-pack/plugins/observability/common/ui_settings_keys.ts @@ -11,3 +11,5 @@ export const enableComparisonByDefault = 'observability:enableComparisonByDefaul export const enableInfrastructureView = 'observability:enableInfrastructureView'; export const defaultApmServiceEnvironment = 'observability:apmDefaultServiceEnvironment'; export const enableServiceGroups = 'observability:enableServiceGroups'; +export const apmServiceInventoryOptimizedSorting = + 'observability:apmServiceInventoryOptimizedSorting'; diff --git a/x-pack/plugins/observability/public/application/application.test.tsx b/x-pack/plugins/observability/public/application/application.test.tsx index 20e67661bad06..cd96b1018cdca 100644 --- a/x-pack/plugins/observability/public/application/application.test.tsx +++ b/x-pack/plugins/observability/public/application/application.test.tsx @@ -83,6 +83,7 @@ describe('renderApp', () => { appMountParameters: params, observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(), ObservabilityPageTemplate: KibanaPageTemplate, + kibanaFeatures: [], }); unmount(); }).not.toThrowError(); diff --git a/x-pack/plugins/observability/public/application/index.tsx b/x-pack/plugins/observability/public/application/index.tsx index bb2239abd68fb..6f8f99a6197ae 100644 --- a/x-pack/plugins/observability/public/application/index.tsx +++ b/x-pack/plugins/observability/public/application/index.tsx @@ -9,6 +9,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import ReactDOM from 'react-dom'; import { Route, Router, Switch } from 'react-router-dom'; +import { KibanaFeature } from '../../../features/common'; import { ConfigSchema } from '..'; import { AppMountParameters, APP_WRAPPER_CLASS, CoreStart } from '../../../../../src/core/public'; import { EuiThemeProvider } from '../../../../../src/plugins/kibana_react/common'; @@ -52,6 +53,7 @@ export const renderApp = ({ appMountParameters, observabilityRuleTypeRegistry, ObservabilityPageTemplate, + kibanaFeatures, }: { config: ConfigSchema; core: CoreStart; @@ -59,6 +61,7 @@ export const renderApp = ({ observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry; appMountParameters: AppMountParameters; ObservabilityPageTemplate: React.ComponentType; + kibanaFeatures: KibanaFeature[]; }) => { const { element, history, theme$ } = appMountParameters; const i18nCore = core.i18n; @@ -83,6 +86,7 @@ export const renderApp = ({ config, observabilityRuleTypeRegistry, ObservabilityPageTemplate, + kibanaFeatures, }} > diff --git a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx index e590d53074f8a..24538cb4eb25c 100644 --- a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx +++ b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx @@ -54,6 +54,7 @@ describe('APMSection', () => { }, observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(), ObservabilityPageTemplate: KibanaPageTemplate, + kibanaFeatures: [], })); }); diff --git a/x-pack/plugins/observability/public/context/plugin_context.tsx b/x-pack/plugins/observability/public/context/plugin_context.tsx index 50711d1a46553..e4e1ddb420340 100644 --- a/x-pack/plugins/observability/public/context/plugin_context.tsx +++ b/x-pack/plugins/observability/public/context/plugin_context.tsx @@ -7,6 +7,7 @@ import { AppMountParameters } from 'kibana/public'; import { createContext } from 'react'; +import { KibanaFeature } from '../../../features/common'; import { ConfigSchema } from '..'; import { ObservabilityRuleTypeRegistry } from '../rules/create_observability_rule_type_registry'; import type { LazyObservabilityPageTemplateProps } from '../components/shared/page_template/lazy_page_template'; @@ -16,6 +17,7 @@ export interface PluginContextValue { config: ConfigSchema; observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry; ObservabilityPageTemplate: React.ComponentType; + kibanaFeatures: KibanaFeature[]; } export const PluginContext = createContext({} as PluginContextValue); diff --git a/x-pack/plugins/observability/public/hooks/use_fetch_rules.ts b/x-pack/plugins/observability/public/hooks/use_fetch_rules.ts index 53b2f68821710..e3a1ab9c0137c 100644 --- a/x-pack/plugins/observability/public/hooks/use_fetch_rules.ts +++ b/x-pack/plugins/observability/public/hooks/use_fetch_rules.ts @@ -23,6 +23,7 @@ interface RuleState { export function useFetchRules({ searchText, ruleLastResponseFilter, + typesFilter, setPage, page, sort, @@ -47,7 +48,7 @@ export function useFetchRules({ http, page, searchText, - typesFilter: OBSERVABILITY_RULE_TYPES, + typesFilter: typesFilter.length > 0 ? typesFilter : OBSERVABILITY_RULE_TYPES, ruleStatusesFilter: ruleLastResponseFilter, sort, }); @@ -61,14 +62,18 @@ export function useFetchRules({ if (!response.data?.length && page.index > 0) { setPage({ ...page, index: 0 }); } - const isFilterApplied = !(isEmpty(searchText) && isEmpty(ruleLastResponseFilter)); + const isFilterApplied = !( + isEmpty(searchText) && + isEmpty(ruleLastResponseFilter) && + isEmpty(typesFilter) + ); setNoData(response.data.length === 0 && !isFilterApplied); } catch (_e) { setRulesState((oldState) => ({ ...oldState, isLoading: false, error: RULES_LOAD_ERROR })); } setInitialLoad(false); - }, [http, page, setPage, searchText, ruleLastResponseFilter, sort]); + }, [http, page, setPage, searchText, ruleLastResponseFilter, typesFilter, sort]); useEffect(() => { fetchRules(); }, [fetchRules]); diff --git a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx index 7922bda9fddee..956dc76a8e2fe 100644 --- a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx +++ b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx @@ -94,6 +94,7 @@ const withCore = makeDecorator({ }, observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(), ObservabilityPageTemplate: KibanaPageTemplate, + kibanaFeatures: [], }} > {storyFn(context)} diff --git a/x-pack/plugins/observability/public/pages/rules/components/type_filter.tsx b/x-pack/plugins/observability/public/pages/rules/components/type_filter.tsx new file mode 100644 index 0000000000000..5f4d4666002b5 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/rules/components/type_filter.tsx @@ -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 React, { Fragment, useEffect, useState } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + EuiFilterGroup, + EuiPopover, + EuiFilterButton, + EuiFilterSelectItem, + EuiTitle, +} from '@elastic/eui'; + +interface TypeFilterProps { + options: Array<{ + groupName: string; + subOptions: Array<{ + value: string; + name: string; + }>; + }>; + onChange?: (selectedTags: string[]) => void; +} + +export function TypeFilter({ options, onChange }: TypeFilterProps) { + const [selectedValues, setSelectedValues] = useState([]); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + + useEffect(() => { + if (onChange) { + onChange(selectedValues); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [selectedValues]); + + return ( + + setIsPopoverOpen(false)} + button={ + 0} + numActiveFilters={selectedValues.length} + numFilters={selectedValues.length} + onClick={() => setIsPopoverOpen(!isPopoverOpen)} + data-test-subj="ruleTypeFilterButton" + > + + + } + > +
+ {options.map((groupItem, groupIndex) => ( + + +

{groupItem.groupName}

+
+ {groupItem.subOptions.map((item, index) => ( + { + const isPreviouslyChecked = selectedValues.includes(item.value); + if (isPreviouslyChecked) { + setSelectedValues(selectedValues.filter((val) => val !== item.value)); + } else { + setSelectedValues(selectedValues.concat(item.value)); + } + }} + checked={selectedValues.includes(item.value) ? 'on' : undefined} + data-test-subj={`ruleType${item.value}FilterOption`} + > + {item.name} + + ))} +
+ ))} +
+
+
+ ); +} diff --git a/x-pack/plugins/observability/public/pages/rules/index.tsx b/x-pack/plugins/observability/public/pages/rules/index.tsx index a0b95441f4857..21cdc997419c0 100644 --- a/x-pack/plugins/observability/public/pages/rules/index.tsx +++ b/x-pack/plugins/observability/public/pages/rules/index.tsx @@ -6,6 +6,7 @@ */ import React, { useState, useMemo, useEffect } from 'react'; +import { capitalize, sortBy } from 'lodash'; import { EuiButton, EuiButtonIcon, @@ -28,6 +29,7 @@ import { useFetchRules } from '../../hooks/use_fetch_rules'; import { RulesTable } from './components/rules_table'; import { Name } from './components/name'; import { LastResponseFilter } from './components/last_response_filter'; +import { TypeFilter } from './components/type_filter'; import { StatusContext } from './components/status_context'; import { ExecutionStatus } from './components/execution_status'; import { LastRun } from './components/last_run'; @@ -70,11 +72,10 @@ import { SEARCH_PLACEHOLDER, } from './translations'; import { ExperimentalBadge } from '../../components/shared/experimental_badge'; - const ENTER_KEY = 13; export function RulesPage() { - const { ObservabilityPageTemplate } = usePluginContext(); + const { ObservabilityPageTemplate, kibanaFeatures } = usePluginContext(); const { http, docLinks, @@ -95,6 +96,7 @@ export function RulesPage() { const [refreshInterval, setRefreshInterval] = useState(60000); const [isPaused, setIsPaused] = useState(false); const [ruleLastResponseFilter, setRuleLastResponseFilter] = useState([]); + const [typesFilter, setTypesFilter] = useState([]); const [currentRuleToEdit, setCurrentRuleToEdit] = useState(null); const [rulesToDelete, setRulesToDelete] = useState([]); const [createRuleFlyoutVisibility, setCreateRuleFlyoutVisibility] = useState(false); @@ -117,6 +119,7 @@ export function RulesPage() { const { rulesState, setRulesState, reload, noData, initialLoad } = useFetchRules({ searchText, ruleLastResponseFilter, + typesFilter, page, setPage, sort, @@ -127,6 +130,32 @@ export function RulesPage() { }); const authorizedRuleTypes = [...ruleTypes.values()]; + const getProducerFeatureName = (producer: string) => { + return kibanaFeatures?.find((featureItem) => featureItem.id === producer)?.name; + }; + + const groupRuleTypesByProducer = () => { + return authorizedRuleTypes.reduce( + ( + result: Record< + string, + Array<{ + value: string; + name: string; + }> + >, + ruleType + ) => { + const producer = ruleType.producer; + (result[producer] = result[producer] || []).push({ + value: ruleType.id, + name: ruleType.name, + }); + return result; + }, + {} + ); + }; const authorizedToCreateAnyRules = authorizedRuleTypes.some( (ruleType) => ruleType.authorizedConsumers[ALERTS_FEATURE_ID]?.all ); @@ -291,6 +320,18 @@ export function RulesPage() { placeholder={SEARCH_PLACEHOLDER} /> + + setTypesFilter(types)} + options={sortBy(Object.entries(groupRuleTypesByProducer())).map( + ([groupName, ruleTypesOptions]) => ({ + groupName: getProducerFeatureName(groupName) ?? capitalize(groupName), + subOptions: ruleTypesOptions.sort((a, b) => a.name.localeCompare(b.name)), + }) + )} + /> + + {getRulesTable()} {error && toasts.addDanger({ diff --git a/x-pack/plugins/observability/public/pages/rules/types.ts b/x-pack/plugins/observability/public/pages/rules/types.ts index 1a15cf3d9cef2..0fba341d7f16d 100644 --- a/x-pack/plugins/observability/public/pages/rules/types.ts +++ b/x-pack/plugins/observability/public/pages/rules/types.ts @@ -69,6 +69,7 @@ export interface Pagination { export interface FetchRulesProps { searchText: string | undefined; ruleLastResponseFilter: string[]; + typesFilter: string[]; page: Pagination; setPage: Dispatch>; sort: EuiTableSortingType['sort']; diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index ed591d45a9820..2fe097cf8eb10 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -27,6 +27,7 @@ import type { import type { DataViewsPublicPluginStart } from '../../../../src/plugins/data_views/public'; import type { DiscoverStart } from '../../../../src/plugins/discover/public'; import type { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; +import type { FeaturesPluginStart } from '../../features/public'; import type { HomePublicPluginSetup, HomePublicPluginStart, @@ -48,6 +49,7 @@ import { getExploratoryViewEmbeddable } from './components/shared/exploratory_vi import { createExploratoryViewUrl } from './components/shared/exploratory_view/configurations/utils'; import { createUseRulesLink } from './hooks/create_use_rules_link'; import getAppDataView from './utils/observability_data_views/get_app_data_view'; +import { KibanaFeature } from '../../features/common'; export type ObservabilityPublicSetup = ReturnType; @@ -66,6 +68,8 @@ export interface ObservabilityPublicPluginsStart { dataViews: DataViewsPublicPluginStart; lens: LensPublicStart; discover: DiscoverStart; + features: FeaturesPluginStart; + kibanaFeatures: KibanaFeature[]; } export type ObservabilityPublicStart = ReturnType; @@ -146,6 +150,15 @@ export class Plugin const { renderApp } = await import('./application'); // Get start services const [coreStart, pluginsStart, { navigation }] = await coreSetup.getStartServices(); + // The `/api/features` endpoint requires the "Global All" Kibana privilege. Users with a + // subset of this privilege are not authorized to access this endpoint and will receive a 404 + // error that causes the Alerting view to fail to load. + let kibanaFeatures: KibanaFeature[]; + try { + kibanaFeatures = await pluginsStart.features.getFeatures(); + } catch (err) { + kibanaFeatures = []; + } return renderApp({ config, @@ -154,6 +167,7 @@ export class Plugin appMountParameters: params, observabilityRuleTypeRegistry, ObservabilityPageTemplate: navigation.PageTemplate, + kibanaFeatures, }); }; diff --git a/x-pack/plugins/observability/public/utils/test_helper.tsx b/x-pack/plugins/observability/public/utils/test_helper.tsx index 4dd67ff290886..b8d16f481c499 100644 --- a/x-pack/plugins/observability/public/utils/test_helper.tsx +++ b/x-pack/plugins/observability/public/utils/test_helper.tsx @@ -46,6 +46,7 @@ export const render = (component: React.ReactNode) => { config, observabilityRuleTypeRegistry, ObservabilityPageTemplate: KibanaPageTemplate, + kibanaFeatures: [], }} > {component} diff --git a/x-pack/plugins/observability/server/ui_settings.ts b/x-pack/plugins/observability/server/ui_settings.ts index db6bc3041fe34..60dcc1384aa22 100644 --- a/x-pack/plugins/observability/server/ui_settings.ts +++ b/x-pack/plugins/observability/server/ui_settings.ts @@ -16,6 +16,7 @@ import { enableInfrastructureView, defaultApmServiceEnvironment, enableServiceGroups, + apmServiceInventoryOptimizedSorting, } from '../common/ui_settings_keys'; const technicalPreviewLabel = i18n.translate( @@ -98,4 +99,22 @@ export const uiSettings: Record[${technicalPreviewLabel}]` }, + } + ), + schema: schema.boolean(), + value: false, + requiresPageReload: false, + type: 'boolean', + }, }; diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts index a23b889cc00c4..6b470c85aa1b8 100644 --- a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts +++ b/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts @@ -104,6 +104,7 @@ export const policyFactory = (): PolicyConfig => { process: true, file: true, network: true, + session_data: false, }, malware: { mode: ProtectionModes.prevent, diff --git a/x-pack/plugins/security_solution/common/endpoint/types/index.ts b/x-pack/plugins/security_solution/common/endpoint/types/index.ts index cbbf3010ef7b2..5aa38617f0331 100644 --- a/x-pack/plugins/security_solution/common/endpoint/types/index.ts +++ b/x-pack/plugins/security_solution/common/endpoint/types/index.ts @@ -984,6 +984,7 @@ export interface PolicyConfig { file: boolean; process: boolean; network: boolean; + session_data: boolean; }; malware: ProtectionFields & BlocklistFields; behavior_protection: ProtectionFields & SupportedFields; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts index a7176b3d30930..1902f0a0618ff 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts @@ -87,6 +87,7 @@ import { TotalUsersKpiRequestOptions, TotalUsersKpiStrategyResponse, } from './users/kpi/total_users'; +import { UsersRequestOptions, UsersStrategyResponse } from './users/all'; export * from './cti'; export * from './hosts'; @@ -147,6 +148,8 @@ export type StrategyResponseType = T extends HostsQ ? UserDetailsStrategyResponse : T extends UsersQueries.kpiTotalUsers ? TotalUsersKpiStrategyResponse + : T extends UsersQueries.users + ? UsersStrategyResponse : T extends NetworkQueries.details ? NetworkDetailsStrategyResponse : T extends NetworkQueries.dns @@ -207,6 +210,8 @@ export type StrategyRequestType = T extends HostsQu ? UserDetailsRequestOptions : T extends UsersQueries.kpiTotalUsers ? TotalUsersKpiRequestOptions + : T extends UsersQueries.users + ? UsersRequestOptions : T extends NetworkQueries.details ? NetworkDetailsRequestOptions : T extends NetworkQueries.dns diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts new file mode 100644 index 0000000000000..3e50bbe68b5f8 --- /dev/null +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts @@ -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 type { IEsSearchResponse } from '../../../../../../../../src/plugins/data/common'; + +import { Inspect, Maybe, PageInfoPaginated } from '../../../common'; +import { RequestOptionsPaginated } from '../..'; +import { SortableUsersFields } from '../common'; + +export interface User { + name: string; + lastSeen: string; + domain: string; +} + +export interface UsersStrategyResponse extends IEsSearchResponse { + users: User[]; + totalCount: number; + pageInfo: PageInfoPaginated; + inspect?: Maybe; +} + +export interface UsersRequestOptions extends RequestOptionsPaginated { + defaultIndex: string[]; +} diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts index a522cd4d89218..9b9d3028594d3 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Maybe, RiskSeverity } from '../../..'; +import { Maybe, RiskSeverity, SortField } from '../../..'; import { HostEcs } from '../../../../ecs/host'; import { UserEcs } from '../../../../ecs/user'; @@ -30,9 +30,14 @@ export interface UserItem { firstSeen?: Maybe; } +export type SortableUsersFields = Exclude; + +export type SortUsersField = SortField; + export enum UsersFields { lastSeen = 'lastSeen', - hostName = 'userName', + name = 'name', + domain = 'domain', } export interface UserAggEsItem { @@ -52,3 +57,17 @@ export interface UserBuckets { doc_count: number; }>; } + +export interface AllUsersAggEsItem { + key: string; + domain?: UsersDomainHitsItem; + lastSeen?: { value_as_string: string }; +} + +export interface UsersDomainHitsItem { + hits: { + hits: Array<{ + _source: { user: { domain: Maybe } }; + }>; + }; +} diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/details/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/details/index.ts index 941e8081d1143..43de36a50802d 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/details/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/details/index.ts @@ -9,15 +9,15 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { IEsSearchResponse } from '../../../../../../../../src/plugins/data/common'; import { Inspect, Maybe, TimerangeInput } from '../../../common'; -import { UserItem, UsersFields } from '../common'; -import { RequestOptionsPaginated } from '../..'; +import { UserItem } from '../common'; +import { RequestBasicOptions } from '../..'; export interface UserDetailsStrategyResponse extends IEsSearchResponse { userDetails: UserItem; inspect?: Maybe; } -export interface UserDetailsRequestOptions extends Partial> { +export interface UserDetailsRequestOptions extends Partial { userName: string; skip?: boolean; timerange: TimerangeInput; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/index.ts index d8f6172dd80c2..d7b50ded32039 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/index.ts @@ -10,6 +10,7 @@ import { TotalUsersKpiStrategyResponse } from './kpi/total_users'; export enum UsersQueries { details = 'userDetails', kpiTotalUsers = 'usersKpiTotalUsers', + users = 'allUsers', } export type UserskKpiStrategyResponse = Omit; diff --git a/x-pack/plugins/security_solution/cypress/integration/users/all_users_tab.spec.ts b/x-pack/plugins/security_solution/cypress/integration/users/all_users_tab.spec.ts index 070afc12cf53e..e040d032033f4 100644 --- a/x-pack/plugins/security_solution/cypress/integration/users/all_users_tab.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/users/all_users_tab.spec.ts @@ -20,7 +20,7 @@ describe('Users stats and tables', () => { }); it(`renders all users`, () => { - const totalUsers = 35; + const totalUsers = 72; const usersPerPage = 10; cy.get(HEADER_SUBTITLE).should('have.text', `Showing: ${totalUsers} users`); diff --git a/x-pack/plugins/security_solution/cypress/integration/users/authentications_tab.spec.ts b/x-pack/plugins/security_solution/cypress/integration/users/authentications_tab.spec.ts new file mode 100644 index 0000000000000..1a7910a00fc49 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/integration/users/authentications_tab.spec.ts @@ -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 { + AUTHENTICATIONS_TAB, + AUTHENTICATIONS_TABLE, + HEADER_SUBTITLE, + USER_NAME_CELL, +} from '../../screens/users/user_authentications'; +import { cleanKibana } from '../../tasks/common'; + +import { loginAndWaitForPage } from '../../tasks/login'; + +import { USERS_URL } from '../../urls/navigation'; + +describe('Authentications stats and tables', () => { + before(() => { + cleanKibana(); + + loginAndWaitForPage(USERS_URL); + }); + + it(`renders all authentications`, () => { + const totalUsers = 35; + const usersPerPage = 10; + + cy.get(AUTHENTICATIONS_TAB).click(); + + cy.get(AUTHENTICATIONS_TABLE) + .find(HEADER_SUBTITLE) + .should('have.text', `Showing: ${totalUsers} users`); + cy.get(USER_NAME_CELL).should('have.length', usersPerPage); + }); +}); diff --git a/x-pack/plugins/security_solution/cypress/integration/users/inspect.spec.ts b/x-pack/plugins/security_solution/cypress/integration/users/inspect.spec.ts index f092949ec56aa..70927b3f7c518 100644 --- a/x-pack/plugins/security_solution/cypress/integration/users/inspect.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/users/inspect.spec.ts @@ -5,8 +5,10 @@ * 2.0. */ +import { AUTHENTICATIONS_TABLE } from '../../screens/hosts/authentications'; import { INSPECT_MODAL } from '../../screens/inspect'; import { ALL_USERS_TABLE } from '../../screens/users/all_users'; +import { AUTHENTICATIONS_TAB } from '../../screens/users/user_authentications'; import { cleanKibana } from '../../tasks/common'; import { clickInspectButton, closesModal } from '../../tasks/inspect'; @@ -30,5 +32,11 @@ describe('Inspect', () => { clickInspectButton(ALL_USERS_TABLE); cy.get(INSPECT_MODAL).should('be.visible'); }); + + it(`inspects authentications table`, () => { + cy.get(AUTHENTICATIONS_TAB).click(); + clickInspectButton(AUTHENTICATIONS_TABLE); + cy.get(INSPECT_MODAL).should('be.visible'); + }); }); }); diff --git a/x-pack/plugins/security_solution/cypress/screens/users/all_users.ts b/x-pack/plugins/security_solution/cypress/screens/users/all_users.ts index a1d6e9edebf56..96009834dc7a3 100644 --- a/x-pack/plugins/security_solution/cypress/screens/users/all_users.ts +++ b/x-pack/plugins/security_solution/cypress/screens/users/all_users.ts @@ -5,7 +5,7 @@ * 2.0. */ -export const ALL_USERS_TABLE = '[data-test-subj="table-authentications-loading-false"]'; +export const ALL_USERS_TABLE = '[data-test-subj="table-allUsers-loading-false"]'; export const HEADER_SUBTITLE = '[data-test-subj="header-panel-subtitle"]'; diff --git a/x-pack/plugins/security_solution/cypress/screens/users/user_authentications.ts b/x-pack/plugins/security_solution/cypress/screens/users/user_authentications.ts new file mode 100644 index 0000000000000..32340803c4eb1 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/screens/users/user_authentications.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const AUTHENTICATIONS_TAB = '[data-test-subj="navigation-authentications"]'; +export const HEADER_SUBTITLE = '[data-test-subj="header-panel-subtitle"]'; +export const USER_NAME_CELL = '[data-test-subj="render-content-user.name"]'; +export const AUTHENTICATIONS_TABLE = '[data-test-subj="table-authentications-loading-false"]'; diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.tsx b/x-pack/plugins/security_solution/public/common/components/links/index.tsx index ab76c848ce16f..6020b0def0aed 100644 --- a/x-pack/plugins/security_solution/public/common/components/links/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links/index.tsx @@ -78,7 +78,7 @@ const UserDetailsLinkComponent: React.FC<{ dataTestSubj="data-grid-user-details" href={formatUrl(getUsersDetailsUrl(encodedUserName))} onClick={onClick ?? goToUsersDetails} - title={title ?? encodedUserName} + title={title ?? userName} > {children ? children : userName} diff --git a/x-pack/plugins/security_solution/public/common/components/paginated_table/index.tsx b/x-pack/plugins/security_solution/public/common/components/paginated_table/index.tsx index b9de144c5735e..3b27dc0fcfac6 100644 --- a/x-pack/plugins/security_solution/public/common/components/paginated_table/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/paginated_table/index.tsx @@ -50,6 +50,7 @@ import * as i18n from './translations'; import { Panel } from '../panel'; import { InspectButtonContainer } from '../inspect'; import { useQueryToggle } from '../../containers/query_toggle'; +import { UsersTableColumns } from '../../../users/components/all_users'; const DEFAULT_DATA_TEST_SUBJ = 'paginated-table'; @@ -89,7 +90,8 @@ declare type BasicTableColumns = | HostRiskScoreColumns | TlsColumns | UncommonProcessTableColumns - | UsersColumns; + | UsersColumns + | UsersTableColumns; declare type SiemTables = BasicTableProps; diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/translations.ts b/x-pack/plugins/security_solution/public/common/components/visualization_actions/translations.ts index 9707fd39d9322..c3850ab7ade8a 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/translations.ts @@ -39,6 +39,13 @@ export const ADD_TO_EXISTING_CASE = i18n.translate( } ); +export const ADD_TO_CASE_SUCCESS = i18n.translate( + 'xpack.securitySolution.visualizationActions.addToCaseSuccessContent', + { + defaultMessage: 'Successfully added visualization to the case', + } +); + export const SOURCE_CHART_LABEL = i18n.translate( 'xpack.securitySolution.visualizationActions.uniqueIps.sourceChartLabel', { diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.test.tsx b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.test.tsx index a1831a7fccde7..af0b41ad87bca 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.test.tsx @@ -50,6 +50,7 @@ describe('', () => { }, ], onClose: mockOnAddToCaseClicked, + toastContent: 'Successfully added visualization to the case', }); expect(result.current.disabled).toEqual(false); }); diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.tsx b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.tsx index 5a4ac6dd934e9..fc2a1893e1ad0 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.tsx +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.tsx @@ -9,6 +9,7 @@ import { CommentType } from '../../../../../cases/common'; import { APP_ID } from '../../../../common/constants'; import { useKibana } from '../../lib/kibana/kibana_react'; +import { ADD_TO_CASE_SUCCESS } from './translations'; import { LensAttributes } from './types'; @@ -42,6 +43,7 @@ export const useAddToExistingCase = ({ const selectCaseModal = cases.hooks.getUseCasesAddToExistingCaseModal({ attachments, onClose: onAddToCaseClicked, + toastContent: ADD_TO_CASE_SUCCESS, }); const onAddToExistingCaseClicked = useCallback(() => { diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.test.tsx b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.test.tsx index 0627262eec438..758f7e664fb03 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.test.tsx @@ -47,6 +47,7 @@ describe('', () => { type, }, ], + toastContent: 'Successfully added visualization to the case', }); expect(result.current.disabled).toEqual(false); }); diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.tsx b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.tsx index 854894e81c48c..6958b2cb97892 100644 --- a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.tsx +++ b/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.tsx @@ -10,6 +10,7 @@ import { CommentType } from '../../../../../cases/common'; import { APP_ID } from '../../../../common/constants'; import { useKibana } from '../../lib/kibana/kibana_react'; +import { ADD_TO_CASE_SUCCESS } from './translations'; import { LensAttributes } from './types'; @@ -44,6 +45,7 @@ export const useAddToNewCase = ({ const createCaseFlyout = cases.hooks.getUseCasesAddToNewCaseFlyout({ attachments, + toastContent: ADD_TO_CASE_SUCCESS, }); const onAddToNewCaseClicked = useCallback(() => { diff --git a/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.test.ts b/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.test.ts index c1513b7a0485b..131242513e583 100644 --- a/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.test.ts +++ b/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.test.ts @@ -200,18 +200,18 @@ describe('useSearchStrategy', () => { expect(start).toBeCalledWith(expect.objectContaining({ signal })); }); - it('skip = true will cancel any running request', () => { + it('abort = true will cancel any running request', () => { const abortSpy = jest.fn(); const signal = new AbortController().signal; jest.spyOn(window, 'AbortController').mockReturnValue({ abort: abortSpy, signal }); const factoryQueryType = 'fakeQueryType' as FactoryQueryTypes; const localProps = { ...userSearchStrategyProps, - skip: false, + abort: false, factoryQueryType, }; const { rerender } = renderHook(() => useSearchStrategy(localProps)); - localProps.skip = true; + localProps.abort = true; act(() => rerender()); expect(abortSpy).toHaveBeenCalledTimes(1); }); diff --git a/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.tsx b/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.tsx index 234cf039024ba..8e284c7c29413 100644 --- a/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.tsx @@ -33,6 +33,7 @@ import { getInspectResponse } from '../../../helpers'; import { inputsModel } from '../../store'; import { useKibana } from '../../lib/kibana'; import { useAppToasts } from '../../hooks/use_app_toasts'; +import { AbortError } from '../../../../../../../src/plugins/kibana_utils/common'; type UseSearchStrategyRequestArgs = RequestBasicOptions & { data: DataPublicPluginStart; @@ -96,7 +97,7 @@ export const useSearchStrategy = ({ factoryQueryType, initialResult, errorMessage, - skip = false, + abort = false, }: { factoryQueryType: QueryType; /** @@ -107,7 +108,10 @@ export const useSearchStrategy = ({ * Message displayed to the user on a Toast when an erro happens. */ errorMessage?: string; - skip?: boolean; + /** + * When the flag switches from `false` to `true`, it will abort any ongoing request. + */ + abort?: boolean; }) => { const abortCtrl = useRef(new AbortController()); const { getTransformChangesIfTheyExist } = useTransforms(); @@ -122,7 +126,7 @@ export const useSearchStrategy = ({ >(searchComplete); useEffect(() => { - if (error != null) { + if (error != null && !(error instanceof AbortError)) { addError(error, { title: errorMessage ?? i18n.DEFAULT_ERROR_SEARCH_STRATEGY(factoryQueryType), }); @@ -157,10 +161,10 @@ export const useSearchStrategy = ({ }, []); useEffect(() => { - if (skip) { + if (abort) { abortCtrl.current.abort(); } - }, [skip]); + }, [abort]); const [formatedResult, inspect] = useMemo( () => [ diff --git a/x-pack/plugins/security_solution/public/common/mock/global_state.ts b/x-pack/plugins/security_solution/public/common/mock/global_state.ts index 6af59ef9b02ff..bd90892a43fc6 100644 --- a/x-pack/plugins/security_solution/public/common/mock/global_state.ts +++ b/x-pack/plugins/security_solution/public/common/mock/global_state.ts @@ -41,6 +41,7 @@ import { mockRuntimeMappings, } from '../containers/source/mock'; import { usersModel } from '../../users/store'; +import { UsersFields } from '../../../common/search_strategy/security_solution/users/common'; export const mockSourcererState = { ...initialSourcererState, @@ -205,6 +206,11 @@ export const mockGlobalState: State = { [usersModel.UsersTableType.allUsers]: { activePage: 0, limit: 10, + sort: { field: UsersFields.name, direction: Direction.asc }, + }, + [usersModel.UsersTableType.authentications]: { + activePage: 0, + limit: 10, }, [usersModel.UsersTableType.anomalies]: null, [usersModel.UsersTableType.risk]: { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts b/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts index 128bca807381c..d5147f58d4f0b 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts +++ b/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts @@ -873,4 +873,15 @@ export const AdvancedPolicySchema: AdvancedPolicySchemaType[] = [ } ), }, + { + key: 'linux.advanced.kernel.capture_mode', + first_supported_version: '8.2', + documentation: i18n.translate( + 'xpack.securitySolution.endpoint.policy.advanced.linux.advanced.kernel.capture_mode', + { + defaultMessage: + 'Allows users to control whether kprobes or ebpf are used to gather data. Possible options are kprobes, ebpf, or auto. Default: auto', + } + ), + }, ]; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts index b6720527a7935..1fe646c86bd6a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts +++ b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts @@ -332,7 +332,7 @@ describe('policy details: ', () => { logging: { file: 'info' }, }, linux: { - events: { process: true, file: true, network: true }, + events: { process: true, file: true, network: true, session_data: false }, logging: { file: 'info' }, malware: { mode: 'prevent', blocklist: true }, behavior_protection: { mode: 'off', supported: false }, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/components/events_form/index.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/components/events_form/index.tsx index a3f4b2fdc7fb1..c079ae8a3a7da 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/components/events_form/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/components/events_form/index.tsx @@ -5,10 +5,21 @@ * 2.0. */ -import React from 'react'; +import React, { useContext, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiCheckbox, EuiSpacer, EuiText, htmlIdGenerator } from '@elastic/eui'; +import { + EuiCheckbox, + EuiSpacer, + EuiText, + htmlIdGenerator, + EuiSwitch, + EuiIconTip, + EuiBetaBadge, + EuiFlexItem, + EuiFlexGroup, +} from '@elastic/eui'; import { OperatingSystem } from '@kbn/securitysolution-utils'; +import { ThemeContext } from 'styled-components'; import { PolicyOperatingSystem, UIPolicyConfig } from '../../../../../../../common/endpoint/types'; import { ConfigForm, ConfigFormHeading } from '../../components/config_form'; @@ -34,54 +45,110 @@ export interface EventFormOption { protectionField: ProtectionField; } +export interface SupplementalEventFormOption { + name: string; + protectionField: ProtectionField; + tooltipText?: string; + beta?: boolean; +} + export interface EventsFormProps { os: T; options: ReadonlyArray>; selection: EventFormSelection; onValueSelection: (value: ProtectionField, selected: boolean) => void; + supplementalOptions?: ReadonlyArray>; } -const countSelected = (selection: EventFormSelection) => { - return Object.values(selection).filter((value) => value).length; -}; - -export const EventsForm = ({ +const InnerEventsForm = ({ os, options, selection, onValueSelection, -}: EventsFormProps) => ( - - {i18n.translate('xpack.securitySolution.endpoint.policy.details.eventCollectionsEnabled', { - defaultMessage: '{selected} / {total} event collections enabled', - values: { selected: countSelected(selection), total: options.length }, + supplementalOptions, +}: EventsFormProps) => { + const theme = useContext(ThemeContext); + const countSelected = useCallback(() => { + const supplementalSelectionFields: string[] = supplementalOptions + ? supplementalOptions.map((value) => value.protectionField as string) + : []; + return Object.entries(selection).filter(([key, value]) => + !supplementalSelectionFields.includes(key) ? value : false + ).length; + }, [selection, supplementalOptions]); + + return ( + + {i18n.translate( + 'xpack.securitySolution.endpoint.policy.details.eventCollectionsEnabled', + { + defaultMessage: '{selected} / {total} event collections enabled', + values: { + selected: countSelected(), + total: options.length, + }, + } + )} + + } + > + + {i18n.translate('xpack.securitySolution.endpoint.policyDetailsConfig.eventingEvents', { + defaultMessage: 'Events', })} - - } - > - - {i18n.translate('xpack.securitySolution.endpoint.policyDetailsConfig.eventingEvents', { - defaultMessage: 'Events', + + + {options.map(({ name, protectionField }) => { + return ( + onValueSelection(protectionField, event.target.checked)} + /> + ); })} - - - {options.map(({ name, protectionField }) => ( - onValueSelection(protectionField, event.target.checked)} - /> - ))} - -); + {supplementalOptions && + supplementalOptions.map(({ name, protectionField, tooltipText, beta }) => { + return ( +
+ + + + onValueSelection(protectionField, event.target.checked)} + /> + + {tooltipText && ( + + + + )} + {beta && ( + + + + )} + +
+ ); + })} +
+ ); +}; + +InnerEventsForm.displayName = 'EventsForm'; -EventsForm.displayName = 'EventsForm'; +export const EventsForm = React.memo(InnerEventsForm) as typeof InnerEventsForm; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/events/linux.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/events/linux.tsx index 1980877eea95d..71e7dba966484 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/events/linux.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/events/linux.tsx @@ -12,7 +12,11 @@ import { OperatingSystem } from '@kbn/securitysolution-utils'; import { policyConfig } from '../../../store/policy_details/selectors'; import { setIn } from '../../../models/policy_details_config'; import { usePolicyDetailsSelector } from '../../policy_hooks'; -import { EventFormOption, EventsForm } from '../../components/events_form'; +import { + EventFormOption, + EventsForm, + SupplementalEventFormOption, +} from '../../components/events_form'; const OPTIONS: ReadonlyArray> = [ { @@ -21,6 +25,15 @@ const OPTIONS: ReadonlyArray> = [ }), protectionField: 'file', }, + { + name: i18n.translate( + 'xpack.securitySolution.endpoint.policyDetailsConfig.linux.events.network', + { + defaultMessage: 'Network', + } + ), + protectionField: 'network', + }, { name: i18n.translate( 'xpack.securitySolution.endpoint.policyDetailsConfig.linux.events.process', @@ -30,14 +43,25 @@ const OPTIONS: ReadonlyArray> = [ ), protectionField: 'process', }, +]; + +const SUPPLEMENTAL_OPTIONS: ReadonlyArray> = [ { name: i18n.translate( - 'xpack.securitySolution.endpoint.policyDetailsConfig.linux.events.network', + 'xpack.securitySolution.endpoint.policyDetailsConfig.linux.events.session_data', { - defaultMessage: 'Network', + defaultMessage: 'Include session data', } ), - protectionField: 'network', + protectionField: 'session_data', + tooltipText: i18n.translate( + 'xpack.securitySolution.endpoint.policyDetailsConfig.linux.events.session_data.tooltip', + { + defaultMessage: + 'Capture the extended process event data required for Session View. Session View helps you investigate process, user, and service activity on your Linux infrastructure by displaying session and process execution data organized in a tree according to the Linux process model. NOTE: Capturing extended process events substantially increases data usage.', + } + ), + beta: true, }, ]; @@ -50,6 +74,7 @@ export const LinuxEvents = memo(() => { os={OperatingSystem.LINUX} selection={policyDetailsConfig.linux.events} options={OPTIONS} + supplementalOptions={SUPPLEMENTAL_OPTIONS} onValueSelection={(value, selected) => dispatch({ type: 'userChangedPolicyConfig', diff --git a/x-pack/plugins/security_solution/public/users/components/all_users/index.test.tsx b/x-pack/plugins/security_solution/public/users/components/all_users/index.test.tsx new file mode 100644 index 0000000000000..117a62e0494df --- /dev/null +++ b/x-pack/plugins/security_solution/public/users/components/all_users/index.test.tsx @@ -0,0 +1,52 @@ +/* + * 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 '../../../common/mock/match_media'; +import { TestProviders } from '../../../common/mock'; + +import { UsersTable } from '.'; +import { usersModel } from '../../store'; +import { Direction } from '../../../../common/search_strategy'; +import { UsersFields } from '../../../../common/search_strategy/security_solution/users/common'; +import { render } from '@testing-library/react'; + +describe('Users Table Component', () => { + const loadPage = jest.fn(); + + describe('rendering', () => { + test('it renders the users table', () => { + const userName = 'testUser'; + const { getByTestId, getAllByRole, getByText } = render( + + {}} + /> + + ); + + expect(getByTestId('table-allUsers-loading-false')).toBeInTheDocument(); + expect(getAllByRole('columnheader').length).toBe(3); + expect(getByText(userName)).toBeInTheDocument(); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/users/components/all_users/index.tsx b/x-pack/plugins/security_solution/public/users/components/all_users/index.tsx new file mode 100644 index 0000000000000..15626d0650ac8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/users/components/all_users/index.tsx @@ -0,0 +1,186 @@ +/* + * 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 { FormattedRelativePreferenceDate } from '../../../common/components/formatted_date'; +import { UserDetailsLink } from '../../../common/components/links'; + +import { + Columns, + Criteria, + ItemsPerRow, + PaginatedTable, +} from '../../../common/components/paginated_table'; + +import { getRowItemDraggables } from '../../../common/components/tables/helpers'; +import { useDeepEqualSelector } from '../../../common/hooks/use_selector'; + +import * as i18n from './translations'; +import { usersActions, usersModel, usersSelectors } from '../../store'; +import { User } from '../../../../common/search_strategy/security_solution/users/all'; +import { SortUsersField } from '../../../../common/search_strategy/security_solution/users/common'; + +const tableType = usersModel.UsersTableType.allUsers; + +interface UsersTableProps { + users: User[]; + fakeTotalCount: number; + loading: boolean; + loadPage: (newActivePage: number) => void; + id: string; + showMorePagesIndicator: boolean; + totalCount: number; + type: usersModel.UsersType; + sort: SortUsersField; + setQuerySkip: (skip: boolean) => void; +} + +export type UsersTableColumns = [ + Columns, + Columns, + Columns +]; + +const rowItems: ItemsPerRow[] = [ + { + text: i18n.ROWS_5, + numberOfRow: 5, + }, + { + text: i18n.ROWS_10, + numberOfRow: 10, + }, +]; + +const UsersTableComponent: React.FC = ({ + users, + totalCount, + type, + id, + fakeTotalCount, + loading, + loadPage, + showMorePagesIndicator, + sort, + setQuerySkip, +}) => { + const dispatch = useDispatch(); + const getUsersSelector = useMemo(() => usersSelectors.allUsersSelector(), []); + const { activePage, limit } = useDeepEqualSelector((state) => getUsersSelector(state)); + + const updateLimitPagination = useCallback( + (newLimit) => { + dispatch( + usersActions.updateTableLimit({ + usersType: type, + limit: newLimit, + tableType, + }) + ); + }, + [type, dispatch] + ); + + const updateActivePage = useCallback( + (newPage) => { + dispatch( + usersActions.updateTableActivePage({ + activePage: newPage, + usersType: type, + tableType, + }) + ); + }, + [type, dispatch] + ); + + const onSort = useCallback( + (criteria: Criteria) => { + if (criteria.sort != null) { + const newSort = criteria.sort; + if (newSort.direction !== sort.direction || newSort.field !== sort.field) { + dispatch( + usersActions.updateTableSorting({ + sort: newSort as SortUsersField, + tableType, + }) + ); + } + } + }, + [dispatch, sort] + ); + const columns = useMemo(() => getUsersColumns(), []); + + return ( + + ); +}; + +UsersTableComponent.displayName = 'UsersTableComponent'; + +export const UsersTable = React.memo(UsersTableComponent); + +const getUsersColumns = (): UsersTableColumns => [ + { + field: 'name', + name: i18n.USER_NAME, + truncateText: false, + sortable: true, + mobileOptions: { show: true }, + render: (name) => + getRowItemDraggables({ + rowItems: [name], + attrName: 'user.name', + idPrefix: `users-table-${name}-name`, + render: (item) => , + }), + }, + { + field: 'lastSeen', + name: i18n.LAST_SEEN, + sortable: true, + truncateText: false, + mobileOptions: { show: true }, + render: (lastSeen) => , + }, + { + field: 'domain', + name: i18n.DOMAIN, + sortable: false, + truncateText: false, + mobileOptions: { show: true }, + render: (domain) => + getRowItemDraggables({ + rowItems: [domain], + attrName: 'user.domain', + idPrefix: `users-table-${domain}-domain`, + }), + }, +]; diff --git a/x-pack/plugins/security_solution/public/users/components/all_users/translations.ts b/x-pack/plugins/security_solution/public/users/components/all_users/translations.ts new file mode 100644 index 0000000000000..e24c8575f0ef0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/users/components/all_users/translations.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const USERS = i18n.translate('xpack.securitySolution.usersTable.title', { + defaultMessage: 'Users', +}); + +export const USER_NAME = i18n.translate('xpack.securitySolution.usersTable.userNameTitle', { + defaultMessage: 'User name', +}); + +export const LAST_SEEN = i18n.translate('xpack.securitySolution.usersTable.lastSeenTitle', { + defaultMessage: 'Last seen', +}); + +export const DOMAIN = i18n.translate('xpack.securitySolution.usersTable.domainTitle', { + defaultMessage: 'Domain', +}); + +export const ROWS_5 = i18n.translate('xpack.securitySolution.usersTable.rows', { + values: { numRows: 5 }, + defaultMessage: '{numRows} {numRows, plural, =0 {rows} =1 {row} other {rows}}', +}); + +export const ROWS_10 = i18n.translate('xpack.securitySolution.usersTable.rows', { + values: { numRows: 10 }, + defaultMessage: '{numRows} {numRows, plural, =0 {rows} =1 {row} other {rows}}', +}); + +export const UNIT = (totalCount: number) => + i18n.translate('xpack.securitySolution.usersTable.unit', { + values: { totalCount }, + defaultMessage: `{totalCount, plural, =1 {user} other {users}}`, + }); diff --git a/x-pack/plugins/security_solution/public/users/components/kpi_users/total_users/index.test.tsx b/x-pack/plugins/security_solution/public/users/components/kpi_users/total_users/index.test.tsx index 6425f40016fb9..cedfd6b50153d 100644 --- a/x-pack/plugins/security_solution/public/users/components/kpi_users/total_users/index.test.tsx +++ b/x-pack/plugins/security_solution/public/users/components/kpi_users/total_users/index.test.tsx @@ -52,7 +52,7 @@ describe('Total Users KPI', () => { ); - expect(mockUseSearchStrategy.mock.calls[0][0].skip).toEqual(false); + expect(mockUseSearchStrategy.mock.calls[0][0].abort).toEqual(false); expect(mockSearch).toHaveBeenCalled(); }); it('toggleStatus=false, skip', () => { @@ -62,7 +62,7 @@ describe('Total Users KPI', () => { ); - expect(mockUseSearchStrategy.mock.calls[0][0].skip).toEqual(true); + expect(mockUseSearchStrategy.mock.calls[0][0].abort).toEqual(true); expect(mockSearch).not.toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/users/components/kpi_users/total_users/index.tsx b/x-pack/plugins/security_solution/public/users/components/kpi_users/total_users/index.tsx index ffa5d851875ce..d4f1ac9df22c8 100644 --- a/x-pack/plugins/security_solution/public/users/components/kpi_users/total_users/index.tsx +++ b/x-pack/plugins/security_solution/public/users/components/kpi_users/total_users/index.tsx @@ -61,7 +61,7 @@ const TotalUsersKpiComponent: React.FC = ({ setQuery, skip, }) => { - const { toggleStatus } = useQueryToggle(UsersQueries.kpiTotalUsers); + const { toggleStatus } = useQueryToggle(QUERY_ID); const [querySkip, setQuerySkip] = useState(skip || !toggleStatus); useEffect(() => { setQuerySkip(skip || !toggleStatus); @@ -71,7 +71,7 @@ const TotalUsersKpiComponent: React.FC = ({ factoryQueryType: UsersQueries.kpiTotalUsers, initialResult: { users: 0, usersHistogram: [] }, errorMessage: i18n.ERROR_USERS_KPI, - skip: querySkip, + abort: querySkip, }); useEffect(() => { diff --git a/x-pack/plugins/security_solution/public/users/pages/constants.ts b/x-pack/plugins/security_solution/public/users/pages/constants.ts index 793d7c6164b2d..39d8c1546c863 100644 --- a/x-pack/plugins/security_solution/public/users/pages/constants.ts +++ b/x-pack/plugins/security_solution/public/users/pages/constants.ts @@ -10,6 +10,6 @@ import { UsersTableType } from '../store/model'; export const usersDetailsPagePath = `${USERS_PATH}/:detailName`; -export const usersTabPath = `${USERS_PATH}/:tabName(${UsersTableType.allUsers}|${UsersTableType.anomalies}|${UsersTableType.risk}|${UsersTableType.events}|${UsersTableType.alerts})`; +export const usersTabPath = `${USERS_PATH}/:tabName(${UsersTableType.allUsers}|${UsersTableType.authentications}|${UsersTableType.anomalies}|${UsersTableType.risk}|${UsersTableType.events}|${UsersTableType.alerts})`; export const usersDetailsTabPath = `${usersDetailsPagePath}/:tabName(${UsersTableType.anomalies}|${UsersTableType.events}|${UsersTableType.alerts})`; diff --git a/x-pack/plugins/security_solution/public/users/pages/details/utils.ts b/x-pack/plugins/security_solution/public/users/pages/details/utils.ts index f4bdd7e6caa67..e648a8998a989 100644 --- a/x-pack/plugins/security_solution/public/users/pages/details/utils.ts +++ b/x-pack/plugins/security_solution/public/users/pages/details/utils.ts @@ -22,6 +22,7 @@ export const type = usersModel.UsersType.details; const TabNameMappedToI18nKey: Record = { [UsersTableType.allUsers]: i18n.NAVIGATION_ALL_USERS_TITLE, + [UsersTableType.authentications]: i18n.NAVIGATION_AUTHENTICATIONS_TITLE, [UsersTableType.anomalies]: i18n.NAVIGATION_ANOMALIES_TITLE, [UsersTableType.risk]: i18n.NAVIGATION_RISK_TITLE, [UsersTableType.events]: i18n.NAVIGATION_EVENTS_TITLE, diff --git a/x-pack/plugins/security_solution/public/users/pages/nav_tabs.tsx b/x-pack/plugins/security_solution/public/users/pages/nav_tabs.tsx index 254807eae27cc..3097fdeb604f3 100644 --- a/x-pack/plugins/security_solution/public/users/pages/nav_tabs.tsx +++ b/x-pack/plugins/security_solution/public/users/pages/nav_tabs.tsx @@ -26,6 +26,12 @@ export const navTabsUsers = ( href: getTabsOnUsersUrl(UsersTableType.allUsers), disabled: false, }, + [UsersTableType.authentications]: { + id: UsersTableType.authentications, + name: i18n.NAVIGATION_AUTHENTICATIONS_TITLE, + href: getTabsOnUsersUrl(UsersTableType.authentications), + disabled: false, + }, [UsersTableType.anomalies]: { id: UsersTableType.anomalies, name: i18n.NAVIGATION_ANOMALIES_TITLE, diff --git a/x-pack/plugins/security_solution/public/users/pages/navigation/all_users_query_tab_body.test.tsx b/x-pack/plugins/security_solution/public/users/pages/navigation/all_users_query_tab_body.test.tsx index 98b69d531c4dc..b0147258b178c 100644 --- a/x-pack/plugins/security_solution/public/users/pages/navigation/all_users_query_tab_body.test.tsx +++ b/x-pack/plugins/security_solution/public/users/pages/navigation/all_users_query_tab_body.test.tsx @@ -8,61 +8,69 @@ import React from 'react'; import { render } from '@testing-library/react'; import { TestProviders } from '../../../common/mock'; -import { useAuthentications } from '../../../hosts/containers/authentications'; + import { useQueryToggle } from '../../../common/containers/query_toggle'; import { AllUsersQueryTabBody } from './all_users_query_tab_body'; import { UsersType } from '../../store/model'; -jest.mock('../../../hosts/containers/authentications'); jest.mock('../../../common/containers/query_toggle'); jest.mock('../../../common/lib/kibana'); +const mockSearch = jest.fn(); + +jest.mock('../../../common/containers/use_search_strategy', () => { + const original = jest.requireActual('../../../common/containers/use_search_strategy'); + return { + ...original, + useSearchStrategy: () => ({ + search: mockSearch, + loading: false, + inspect: { + dsl: [], + response: [], + }, + result: { + users: [], + totalCount: 0, + pageInfo: { activePage: 1, fakeTotalCount: 100, showMorePagesIndicator: false }, + }, + refetch: jest.fn(), + }), + }; +}); + describe('All users query tab body', () => { - const mockUseAuthentications = useAuthentications as jest.Mock; const mockUseQueryToggle = useQueryToggle as jest.Mock; const defaultProps = { + skip: false, indexNames: [], setQuery: jest.fn(), - skip: false, startDate: '2019-06-25T04:31:59.345Z', endDate: '2019-06-25T06:31:59.345Z', type: UsersType.page, }; + beforeEach(() => { jest.clearAllMocks(); - mockUseQueryToggle.mockReturnValue({ toggleStatus: true, setToggleStatus: jest.fn() }); - mockUseAuthentications.mockReturnValue([ - false, - { - authentications: [], - id: '123', - inspect: { - dsl: [], - response: [], - }, - isInspected: false, - totalCount: 0, - pageInfo: { activePage: 1, fakeTotalCount: 100, showMorePagesIndicator: false }, - loadPage: jest.fn(), - refetch: jest.fn(), - }, - ]); }); - it('toggleStatus=true, do not skip', () => { + + it('calls search when toggleStatus=true', () => { + mockUseQueryToggle.mockReturnValue({ toggleStatus: true, setToggleStatus: jest.fn() }); render( ); - expect(mockUseAuthentications.mock.calls[0][0].skip).toEqual(false); + expect(mockSearch).toHaveBeenCalled(); }); - it('toggleStatus=false, skip', () => { + + it("doesn't calls search when toggleStatus=false", () => { mockUseQueryToggle.mockReturnValue({ toggleStatus: false, setToggleStatus: jest.fn() }); render( ); - expect(mockUseAuthentications.mock.calls[0][0].skip).toEqual(true); + expect(mockSearch).not.toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/users/pages/navigation/all_users_query_tab_body.tsx b/x-pack/plugins/security_solution/public/users/pages/navigation/all_users_query_tab_body.tsx index b5c8b199fda54..164df6325bb09 100644 --- a/x-pack/plugins/security_solution/public/users/pages/navigation/all_users_query_tab_body.tsx +++ b/x-pack/plugins/security_solution/public/users/pages/navigation/all_users_query_tab_body.tsx @@ -5,16 +5,24 @@ * 2.0. */ -import { getOr } from 'lodash/fp'; -import React, { useEffect, useState } from 'react'; -import { useAuthentications, ID } from '../../../hosts/containers/authentications'; +import { getOr, noop } from 'lodash/fp'; +import React, { useEffect, useMemo, useState } from 'react'; + import { UsersComponentsQueryProps } from './types'; -import { AuthenticationTable } from '../../../hosts/components/authentications_table'; import { manageQuery } from '../../../common/components/page/manage_query'; +import { UsersTable } from '../../components/all_users'; +import { useSearchStrategy } from '../../../common/containers/use_search_strategy'; +import { UsersQueries } from '../../../../common/search_strategy/security_solution/users'; +import * as i18n from './translations'; +import { generateTablePaginationOptions } from '../../../common/components/paginated_table/helpers'; +import { useDeepEqualSelector } from '../../../common/hooks/use_selector'; +import { usersSelectors } from '../../store'; import { useQueryToggle } from '../../../common/containers/query_toggle'; -const AuthenticationTableManage = manageQuery(AuthenticationTable); +const UsersTableManage = manageQuery(UsersTable); + +const QUERY_ID = 'UsersTable'; export const AllUsersQueryTabBody = ({ endDate, @@ -27,46 +35,80 @@ export const AllUsersQueryTabBody = ({ docValueFields, deleteQuery, }: UsersComponentsQueryProps) => { - const { toggleStatus } = useQueryToggle(ID); + const { toggleStatus } = useQueryToggle(QUERY_ID); const [querySkip, setQuerySkip] = useState(skip || !toggleStatus); useEffect(() => { setQuerySkip(skip || !toggleStatus); }, [skip, toggleStatus]); - const [ + + const getUsersSelector = useMemo(() => usersSelectors.allUsersSelector(), []); + const { activePage, limit, sort } = useDeepEqualSelector((state) => getUsersSelector(state)); + + const { loading, - { authentications, totalCount, pageInfo, loadPage, id, inspect, isInspected, refetch }, - ] = useAuthentications({ - docValueFields, + result: { users, pageInfo, totalCount }, + search, + refetch, + inspect, + } = useSearchStrategy({ + factoryQueryType: UsersQueries.users, + initialResult: { + users: [], + totalCount: 0, + pageInfo: { + activePage: 0, + fakeTotalCount: 0, + showMorePagesIndicator: false, + }, + }, + errorMessage: i18n.ERROR_FETCHING_USERS_DATA, + abort: querySkip, + }); + + useEffect(() => { + if (!querySkip) { + search({ + filterQuery, + defaultIndex: indexNames, + docValueFields, + timerange: { + interval: '12h', + from: startDate, + to: endDate, + }, + pagination: generateTablePaginationOptions(activePage, limit), + sort, + }); + } + }, [ + search, + startDate, endDate, filterQuery, indexNames, - skip: querySkip, - startDate, - // TODO Move authentication table and hook store to 'public/common' folder when 'usersEnabled' FF is removed - // @ts-ignore - type, - deleteQuery, - }); + querySkip, + docValueFields, + activePage, + limit, + sort, + ]); + return ( - ); }; diff --git a/x-pack/plugins/security_solution/public/users/pages/navigation/authentications_query_tab_body.test.tsx b/x-pack/plugins/security_solution/public/users/pages/navigation/authentications_query_tab_body.test.tsx new file mode 100644 index 0000000000000..83c2b0dfa6b72 --- /dev/null +++ b/x-pack/plugins/security_solution/public/users/pages/navigation/authentications_query_tab_body.test.tsx @@ -0,0 +1,68 @@ +/* + * 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 { render } from '@testing-library/react'; +import { TestProviders } from '../../../common/mock'; +import { useAuthentications } from '../../../hosts/containers/authentications'; +import { useQueryToggle } from '../../../common/containers/query_toggle'; +import { AuthenticationsQueryTabBody } from './authentications_query_tab_body'; +import { UsersType } from '../../store/model'; + +jest.mock('../../../hosts/containers/authentications'); +jest.mock('../../../common/containers/query_toggle'); +jest.mock('../../../common/lib/kibana'); + +describe('Authentications query tab body', () => { + const mockUseAuthentications = useAuthentications as jest.Mock; + const mockUseQueryToggle = useQueryToggle as jest.Mock; + const defaultProps = { + indexNames: [], + setQuery: jest.fn(), + skip: false, + startDate: '2019-06-25T04:31:59.345Z', + endDate: '2019-06-25T06:31:59.345Z', + type: UsersType.page, + }; + beforeEach(() => { + jest.clearAllMocks(); + mockUseQueryToggle.mockReturnValue({ toggleStatus: true, setToggleStatus: jest.fn() }); + mockUseAuthentications.mockReturnValue([ + false, + { + authentications: [], + id: '123', + inspect: { + dsl: [], + response: [], + }, + isInspected: false, + totalCount: 0, + pageInfo: { activePage: 1, fakeTotalCount: 100, showMorePagesIndicator: false }, + loadPage: jest.fn(), + refetch: jest.fn(), + }, + ]); + }); + it('toggleStatus=true, do not skip', () => { + render( + + + + ); + expect(mockUseAuthentications.mock.calls[0][0].skip).toEqual(false); + }); + it('toggleStatus=false, skip', () => { + mockUseQueryToggle.mockReturnValue({ toggleStatus: false, setToggleStatus: jest.fn() }); + render( + + + + ); + expect(mockUseAuthentications.mock.calls[0][0].skip).toEqual(true); + }); +}); diff --git a/x-pack/plugins/security_solution/public/users/pages/navigation/authentications_query_tab_body.tsx b/x-pack/plugins/security_solution/public/users/pages/navigation/authentications_query_tab_body.tsx new file mode 100644 index 0000000000000..6926a1e755f01 --- /dev/null +++ b/x-pack/plugins/security_solution/public/users/pages/navigation/authentications_query_tab_body.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getOr } from 'lodash/fp'; +import React, { useEffect, useState } from 'react'; +import { useAuthentications, ID } from '../../../hosts/containers/authentications'; +import { UsersComponentsQueryProps } from './types'; +import { AuthenticationTable } from '../../../hosts/components/authentications_table'; +import { manageQuery } from '../../../common/components/page/manage_query'; +import { useQueryToggle } from '../../../common/containers/query_toggle'; + +const AuthenticationTableManage = manageQuery(AuthenticationTable); + +export const AuthenticationsQueryTabBody = ({ + endDate, + filterQuery, + indexNames, + skip, + setQuery, + startDate, + type, + docValueFields, + deleteQuery, +}: UsersComponentsQueryProps) => { + const { toggleStatus } = useQueryToggle(ID); + const [querySkip, setQuerySkip] = useState(skip || !toggleStatus); + useEffect(() => { + setQuerySkip(skip || !toggleStatus); + }, [skip, toggleStatus]); + + const [ + loading, + { authentications, totalCount, pageInfo, loadPage, id, inspect, isInspected, refetch }, + ] = useAuthentications({ + docValueFields, + endDate, + filterQuery, + indexNames, + skip: querySkip, + startDate, + // TODO Move authentication table and hook store to 'public/common' folder when 'usersEnabled' FF is removed + // @ts-ignore + type, + deleteQuery, + }); + return ( + + ); +}; + +AuthenticationsQueryTabBody.displayName = 'AllUsersQueryTabBody'; diff --git a/x-pack/plugins/security_solution/public/users/pages/navigation/index.ts b/x-pack/plugins/security_solution/public/users/pages/navigation/index.ts index 0d6393bee9369..5cc5e255719ba 100644 --- a/x-pack/plugins/security_solution/public/users/pages/navigation/index.ts +++ b/x-pack/plugins/security_solution/public/users/pages/navigation/index.ts @@ -6,3 +6,4 @@ */ export * from './all_users_query_tab_body'; +export * from './authentications_query_tab_body'; diff --git a/x-pack/plugins/security_solution/public/users/pages/navigation/translations.ts b/x-pack/plugins/security_solution/public/users/pages/navigation/translations.ts new file mode 100644 index 0000000000000..c625927320ba1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/users/pages/navigation/translations.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. + */ +import { i18n } from '@kbn/i18n'; + +export const ERROR_FETCHING_USERS_DATA = i18n.translate( + 'xpack.securitySolution.userTab.errorFetchingsData', + { + defaultMessage: 'Failed to query users data', + } +); diff --git a/x-pack/plugins/security_solution/public/users/pages/translations.ts b/x-pack/plugins/security_solution/public/users/pages/translations.ts index 96dcf8d2c8871..41fec21c5bfb0 100644 --- a/x-pack/plugins/security_solution/public/users/pages/translations.ts +++ b/x-pack/plugins/security_solution/public/users/pages/translations.ts @@ -18,6 +18,13 @@ export const NAVIGATION_ALL_USERS_TITLE = i18n.translate( } ); +export const NAVIGATION_AUTHENTICATIONS_TITLE = i18n.translate( + 'xpack.securitySolution.users.navigation.authenticationsTitle', + { + defaultMessage: 'Authentications', + } +); + export const NAVIGATION_ANOMALIES_TITLE = i18n.translate( 'xpack.securitySolution.users.navigation.anomaliesTitle', { diff --git a/x-pack/plugins/security_solution/public/users/pages/users_tabs.tsx b/x-pack/plugins/security_solution/public/users/pages/users_tabs.tsx index 522ff4c009504..c0e3fb3e4ab18 100644 --- a/x-pack/plugins/security_solution/public/users/pages/users_tabs.tsx +++ b/x-pack/plugins/security_solution/public/users/pages/users_tabs.tsx @@ -11,7 +11,7 @@ import { Route, Switch } from 'react-router-dom'; import { UsersTabsProps } from './types'; import { UsersTableType } from '../store/model'; import { USERS_PATH } from '../../../common/constants'; -import { AllUsersQueryTabBody } from './navigation'; +import { AllUsersQueryTabBody, AuthenticationsQueryTabBody } from './navigation'; import { AnomaliesQueryTabBody } from '../../common/containers/anomalies/anomalies_query_tab_body'; import { AnomaliesUserTable } from '../../common/components/ml/tables/anomalies_user_table'; import { Anomaly } from '../../common/components/ml/types'; @@ -80,6 +80,9 @@ export const UsersTabs = memo( + + + diff --git a/x-pack/plugins/security_solution/public/users/store/actions.ts b/x-pack/plugins/security_solution/public/users/store/actions.ts index b1d83f29da8c8..9e68891ba3975 100644 --- a/x-pack/plugins/security_solution/public/users/store/actions.ts +++ b/x-pack/plugins/security_solution/public/users/store/actions.ts @@ -8,6 +8,7 @@ import actionCreatorFactory from 'typescript-fsa'; import { usersModel } from '.'; import { RiskScoreSortField, RiskSeverity } from '../../../common/search_strategy'; +import { SortUsersField } from '../../../common/search_strategy/security_solution/users/common'; const actionCreator = actionCreatorFactory('x-pack/security_solution/local/users'); @@ -30,8 +31,8 @@ export const updateTableActivePage = actionCreator<{ }>('UPDATE_USERS_ACTIVE_PAGE'); export const updateTableSorting = actionCreator<{ - sort: RiskScoreSortField; - tableType: usersModel.UsersTableType.risk; + tableType: usersModel.UsersTableType; + sort: RiskScoreSortField | SortUsersField; }>('UPDATE_USERS_SORTING'); export const updateUserRiskScoreSeverityFilter = actionCreator<{ diff --git a/x-pack/plugins/security_solution/public/users/store/model.ts b/x-pack/plugins/security_solution/public/users/store/model.ts index 6e4a3730eca86..491f35c5efd12 100644 --- a/x-pack/plugins/security_solution/public/users/store/model.ts +++ b/x-pack/plugins/security_solution/public/users/store/model.ts @@ -6,6 +6,7 @@ */ import { RiskScoreSortField, RiskSeverity } from '../../../common/search_strategy'; +import { SortUsersField } from '../../../common/search_strategy/security_solution/users/common'; export enum UsersType { page = 'page', @@ -14,6 +15,7 @@ export enum UsersType { export enum UsersTableType { allUsers = 'allUsers', + authentications = 'authentications', anomalies = 'anomalies', risk = 'userRisk', events = 'events', @@ -27,15 +29,18 @@ export interface BasicQueryPaginated { limit: number; } -export type AllUsersQuery = BasicQueryPaginated; +export interface AllUsersQuery extends BasicQueryPaginated { + sort: SortUsersField; +} export interface UsersRiskScoreQuery extends BasicQueryPaginated { - sort: RiskScoreSortField; // TODO fix it when be is implemented + sort: RiskScoreSortField; severitySelection: RiskSeverity[]; } export interface UsersQueries { [UsersTableType.allUsers]: AllUsersQuery; + [UsersTableType.authentications]: BasicQueryPaginated; [UsersTableType.anomalies]: null | undefined; [UsersTableType.risk]: UsersRiskScoreQuery; [UsersTableType.events]: BasicQueryPaginated; diff --git a/x-pack/plugins/security_solution/public/users/store/reducer.ts b/x-pack/plugins/security_solution/public/users/store/reducer.ts index 4b263eecb8c5a..3eaf57a37bda3 100644 --- a/x-pack/plugins/security_solution/public/users/store/reducer.ts +++ b/x-pack/plugins/security_solution/public/users/store/reducer.ts @@ -19,6 +19,7 @@ import { setUsersPageQueriesActivePageToZero } from './helpers'; import { UsersTableType, UsersModel } from './model'; import { Direction } from '../../../common/search_strategy/common'; import { RiskScoreFields } from '../../../common/search_strategy'; +import { UsersFields } from '../../../common/search_strategy/security_solution/users/common'; export const initialUsersState: UsersModel = { page: { @@ -26,6 +27,14 @@ export const initialUsersState: UsersModel = { [UsersTableType.allUsers]: { activePage: DEFAULT_TABLE_ACTIVE_PAGE, limit: DEFAULT_TABLE_LIMIT, + sort: { + field: UsersFields.lastSeen, + direction: Direction.desc, + }, + }, + [UsersTableType.authentications]: { + activePage: DEFAULT_TABLE_ACTIVE_PAGE, + limit: DEFAULT_TABLE_LIMIT, }, [UsersTableType.risk]: { activePage: DEFAULT_TABLE_ACTIVE_PAGE, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts new file mode 100644 index 0000000000000..753a648d307e8 --- /dev/null +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts @@ -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 { IEsSearchResponse } from '../../../../../../../../../../src/plugins/data/common'; +import { Direction } from '../../../../../../../common/search_strategy'; +import { UsersQueries } from '../../../../../../../common/search_strategy/security_solution/users'; +import { UsersRequestOptions } from '../../../../../../../common/search_strategy/security_solution/users/all'; +import { UsersFields } from '../../../../../../../common/search_strategy/security_solution/users/common'; + +export const mockOptions: UsersRequestOptions = { + defaultIndex: ['test_indices*'], + docValueFields: [ + { + field: '@timestamp', + format: 'date_time', + }, + ], + factoryQueryType: UsersQueries.users, + filterQuery: + '{"bool":{"must":[],"filter":[{"match_all":{}},{"match_phrase":{"user.name":{"query":"test_user"}}}],"should":[],"must_not":[]}}', + timerange: { + interval: '12h', + from: '2020-09-02T15:17:13.678Z', + to: '2020-09-03T15:17:13.678Z', + }, + params: {}, + pagination: { + activePage: 0, + cursorStart: 0, + fakePossibleCount: 50, + querySize: 10, + }, + sort: { field: UsersFields.name, direction: Direction.asc }, +}; + +export const mockSearchStrategyResponse: IEsSearchResponse = { + rawResponse: { + took: 2, + timed_out: false, + _shards: { + total: 2, + successful: 2, + skipped: 1, + failed: 0, + }, + hits: { + max_score: null, + hits: [], + }, + aggregations: { + user_count: { + value: 1, + }, + user_data: { + doc_count_error_upper_bound: 0, + sum_other_doc_count: 0, + buckets: [ + { + key: 'vagrant', + doc_count: 780, + lastSeen: { + value: 1644837532000, + value_as_string: '2022-02-14T11:18:52.000Z', + }, + domain: { + hits: { + total: { + value: 780, + relation: 'eq', + }, + max_score: null, + hits: [ + { + _index: 'endgame-00001', + _id: 'inT0934BjUd1_U2597Vf', + _score: null, + _source: { + user: { + domain: 'ENDPOINT-W-8-03', + }, + }, + sort: [1644837532000], + }, + ], + }, + }, + }, + ], + }, + }, + }, + isPartial: false, + isRunning: false, + total: 2, + loaded: 2, +}; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap new file mode 100644 index 0000000000000..b52d0b1fc1cfd --- /dev/null +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap @@ -0,0 +1,21 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`allHosts search strategy parse should parse data correctly 1`] = ` +Array [ + Object { + "domain": "ENDPOINT-W-8-03", + "lastSeen": "2022-02-14T11:18:52.000Z", + "name": "vagrant", + }, +] +`; + +exports[`allHosts search strategy parse should parse data correctly 2`] = `1`; + +exports[`allHosts search strategy parse should parse data correctly 3`] = ` +Object { + "activePage": 0, + "fakeTotalCount": 1, + "showMorePagesIndicator": false, +} +`; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap new file mode 100644 index 0000000000000..99f85724d2f5c --- /dev/null +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`buildUsersQuery build query from options correctly 1`] = ` +Object { + "allow_no_indices": true, + "body": Object { + "aggregations": Object { + "user_count": Object { + "cardinality": Object { + "field": "user.name", + }, + }, + "user_data": Object { + "aggs": Object { + "domain": Object { + "top_hits": Object { + "_source": Object { + "includes": Array [ + "user.domain", + ], + }, + "size": 1, + "sort": Array [ + Object { + "@timestamp": Object { + "order": "desc", + }, + }, + ], + }, + }, + "lastSeen": Object { + "max": Object { + "field": "@timestamp", + }, + }, + }, + "terms": Object { + "field": "user.name", + "order": Object { + "_key": "asc", + }, + "size": 10, + }, + }, + }, + "docvalue_fields": Array [ + Object { + "field": "@timestamp", + "format": "date_time", + }, + ], + "query": Object { + "bool": Object { + "filter": Array [ + Object { + "bool": Object { + "filter": Array [ + Object { + "match_all": Object {}, + }, + Object { + "match_phrase": Object { + "user.name": Object { + "query": "test_user", + }, + }, + }, + ], + "must": Array [], + "must_not": Array [], + "should": Array [], + }, + }, + Object { + "range": Object { + "@timestamp": Object { + "format": "strict_date_optional_time", + "gte": "2020-09-02T15:17:13.678Z", + "lte": "2020-09-03T15:17:13.678Z", + }, + }, + }, + ], + }, + }, + "size": 0, + }, + "ignore_unavailable": true, + "index": Array [ + "test_indices*", + ], + "track_total_hits": false, +} +`; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts new file mode 100644 index 0000000000000..5d7562e1e0a7f --- /dev/null +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; + +import * as buildQuery from './query.all_users.dsl'; +import { allUsers } from '.'; +import { mockOptions, mockSearchStrategyResponse } from './__mocks__'; +import { UsersRequestOptions } from '../../../../../../common/search_strategy/security_solution/users/all'; + +describe('allHosts search strategy', () => { + const buildAllHostsQuery = jest.spyOn(buildQuery, 'buildUsersQuery'); + + afterEach(() => { + buildAllHostsQuery.mockClear(); + }); + + describe('buildDsl', () => { + test('should build dsl query', () => { + allUsers.buildDsl(mockOptions); + expect(buildAllHostsQuery).toHaveBeenCalledWith(mockOptions); + }); + + test('should throw error if query size is greater equal than DEFAULT_MAX_TABLE_QUERY_SIZE ', () => { + const overSizeOptions = { + ...mockOptions, + pagination: { + ...mockOptions.pagination, + querySize: DEFAULT_MAX_TABLE_QUERY_SIZE, + }, + } as UsersRequestOptions; + + expect(() => { + allUsers.buildDsl(overSizeOptions); + }).toThrowError(`No query size above ${DEFAULT_MAX_TABLE_QUERY_SIZE}`); + }); + }); + + describe('parse', () => { + test('should parse data correctly', async () => { + const result = await allUsers.parse(mockOptions, mockSearchStrategyResponse); + expect(result.users).toMatchSnapshot(); + expect(result.totalCount).toMatchSnapshot(); + expect(result.pageInfo).toMatchSnapshot(); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts new file mode 100644 index 0000000000000..645a5350ca988 --- /dev/null +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getOr } from 'lodash/fp'; + +import type { IEsSearchResponse } from '../../../../../../../../../src/plugins/data/common'; +import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../common/constants'; + +import { inspectStringifyObject } from '../../../../../utils/build_query'; +import { SecuritySolutionFactory } from '../../types'; +import { buildUsersQuery } from './query.all_users.dsl'; +import { UsersQueries } from '../../../../../../common/search_strategy/security_solution/users'; +import { + UsersRequestOptions, + UsersStrategyResponse, +} from '../../../../../../common/search_strategy/security_solution/users/all'; +import { AllUsersAggEsItem } from '../../../../../../common/search_strategy/security_solution/users/common'; + +export const allUsers: SecuritySolutionFactory = { + buildDsl: (options: UsersRequestOptions) => { + if (options.pagination && options.pagination.querySize >= DEFAULT_MAX_TABLE_QUERY_SIZE) { + throw new Error(`No query size above ${DEFAULT_MAX_TABLE_QUERY_SIZE}`); + } + return buildUsersQuery(options); + }, + parse: async ( + options: UsersRequestOptions, + response: IEsSearchResponse + ): Promise => { + const { activePage, cursorStart, fakePossibleCount, querySize } = options.pagination; + const inspect = { + dsl: [inspectStringifyObject(buildUsersQuery(options))], + }; + + const buckets: AllUsersAggEsItem[] = getOr( + [], + 'aggregations.user_data.buckets', + response.rawResponse + ); + + const totalCount = getOr(0, 'aggregations.user_count.value', response.rawResponse); + + const fakeTotalCount = fakePossibleCount <= totalCount ? fakePossibleCount : totalCount; + + const users = buckets.map( + (bucket: AllUsersAggEsItem) => ({ + name: bucket.key, + lastSeen: getOr(null, `lastSeen.value_as_string`, bucket), + domain: getOr(null, `domain.hits.hits[0]._source.user.domain`, bucket), + }), + {} + ); + + const showMorePagesIndicator = totalCount > fakeTotalCount; + return { + ...response, + inspect, + totalCount, + users: users.splice(cursorStart, querySize - cursorStart), + pageInfo: { + activePage: activePage ?? 0, + fakeTotalCount, + showMorePagesIndicator, + }, + }; + }, +}; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.test.ts new file mode 100644 index 0000000000000..3a0e209044514 --- /dev/null +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.test.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { buildUsersQuery } from './query.all_users.dsl'; +import { mockOptions } from './__mocks__/'; + +describe('buildUsersQuery', () => { + test('build query from options correctly', () => { + expect(buildUsersQuery(mockOptions)).toMatchSnapshot(); + }); +}); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts new file mode 100644 index 0000000000000..ee98c92d2ac6b --- /dev/null +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts @@ -0,0 +1,92 @@ +/* + * 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 { isEmpty } from 'lodash/fp'; +import type { ISearchRequestParams } from '../../../../../../../../../src/plugins/data/common'; +import { Direction } from '../../../../../../common/search_strategy'; +import { createQueryFilterClauses } from '../../../../../utils/build_query'; +import { UsersRequestOptions } from '../../../../../../common/search_strategy/security_solution/users/all'; +import { + SortUsersField, + UsersFields, +} from '../../../../../../common/search_strategy/security_solution/users/common'; +import { assertUnreachable } from '../../../../../../common/utility_types'; + +export const buildUsersQuery = ({ + defaultIndex, + docValueFields, + filterQuery, + pagination: { querySize }, + sort, + timerange: { from, to }, +}: UsersRequestOptions): ISearchRequestParams => { + const filter = [ + ...createQueryFilterClauses(filterQuery), + { + range: { + '@timestamp': { + gte: from, + lte: to, + format: 'strict_date_optional_time', + }, + }, + }, + ]; + + const agg = { user_count: { cardinality: { field: 'user.name' } } }; + + const dslQuery = { + allow_no_indices: true, + index: defaultIndex, + ignore_unavailable: true, + track_total_hits: false, + body: { + ...(!isEmpty(docValueFields) ? { docvalue_fields: docValueFields } : {}), + aggregations: { + ...agg, + user_data: { + terms: { size: querySize, field: 'user.name', order: getQueryOrder(sort) }, + aggs: { + lastSeen: { max: { field: '@timestamp' } }, + domain: { + top_hits: { + size: 1, + sort: [ + { + '@timestamp': { + order: 'desc' as const, + }, + }, + ], + _source: { + includes: ['user.domain'], + }, + }, + }, + }, + }, + }, + query: { bool: { filter } }, + size: 0, + }, + }; + + return dslQuery; +}; + +type QueryOrder = { lastSeen: Direction } | { domain: Direction } | { _key: Direction }; + +const getQueryOrder = (sort: SortUsersField): QueryOrder => { + switch (sort.field) { + case UsersFields.lastSeen: + return { lastSeen: sort.direction }; + case UsersFields.name: + return { _key: sort.direction }; + default: + return assertUnreachable(sort.field); + } +}; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/index.ts index 2fe2f44c94e8d..dce2195867358 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/index.ts @@ -9,10 +9,12 @@ import { FactoryQueryTypes } from '../../../../../common/search_strategy/securit import { UsersQueries } from '../../../../../common/search_strategy/security_solution/users'; import { SecuritySolutionFactory } from '../types'; +import { allUsers } from './all'; import { userDetails } from './details'; import { totalUsersKpi } from './kpi/total_users'; export const usersFactory: Record> = { [UsersQueries.details]: userDetails, [UsersQueries.kpiTotalUsers]: totalUsersKpi, + [UsersQueries.users]: allUsers, }; 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 244599b3fc5e4..99b11d1d14cf6 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -5060,6 +5060,34 @@ } } }, + "es_agg_hexagons": { + "properties": { + "min": { + "type": "long", + "_meta": { + "description": "min number of es hexagon layers per map" + } + }, + "max": { + "type": "long", + "_meta": { + "description": "max number of es hexagon layers per map" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "avg number of es hexagon layers per map" + } + }, + "total": { + "type": "long", + "_meta": { + "description": "total number of es hexagon layers in cluster" + } + } + } + }, "es_agg_heatmap": { "properties": { "min": { diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 1595abb458a25..9056d2e6053b3 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -642,9 +642,10 @@ "xpack.lens.section.workspaceLabel": "Espace de travail de visualisation", "xpack.lens.shared.chartValueLabelVisibilityLabel": "Étiquettes", "xpack.lens.shared.curveLabel": "Options visuelles", - "xpack.lens.shared.legend.filterForValueButtonAriaLabel": "Filtre pour la valeur", + "expressionXY.legend.filterForValueButtonAriaLabel": "Filtre pour la valeur", "xpack.lens.shared.legend.filterOptionsLegend": "{legendDataLabel}, options de filtre", - "xpack.lens.shared.legend.filterOutValueButtonAriaLabel": "Filtrer la valeur", + "expressionXY.legend.filterOptionsLegend": "{legendDataLabel}, options de filtre", + "expressionXY.legend.filterOutValueButtonAriaLabel": "Filtrer la valeur", "xpack.lens.shared.legendAlignmentLabel": "Alignement", "xpack.lens.shared.legendInsideAlignmentLabel": "Alignement", "xpack.lens.shared.legendInsideColumnsLabel": "Nombre de colonnes", @@ -730,78 +731,77 @@ "xpack.lens.xyChart.axisSide.left": "Gauche", "xpack.lens.xyChart.axisSide.right": "Droite", "xpack.lens.xyChart.axisSide.top": "Haut", - "xpack.lens.xyChart.axisTitlesSettings.help": "Afficher les titres des axes X et Y", + "expressionXY.xyVis.axisTitlesVisibilitySettings.help": "Afficher les titres des axes X et Y", "xpack.lens.xyChart.bottomAxisDisabledHelpText": "Ce paramètre s'applique uniquement lorsque l'axe du bas est activé.", "xpack.lens.xyChart.bottomAxisLabel": "Axe du bas", "xpack.lens.xyChart.boundaryError": "La limite inférieure doit être plus grande que la limite supérieure", "xpack.lens.xyChart.curveStyleLabel": "Courbes", - "xpack.lens.xyChart.curveType.help": "Définir de quelle façon le type de courbe est rendu pour un graphique linéaire", - "xpack.lens.xyChart.emptyXLabel": "(vide)", - "xpack.lens.xyChart.extentMode.help": "Mode d'extension", - "xpack.lens.xyChart.fillOpacity.help": "Définir l'opacité du remplissage du graphique en aires", + "expressionXY.xyVis.curveType.help": "Définir de quelle façon le type de courbe est rendu pour un graphique linéaire", + "expressionXY.xyChart.emptyXLabel": "(vide)", + "expressionXY.axisExtentConfig.extentMode.help": "Mode d'extension", + "expressionXY.xyVis.fillOpacity.help": "Définir l'opacité du remplissage du graphique en aires", "xpack.lens.xyChart.fillOpacityLabel": "Opacité de remplissage", - "xpack.lens.xyChart.fittingFunction.help": "Définir le mode de traitement des valeurs manquantes", - "xpack.lens.xyChart.floatingColumns.help": "Spécifie le nombre de colonnes lorsque la légende est affichée à l'intérieur du graphique.", + "expressionXY.xyVis.fittingFunction.help": "Définir le mode de traitement des valeurs manquantes", + "expressionXY.legendConfig.floatingColumns.help": "Spécifie le nombre de colonnes lorsque la légende est affichée à l'intérieur du graphique.", "xpack.lens.xyChart.Gridlines": "Quadrillage", - "xpack.lens.xyChart.gridlinesSettings.help": "Afficher le quadrillage des axes X et Y", - "xpack.lens.xyChart.help": "Graphique X/Y", - "xpack.lens.xyChart.hideEndzones.help": "Masquer les marqueurs de zone de fin pour les données partielles", - "xpack.lens.xyChart.horizontalAlignment.help": "Spécifie l'alignement horizontal de la légende lorsqu'elle est affichée à l'intérieur du graphique.", + "expressionXY.xyVis.gridlinesVisibilitySettings.help": "Afficher le quadrillage des axes X et Y", + "expressionXY.xyVis.help": "Graphique X/Y", + "expressionXY.xyVis.hideEndzones.help": "Masquer les marqueurs de zone de fin pour les données partielles", + "expressionXY.legendConfig.horizontalAlignment.help": "Spécifie l'alignement horizontal de la légende lorsqu'elle est affichée à l'intérieur du graphique.", "xpack.lens.xyChart.horizontalAxisLabel": "Axe horizontal", "xpack.lens.xyChart.inclusiveZero": "Les limites doivent inclure zéro.", - "xpack.lens.xyChart.isInside.help": "Spécifie si une légende se trouve à l'intérieur d'un graphique", - "xpack.lens.xyChart.isVisible.help": "Spécifie si la légende est visible ou non.", - "xpack.lens.xyChart.labelsOrientation.help": "Définit la rotation des étiquettes des axes", + "expressionXY.legendConfig.isInside.help": "Spécifie si une légende se trouve à l'intérieur d'un graphique", + "expressionXY.legendConfig.isVisible.help": "Spécifie si la légende est visible ou non.", + "expressionXY.xyVis.labelsOrientation.help": "Définit la rotation des étiquettes des axes", "xpack.lens.xyChart.leftAxisDisabledHelpText": "Ce paramètre s'applique uniquement lorsque l'axe de gauche est activé.", "xpack.lens.xyChart.leftAxisLabel": "Axe de gauche", - "xpack.lens.xyChart.legend.help": "Configurez la légende du graphique.", + "expressionXY.xyVis.legend.help": "Configurez la légende du graphique.", "xpack.lens.xyChart.legendLocation.inside": "Intérieur", "xpack.lens.xyChart.legendLocation.outside": "Extérieur", "xpack.lens.xyChart.legendVisibility.auto": "Auto", "xpack.lens.xyChart.legendVisibility.hide": "Masquer", "xpack.lens.xyChart.legendVisibility.show": "Afficher", - "xpack.lens.xyChart.maxLines.help": "Spécifie le nombre de lignes par élément de légende.", + "expressionXY.legendConfig.maxLines.help": "Spécifie le nombre de lignes par élément de légende.", "xpack.lens.xyChart.missingValuesLabel": "Valeurs manquantes", "xpack.lens.xyChart.missingValuesLabelHelpText": "Par défaut, Lens masque les blancs dans les données. Pour remplir le blanc, effectuez une sélection.", "xpack.lens.xyChart.nestUnderRoot": "Ensemble de données entier", - "xpack.lens.xyChart.position.help": "Spécifie la position de la légende.", - "xpack.lens.xyChart.renderer.help": "Outil de rendu de graphique X/Y", + "expressionXY.legendConfig.position.help": "Spécifie la position de la légende.", + "expressionXY.xyVis.renderer.help": "Outil de rendu de graphique X/Y", "xpack.lens.xyChart.rightAxisDisabledHelpText": "Ce paramètre s'applique uniquement lorsque l'axe de droite est activé.", "xpack.lens.xyChart.rightAxisLabel": "Axe de droite", "xpack.lens.xyChart.seriesColor.auto": "Auto", "xpack.lens.xyChart.seriesColor.label": "Couleur de la série", - "xpack.lens.xyChart.shouldTruncate.help": "Spécifie si les éléments de légende seront tronqués ou non", + "expressionXY.legendConfig.shouldTruncate.help": "Spécifie si les éléments de légende seront tronqués ou non", "xpack.lens.xyChart.showEnzones": "Afficher les marqueurs de données partielles", - "xpack.lens.xyChart.showSingleSeries.help": "Spécifie si une légende comportant une seule entrée doit être affichée", + "expressionXY.legendConfig.showSingleSeries.help": "Spécifie si une légende comportant une seule entrée doit être affichée", "xpack.lens.xyChart.splitSeries": "Répartir par", "xpack.lens.xyChart.tickLabels": "Étiquettes de graduation", - "xpack.lens.xyChart.tickLabelsSettings.help": "Afficher les étiquettes de graduation des axes X et Y", - "xpack.lens.xyChart.title.help": "Titre de l'axe", + "expressionXY.xyVis.tickLabelsVisibilitySettings.help": "Afficher les étiquettes de graduation des axes X et Y", "xpack.lens.xyChart.topAxisDisabledHelpText": "Ce paramètre s'applique uniquement lorsque l'axe du haut est activé.", "xpack.lens.xyChart.topAxisLabel": "Axe du haut", "xpack.lens.xyChart.valuesHistogramDisabledHelpText": "Ce paramètre ne peut pas être modifié dans les histogrammes.", - "xpack.lens.xyChart.valuesInLegend.help": "Afficher les valeurs dans la légende", + "expressionXY.xyVis.valuesInLegend.help": "Afficher les valeurs dans la légende", "xpack.lens.xyChart.valuesPercentageDisabledHelpText": "Ce paramètre ne peut pas être modifié dans les graphiques en aires à pourcentages.", "xpack.lens.xyChart.valuesStackedDisabledHelpText": "Ce paramètre ne peut pas être modifié dans les graphiques empilés ou les graphiques à barres à pourcentages", - "xpack.lens.xyChart.verticalAlignment.help": "Spécifie l'alignement vertical de la légende lorsqu'elle est affichée à l'intérieur du graphique.", + "expressionXY.legendConfig.verticalAlignment.help": "Spécifie l'alignement vertical de la légende lorsqu'elle est affichée à l'intérieur du graphique.", "xpack.lens.xyChart.verticalAxisLabel": "Axe vertical", - "xpack.lens.xyChart.xAxisGridlines.help": "Spécifie si le quadrillage de l'axe X est visible ou non.", - "xpack.lens.xyChart.xAxisLabelsOrientation.help": "Spécifie l'orientation des étiquettes de l'axe X.", - "xpack.lens.xyChart.xAxisTickLabels.help": "Spécifie si les étiquettes de graduation de l'axe X sont visibles ou non.", - "xpack.lens.xyChart.xAxisTitle.help": "Spécifie si le titre de l'axe X est visible ou non.", - "xpack.lens.xyChart.xTitle.help": "Titre de l'axe X", - "xpack.lens.xyChart.yLeftAxisgridlines.help": "Spécifie si le quadrillage de l'axe Y de gauche est visible ou non.", - "xpack.lens.xyChart.yLeftAxisLabelsOrientation.help": "Spécifie l'orientation des étiquettes de l'axe Y de gauche.", - "xpack.lens.xyChart.yLeftAxisTickLabels.help": "Spécifie si les étiquettes de graduation de l'axe Y de gauche sont visibles ou non.", - "xpack.lens.xyChart.yLeftAxisTitle.help": "Spécifie si le titre de l'axe Y de gauche est visible ou non.", - "xpack.lens.xyChart.yLeftExtent.help": "Portée de l'axe Y de gauche", - "xpack.lens.xyChart.yLeftTitle.help": "Titre de l'axe Y de gauche", - "xpack.lens.xyChart.yRightAxisgridlines.help": "Spécifie si le quadrillage de l'axe Y de droite est visible ou non.", - "xpack.lens.xyChart.yRightAxisLabelsOrientation.help": "Spécifie l'orientation des étiquettes de l'axe Y de droite.", - "xpack.lens.xyChart.yRightAxisTickLabels.help": "Spécifie si les étiquettes de graduation de l'axe Y de droite sont visibles ou non.", - "xpack.lens.xyChart.yRightAxisTitle.help": "Spécifie si le titre de l'axe Y de droite est visible ou non.", - "xpack.lens.xyChart.yRightExtent.help": "Portée de l'axe Y de droite", - "xpack.lens.xyChart.yRightTitle.help": "Titre de l'axe Y de droite", + "expressionXY.gridlinesConfig.x.help": "Spécifie si le quadrillage de l'axe X est visible ou non.", + "expressionXY.labelsOrientationConfig.x.help": "Spécifie l'orientation des étiquettes de l'axe X.", + "expressionXY.tickLabelsConfig.x.help": "Spécifie si les étiquettes de graduation de l'axe X sont visibles ou non.", + "expressionXY.axisTitlesVisibilityConfig.x.help": "Spécifie si le titre de l'axe X est visible ou non.", + "expressionXY.xyVis.xTitle.help": "Titre de l'axe X", + "expressionXY.gridlinesConfig.yLeft.help": "Spécifie si le quadrillage de l'axe Y de gauche est visible ou non.", + "expressionXY.labelsOrientationConfig.yLeft.help": "Spécifie l'orientation des étiquettes de l'axe Y de gauche.", + "expressionXY.tickLabelsConfig.yLeft.help": "Spécifie si les étiquettes de graduation de l'axe Y de gauche sont visibles ou non.", + "expressionXY.axisTitlesVisibilityConfig.yLeft.help": "Spécifie si le titre de l'axe Y de gauche est visible ou non.", + "expressionXY.xyVis.yLeftExtent.help": "Portée de l'axe Y de gauche", + "expressionXY.xyVis.yLeftTitle.help": "Titre de l'axe Y de gauche", + "expressionXY.gridlinesConfig.yRight.help": "Spécifie si le quadrillage de l'axe Y de droite est visible ou non.", + "expressionXY.labelsOrientationConfig.yRight.help": "Spécifie l'orientation des étiquettes de l'axe Y de droite.", + "expressionXY.tickLabelsConfig.yRight.help": "Spécifie si les étiquettes de graduation de l'axe Y de droite sont visibles ou non.", + "expressionXY.axisTitlesVisibilityConfig.yRight.help": "Spécifie si le titre de l'axe Y de droite est visible ou non.", + "expressionXY.xyVis.yRightExtent.help": "Portée de l'axe Y de droite", + "expressionXY.xyVis.yRightTitle.help": "Titre de l'axe Y de droite", "xpack.lens.xySuggestions.asPercentageTitle": "Pourcentage", "xpack.lens.xySuggestions.barChartTitle": "Graphique à barres", "xpack.lens.xySuggestions.dateSuggestion": "{yTitle} sur {xTitle}", @@ -9659,7 +9659,6 @@ "xpack.enterpriseSearch.workplaceSearch.sources.learnCustom.features.button": "Découvrir les fonctionnalités de Platinum", "xpack.enterpriseSearch.workplaceSearch.sources.learnMore.link": "En savoir plus", "xpack.enterpriseSearch.workplaceSearch.sources.learnMore.text": "{learnMoreLink} sur les autorisations", - "xpack.enterpriseSearch.workplaceSearch.sources.learnMoreCustom.text": "{learnMoreLink} sur les sources personnalisées.", "xpack.enterpriseSearch.workplaceSearch.sources.licenseCallout.description": "Pour en savoir plus, contactez votre administrateur d'expérience de recherche.", "xpack.enterpriseSearch.workplaceSearch.sources.licenseCallout.title": "Les sources privées ne sont plus disponibles", "xpack.enterpriseSearch.workplaceSearch.sources.noContent.title": "Aucun contenu pour l'instant", @@ -9790,7 +9789,6 @@ "xpack.fileUpload.importComplete.indexingResponse": "Importer la réponse", "xpack.fileUpload.importComplete.indexMgmtLink": "Gestion des index.", "xpack.fileUpload.importComplete.indexModsMsg": "Pour modifier l'index, accéder à ", - "xpack.fileUpload.importComplete.indexPatternResponse": "Réponse du modèle d'indexation", "xpack.fileUpload.importComplete.permission.docLink": "Afficher les autorisations d'importation de fichiers", "xpack.fileUpload.importComplete.permissionFailureMsg": "Vous ne disposez pas d'autorisation pour créer ni importer des données dans l'index \"{indexName}\".", "xpack.fileUpload.importComplete.uploadFailureMsgErrorBlock": "Erreur : {reason}", @@ -9809,7 +9807,6 @@ "xpack.fileUpload.indexNameForm.indexNameGuidelines": "Directives relatives aux noms d'index", "xpack.fileUpload.indexNameForm.indexNameReqField": "Nom d'index, champ requis", "xpack.fileUpload.indexNameRequired": "Nom d'index requis", - "xpack.fileUpload.indexPatternAlreadyExistsErrorMessage": "Le modèle d'indexation existe déjà.", "xpack.fileUpload.indexSettings.enterIndexTypeLabel": "Type d'index", "xpack.fileUpload.maxFileSizeUiSetting.description": "Définit la limite de taille du fichier lors de l'importation des fichiers. La plus grande valeur prise en charge pour ce paramètre est de 1 Go.", "xpack.fileUpload.maxFileSizeUiSetting.error": "Doit être une taille de données valide, par exemple, 200 Mo, 1 Go", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index a8c561b138927..e2e106515d408 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -770,8 +770,11 @@ "xpack.lens.shared.chartValueLabelVisibilityLabel": "ラベル", "xpack.lens.shared.curveLabel": "視覚オプション", "xpack.lens.shared.legend.filterForValueButtonAriaLabel": "値でフィルター", + "expressionXY.legend.filterForValueButtonAriaLabel": "値でフィルター", + "expressionXY.legend.filterOptionsLegend": "{legendDataLabel}、フィルターオプション", "xpack.lens.shared.legend.filterOptionsLegend": "{legendDataLabel}、フィルターオプション", "xpack.lens.shared.legend.filterOutValueButtonAriaLabel": "値を除外", + "expressionXY.legend.filterOutValueButtonAriaLabel": "値を除外", "xpack.lens.shared.legendAlignmentLabel": "アラインメント", "xpack.lens.shared.legendInsideAlignmentLabel": "アラインメント", "xpack.lens.shared.legendInsideColumnsLabel": "列の数", @@ -868,34 +871,34 @@ "xpack.lens.xyChart.axisSide.left": "左", "xpack.lens.xyChart.axisSide.right": "右", "xpack.lens.xyChart.axisSide.top": "トップ", - "xpack.lens.xyChart.axisTitlesSettings.help": "xおよびy軸のタイトルを表示", + "expressionXY.xyVis.axisTitlesVisibilitySettings.help": "xおよびy軸のタイトルを表示", "xpack.lens.xyChart.bottomAxisDisabledHelpText": "この設定は、下の軸が有効であるときにのみ適用されます。", "xpack.lens.xyChart.bottomAxisLabel": "下の軸", "xpack.lens.xyChart.boundaryError": "下界は上界よりも大きくなければなりません", "xpack.lens.xyChart.curveStyleLabel": "曲線", - "xpack.lens.xyChart.curveType.help": "折れ線グラフで曲線タイプをレンダリングする方法を定義します", - "xpack.lens.xyChart.emptyXLabel": "(空)", - "xpack.lens.xyChart.extentMode.help": "範囲モード", - "xpack.lens.xyChart.fillOpacity.help": "エリアグラフの塗りつぶしの透明度を定義", + "expressionXY.xyVis.curveType.help": "折れ線グラフで曲線タイプをレンダリングする方法を定義します", + "expressionXY.xyChart.emptyXLabel": "(空)", + "expressionXY.axisExtentConfig.extentMode.help": "範囲モード", + "expressionXY.xyVis.fillOpacity.help": "エリアグラフの塗りつぶしの透明度を定義", "xpack.lens.xyChart.fillOpacityLabel": "塗りつぶしの透明度", - "xpack.lens.xyChart.fittingFunction.help": "欠測値の処理方法を定義", - "xpack.lens.xyChart.floatingColumns.help": "凡例がグラフ内に表示されるときに列数を指定します。", + "expressionXY.xyVis.fittingFunction.help": "欠測値の処理方法を定義", + "expressionXY.legendConfig.floatingColumns.help": "凡例がグラフ内に表示されるときに列数を指定します。", "xpack.lens.xyChart.Gridlines": "グリッド線", - "xpack.lens.xyChart.gridlinesSettings.help": "xおよびy軸のグリッド線を表示", - "xpack.lens.xyChart.help": "X/Y チャート", - "xpack.lens.xyChart.hideEndzones.help": "部分データの終了ゾーンマーカーを非表示", - "xpack.lens.xyChart.horizontalAlignment.help": "凡例がグラフ内に表示されるときに凡例の横の配置を指定します。", + "expressionXY.xyVis.gridlinesVisibilitySettings.help": "xおよびy軸のグリッド線を表示", + "expressionXY.xyVis.help": "X/Y チャート", + "expressionXY.xyVis.hideEndzones.help": "部分データの終了ゾーンマーカーを非表示", + "expressionXY.legendConfig.horizontalAlignment.help": "凡例がグラフ内に表示されるときに凡例の横の配置を指定します。", "xpack.lens.xyChart.horizontalAxisLabel": "横軸", "xpack.lens.xyChart.horizontalLeftAxisLabel": "横上軸", "xpack.lens.xyChart.horizontalRightAxisLabel": "横下軸", "xpack.lens.xyChart.inclusiveZero": "境界にはゼロを含める必要があります。", - "xpack.lens.xyChart.isInside.help": "凡例がグラフ内に表示されるかどうかを指定します", - "xpack.lens.xyChart.isVisible.help": "判例の表示・非表示を指定します。", - "xpack.lens.xyChart.labelsOrientation.help": "軸ラベルの回転を定義します", + "expressionXY.legendConfig.isInside.help": "凡例がグラフ内に表示されるかどうかを指定します", + "expressionXY.legendConfig.isVisible.help": "判例の表示・非表示を指定します。", + "expressionXY.xyVis.labelsOrientation.help": "軸ラベルの回転を定義します", "xpack.lens.xyChart.layerReferenceLineLabel": "基準線", "xpack.lens.xyChart.leftAxisDisabledHelpText": "この設定は、左の軸が有効であるときにのみ適用されます。", "xpack.lens.xyChart.leftAxisLabel": "左の軸", - "xpack.lens.xyChart.legend.help": "チャートの凡例を構成します。", + "expressionXY.xyVis.legend.help": "チャートの凡例を構成します。", "xpack.lens.xyChart.legendLocation.inside": "内部", "xpack.lens.xyChart.legendLocation.outside": "外側", "xpack.lens.xyChart.legendVisibility.auto": "自動", @@ -905,50 +908,49 @@ "xpack.lens.xyChart.markerPosition.below": "一番下", "xpack.lens.xyChart.markerPosition.left": "左", "xpack.lens.xyChart.markerPosition.right": "右", - "xpack.lens.xyChart.maxLines.help": "凡例項目ごとの行数を指定します。", + "expressionXY.legendConfig.maxLines.help": "凡例項目ごとの行数を指定します。", "xpack.lens.xyChart.missingValuesLabel": "欠測値", "xpack.lens.xyChart.missingValuesLabelHelpText": "デフォルトでは、Lensではデータのギャップが表示されません。ギャップを埋めるには、選択します。", "xpack.lens.xyChart.nestUnderRoot": "データセット全体", - "xpack.lens.xyChart.position.help": "凡例の配置を指定します。", - "xpack.lens.xyChart.renderer.help": "X/Y チャートを再レンダリング", + "expressionXY.legendConfig.position.help": "凡例の配置を指定します。", + "expressionXY.xyVis.renderer.help": "X/Y チャートを再レンダリング", "xpack.lens.xyChart.rightAxisDisabledHelpText": "この設定は、右の軸が有効であるときにのみ適用されます。", "xpack.lens.xyChart.rightAxisLabel": "右の軸", "xpack.lens.xyChart.seriesColor.auto": "自動", "xpack.lens.xyChart.seriesColor.label": "系列色", - "xpack.lens.xyChart.shouldTruncate.help": "凡例項目が切り捨てられるかどうかを指定します", + "expressionXY.legendConfig.shouldTruncate.help": "凡例項目が切り捨てられるかどうかを指定します", "xpack.lens.xyChart.showEnzones": "部分データマーカーを表示", - "xpack.lens.xyChart.showSingleSeries.help": "エントリが1件の凡例を表示するかどうかを指定します", + "expressionXY.legendConfig.showSingleSeries.help": "エントリが1件の凡例を表示するかどうかを指定します", "xpack.lens.xyChart.splitSeries": "内訳の基準", "xpack.lens.xyChart.tickLabels": "目盛ラベル", - "xpack.lens.xyChart.tickLabelsSettings.help": "xおよびy軸の目盛ラベルを表示", - "xpack.lens.xyChart.title.help": "軸のタイトル", + "expressionXY.xyVis.tickLabelsVisibilitySettings.help": "xおよびy軸の目盛ラベルを表示", "xpack.lens.xyChart.topAxisDisabledHelpText": "この設定は、上の軸が有効であるときにのみ適用されます。", "xpack.lens.xyChart.topAxisLabel": "上の軸", "xpack.lens.xyChart.valuesHistogramDisabledHelpText": "この設定はヒストグラムで変更できません。", - "xpack.lens.xyChart.valuesInLegend.help": "凡例に値を表示", + "expressionXY.xyVis.valuesInLegend.help": "凡例に値を表示", "xpack.lens.xyChart.valuesPercentageDisabledHelpText": "この設定は割合エリアグラフで変更できません。", "xpack.lens.xyChart.valuesStackedDisabledHelpText": "この設定は積み上げ棒グラフまたは割合棒グラフで変更できません", - "xpack.lens.xyChart.verticalAlignment.help": "凡例がグラフ内に表示されるときに凡例の縦の配置を指定します。", + "expressionXY.legendConfig.verticalAlignment.help": "凡例がグラフ内に表示されるときに凡例の縦の配置を指定します。", "xpack.lens.xyChart.verticalAxisLabel": "縦軸", "xpack.lens.xyChart.verticalLeftAxisLabel": "縦左軸", "xpack.lens.xyChart.verticalRightAxisLabel": "縦右軸", - "xpack.lens.xyChart.xAxisGridlines.help": "x 軸のグリッド線を表示するかどうかを指定します。", - "xpack.lens.xyChart.xAxisLabelsOrientation.help": "x軸のラベルの向きを指定します。", - "xpack.lens.xyChart.xAxisTickLabels.help": "x軸の目盛ラベルを表示するかどうかを指定します。", - "xpack.lens.xyChart.xAxisTitle.help": "x軸のタイトルを表示するかどうかを指定します。", - "xpack.lens.xyChart.xTitle.help": "x軸のタイトル", - "xpack.lens.xyChart.yLeftAxisgridlines.help": "左y軸のグリッド線を表示するかどうかを指定します。", - "xpack.lens.xyChart.yLeftAxisLabelsOrientation.help": "左y軸のラベルの向きを指定します。", - "xpack.lens.xyChart.yLeftAxisTickLabels.help": "左y軸の目盛ラベルを表示するかどうかを指定します。", - "xpack.lens.xyChart.yLeftAxisTitle.help": "左y軸のタイトルを表示するかどうかを指定します。", - "xpack.lens.xyChart.yLeftExtent.help": "Y左軸範囲", - "xpack.lens.xyChart.yLeftTitle.help": "左y軸のタイトル", - "xpack.lens.xyChart.yRightAxisgridlines.help": "右y軸のグリッド線を表示するかどうかを指定します。", - "xpack.lens.xyChart.yRightAxisLabelsOrientation.help": "右y軸のラベルの向きを指定します。", - "xpack.lens.xyChart.yRightAxisTickLabels.help": "右y軸の目盛ラベルを表示するかどうかを指定します。", - "xpack.lens.xyChart.yRightAxisTitle.help": "右y軸のタイトルを表示するかどうかを指定します。", - "xpack.lens.xyChart.yRightExtent.help": "Y右軸範囲", - "xpack.lens.xyChart.yRightTitle.help": "右 y 軸のタイトル", + "expressionXY.gridlinesConfig.x.help": "x 軸のグリッド線を表示するかどうかを指定します。", + "expressionXY.labelsOrientationConfig.x.help": "x軸のラベルの向きを指定します。", + "expressionXY.tickLabelsConfig.x.help": "x軸の目盛ラベルを表示するかどうかを指定します。", + "expressionXY.axisTitlesVisibilityConfig.x.help": "x軸のタイトルを表示するかどうかを指定します。", + "expressionXY.xyVis.xTitle.help": "x軸のタイトル", + "expressionXY.gridlinesConfig.yLeft.help": "左y軸のグリッド線を表示するかどうかを指定します。", + "expressionXY.labelsOrientationConfig.yLeft.help": "左y軸のラベルの向きを指定します。", + "expressionXY.tickLabelsConfig.yLeft.help": "左y軸の目盛ラベルを表示するかどうかを指定します。", + "expressionXY.axisTitlesVisibilityConfig.yLeft.help": "左y軸のタイトルを表示するかどうかを指定します。", + "expressionXY.xyVis.yLeftExtent.help": "Y左軸範囲", + "expressionXY.xyVis.yLeftTitle.help": "左y軸のタイトル", + "expressionXY.gridlinesConfig.yRight.help": "右y軸のグリッド線を表示するかどうかを指定します。", + "expressionXY.labelsOrientationConfig.yRight.help": "右y軸のラベルの向きを指定します。", + "expressionXY.tickLabelsConfig.yRight.help": "右y軸の目盛ラベルを表示するかどうかを指定します。", + "expressionXY.axisTitlesVisibilityConfig.yRight.help": "右y軸のタイトルを表示するかどうかを指定します。", + "expressionXY.xyVis.yRightExtent.help": "Y右軸範囲", + "expressionXY.xyVis.yRightTitle.help": "右 y 軸のタイトル", "xpack.lens.xySuggestions.asPercentageTitle": "割合(%)", "xpack.lens.xySuggestions.barChartTitle": "棒グラフ", "xpack.lens.xySuggestions.dateSuggestion": "{xTitle}の上の {yTitle}", @@ -7648,8 +7650,6 @@ "xpack.apm.transactionsTable.cardinalityWarning.docsLink": "詳細はドキュメントをご覧ください", "xpack.apm.transactionsTable.cardinalityWarning.title": "このビューには、報告されたトランザクションのサブセットが表示されます。", "xpack.apm.transactionsTable.linkText": "トランザクションを表示", - "xpack.apm.transactionsTable.loading": "読み込み中...", - "xpack.apm.transactionsTable.noResults": "トランザクショングループが見つかりません", "xpack.apm.transactionsTable.title": "トランザクション", "xpack.apm.transactionTypesSelectCustomOptionText": "新しいトランザクションタイプとして\\{searchValue\\}を追加", "xpack.apm.transactionTypesSelectPlaceholder": "トランザクションタイプを選択", @@ -11428,7 +11428,6 @@ "xpack.enterpriseSearch.workplaceSearch.sources.learnCustom.features.button": "プラチナ機能の詳細", "xpack.enterpriseSearch.workplaceSearch.sources.learnMore.link": "詳細", "xpack.enterpriseSearch.workplaceSearch.sources.learnMore.text": "アクセス権については、{learnMoreLink}", - "xpack.enterpriseSearch.workplaceSearch.sources.learnMoreCustom.text": "カスタムソースについては、{learnMoreLink}。", "xpack.enterpriseSearch.workplaceSearch.sources.licenseCallout.description": "詳細については、検索エクスペリエンス管理者に問い合わせてください。", "xpack.enterpriseSearch.workplaceSearch.sources.licenseCallout.title": "非公開ソースは使用できません", "xpack.enterpriseSearch.workplaceSearch.sources.nextSyncRunningMessage": "現在実行中のジョブが完了したらすぐに実行", @@ -11590,10 +11589,8 @@ "xpack.fileUpload.geoFilePicker.noFeaturesDetected": "選択したファイルには特徴量がありません。", "xpack.fileUpload.geoFilePicker.previewSummary": "{numFeatures}個の特徴量。ファイルの{previewCoverage}%。", "xpack.fileUpload.geojsonImporter.noGeometry": "特長量には必須フィールド「ジオメトリ」が含まれていません", - "xpack.fileUpload.geoUploadWizard.creatingIndexPattern": "データビュー{indexName}を作成しています", "xpack.fileUpload.geoUploadWizard.dataIndexingError": "データインデックスエラー", "xpack.fileUpload.geoUploadWizard.dataIndexingStarted": "インデックスを作成中:{indexName}", - "xpack.fileUpload.geoUploadWizard.indexPatternError": "データビューを作成できません", "xpack.fileUpload.geoUploadWizard.writingToIndex": "インデックスに書き込み中:{progress}%完了", "xpack.fileUpload.import.noIdOrIndexSuppliedErrorMessage": "ID またはインデックスが提供されていません", "xpack.fileUpload.importComplete.copyButtonAriaLabel": "クリップボードにコピー", @@ -11601,7 +11598,6 @@ "xpack.fileUpload.importComplete.indexingResponse": "応答をインポート", "xpack.fileUpload.importComplete.indexMgmtLink": "インデックス管理。", "xpack.fileUpload.importComplete.indexModsMsg": "インデックスを修正するには、移動してください ", - "xpack.fileUpload.importComplete.indexPatternResponse": "データビュー応答", "xpack.fileUpload.importComplete.permission.docLink": "ファイルインポート権限を表示", "xpack.fileUpload.importComplete.permissionFailureMsg": "インデックス\"{indexName}\"にデータを作成またはインポートするアクセス権がありません。", "xpack.fileUpload.importComplete.uploadFailureMsgErrorBlock": "エラー:{reason}", @@ -11620,7 +11616,6 @@ "xpack.fileUpload.indexNameForm.indexNameGuidelines": "インデックス名ガイドライン", "xpack.fileUpload.indexNameForm.indexNameReqField": "インデックス名、必須フィールド", "xpack.fileUpload.indexNameRequired": "インデックス名は必須です", - "xpack.fileUpload.indexPatternAlreadyExistsErrorMessage": "データビューはすでに存在します。", "xpack.fileUpload.indexSettings.enterIndexTypeLabel": "インデックスタイプ", "xpack.fileUpload.invalidRuntimeFieldMessage": "無効なランタイムフィールド", "xpack.fileUpload.maxFileSizeUiSetting.description": "ファイルのインポート時にファイルサイズ上限を設定します。この設定でサポートされている最大値は1 GBです。", @@ -19021,7 +19016,6 @@ "xpack.ml.trainedModels.nodesList.modelsList.modelRoutingStateHeader": "ルーティング状態", "xpack.ml.trainedModels.nodesList.modelsList.modelSizeHeader": "サイズ", "xpack.ml.trainedModels.nodesList.modelsList.modelStartTimeHeader": "開始時刻", - "xpack.ml.trainedModels.nodesList.modelsList.modelStateHeader": "ステータス", "xpack.ml.trainedModels.nodesList.modelsList.nodeNameHeader": "ノード名", "xpack.ml.trainedModels.nodesList.modelsMemoryUsage": "学習済みモデル", "xpack.ml.trainedModels.nodesList.nodeMemoryUsageHeader": "メモリー使用状況", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 6b2fa0b53fae2..0ddb9de4feb12 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -775,9 +775,10 @@ "xpack.lens.shared.axisNameLabel": "轴标题", "xpack.lens.shared.chartValueLabelVisibilityLabel": "标签", "xpack.lens.shared.curveLabel": "视觉选项", - "xpack.lens.shared.legend.filterForValueButtonAriaLabel": "筛留值", + "expressionXY.legend.filterForValueButtonAriaLabel": "筛留值", + "expressionXY.legend.filterOptionsLegend": "{legendDataLabel}, 筛选选项", "xpack.lens.shared.legend.filterOptionsLegend": "{legendDataLabel}, 筛选选项", - "xpack.lens.shared.legend.filterOutValueButtonAriaLabel": "筛除值", + "expressionXY.legend.filterOutValueButtonAriaLabel": "筛除值", "xpack.lens.shared.legendAlignmentLabel": "对齐方式", "xpack.lens.shared.legendInsideAlignmentLabel": "对齐方式", "xpack.lens.shared.legendInsideColumnsLabel": "列数目", @@ -874,34 +875,34 @@ "xpack.lens.xyChart.axisSide.left": "左", "xpack.lens.xyChart.axisSide.right": "右", "xpack.lens.xyChart.axisSide.top": "顶部", - "xpack.lens.xyChart.axisTitlesSettings.help": "显示 x 和 y 轴标题", + "expressionXY.xyVis.axisTitlesVisibilitySettings.help": "显示 x 和 y 轴标题", "xpack.lens.xyChart.bottomAxisDisabledHelpText": "此设置仅在启用底轴时应用。", "xpack.lens.xyChart.bottomAxisLabel": "底轴", "xpack.lens.xyChart.boundaryError": "下边界必须大于上边界", "xpack.lens.xyChart.curveStyleLabel": "曲线", - "xpack.lens.xyChart.curveType.help": "定义为折线图渲染曲线类型的方式", - "xpack.lens.xyChart.emptyXLabel": "(空)", - "xpack.lens.xyChart.extentMode.help": "范围模式", - "xpack.lens.xyChart.fillOpacity.help": "定义面积图填充透明度", + "expressionXY.xyVis.curveType.help": "定义为折线图渲染曲线类型的方式", + "expressionXY.xyChart.emptyXLabel": "(空)", + "expressionXY.axisExtentConfig.extentMode.help": "范围模式", + "expressionXY.xyVis.fillOpacity.help": "定义面积图填充透明度", "xpack.lens.xyChart.fillOpacityLabel": "填充透明度", - "xpack.lens.xyChart.fittingFunction.help": "定义处理缺失值的方式", - "xpack.lens.xyChart.floatingColumns.help": "指定图例显示在图表内时的列数。", + "expressionXY.xyVis.fittingFunction.help": "定义处理缺失值的方式", + "expressionXY.legendConfig.floatingColumns.help": "指定图例显示在图表内时的列数。", "xpack.lens.xyChart.Gridlines": "网格线", - "xpack.lens.xyChart.gridlinesSettings.help": "显示 x 和 y 轴网格线", - "xpack.lens.xyChart.help": "X/Y 图表", - "xpack.lens.xyChart.hideEndzones.help": "隐藏部分数据的末日区域标记", - "xpack.lens.xyChart.horizontalAlignment.help": "指定图例显示在图表内时水平对齐。", + "expressionXY.xyVis.gridlinesVisibilitySettings.help": "显示 x 和 y 轴网格线", + "expressionXY.xyVis.help": "X/Y 图表", + "expressionXY.xyVis.hideEndzones.help": "隐藏部分数据的末日区域标记", + "expressionXY.legendConfig.horizontalAlignment.help": "指定图例显示在图表内时水平对齐。", "xpack.lens.xyChart.horizontalAxisLabel": "水平轴", "xpack.lens.xyChart.horizontalLeftAxisLabel": "水平顶轴", "xpack.lens.xyChart.horizontalRightAxisLabel": "水平底轴", "xpack.lens.xyChart.inclusiveZero": "边界必须包括零。", - "xpack.lens.xyChart.isInside.help": "指定图例是否在图表内", - "xpack.lens.xyChart.isVisible.help": "指定图例是否可见。", - "xpack.lens.xyChart.labelsOrientation.help": "定义轴标签的旋转", + "expressionXY.legendConfig.isInside.help": "指定图例是否在图表内", + "expressionXY.legendConfig.isVisible.help": "指定图例是否可见。", + "expressionXY.xyVis.labelsOrientation.help": "定义轴标签的旋转", "xpack.lens.xyChart.layerReferenceLineLabel": "参考线", "xpack.lens.xyChart.leftAxisDisabledHelpText": "此设置仅在启用左轴时应用。", "xpack.lens.xyChart.leftAxisLabel": "左轴", - "xpack.lens.xyChart.legend.help": "配置图表图例。", + "expressionXY.xyVis.legend.help": "配置图表图例。", "xpack.lens.xyChart.legendLocation.inside": "内部", "xpack.lens.xyChart.legendLocation.outside": "外部", "xpack.lens.xyChart.legendVisibility.auto": "自动", @@ -911,50 +912,49 @@ "xpack.lens.xyChart.markerPosition.below": "底部", "xpack.lens.xyChart.markerPosition.left": "左", "xpack.lens.xyChart.markerPosition.right": "右", - "xpack.lens.xyChart.maxLines.help": "指定每个图例项的行数。", + "expressionXY.legendConfig.maxLines.help": "指定每个图例项的行数。", "xpack.lens.xyChart.missingValuesLabel": "缺少的值", "xpack.lens.xyChart.missingValuesLabelHelpText": "默认情况下,Lens 隐藏数据中的缺口。要填充缺口,请进行选择。", "xpack.lens.xyChart.nestUnderRoot": "整个数据集", - "xpack.lens.xyChart.position.help": "指定图例位置。", - "xpack.lens.xyChart.renderer.help": "X/Y 图表呈现器", + "expressionXY.legendConfig.position.help": "指定图例位置。", + "expressionXY.xyVis.renderer.help": "X/Y 图表呈现器", "xpack.lens.xyChart.rightAxisDisabledHelpText": "此设置仅在启用右轴时应用。", "xpack.lens.xyChart.rightAxisLabel": "右轴", "xpack.lens.xyChart.seriesColor.auto": "自动", "xpack.lens.xyChart.seriesColor.label": "系列颜色", - "xpack.lens.xyChart.shouldTruncate.help": "指定是否将截断图例项", + "expressionXY.legendConfig.shouldTruncate.help": "指定是否将截断图例项", "xpack.lens.xyChart.showEnzones": "显示部分数据标记", - "xpack.lens.xyChart.showSingleSeries.help": "指定是否应显示只包含一个条目的图例", + "expressionXY.legendConfig.showSingleSeries.help": "指定是否应显示只包含一个条目的图例", "xpack.lens.xyChart.splitSeries": "细分方式", "xpack.lens.xyChart.tickLabels": "刻度标签", - "xpack.lens.xyChart.tickLabelsSettings.help": "显示 x 和 y 轴刻度标签", - "xpack.lens.xyChart.title.help": "轴标题", + "expressionXY.xyVis.tickLabelsVisibilitySettings.help": "显示 x 和 y 轴刻度标签", "xpack.lens.xyChart.topAxisDisabledHelpText": "此设置仅在启用顶轴时应用。", "xpack.lens.xyChart.topAxisLabel": "顶轴", "xpack.lens.xyChart.valuesHistogramDisabledHelpText": "不能在直方图上更改此设置。", - "xpack.lens.xyChart.valuesInLegend.help": "在图例中显示值", + "expressionXY.xyVis.valuesInLegend.help": "在图例中显示值", "xpack.lens.xyChart.valuesPercentageDisabledHelpText": "不能在百分比面积图上更改此设置。", "xpack.lens.xyChart.valuesStackedDisabledHelpText": "不能在堆积图或百分比条形图上更改此设置", - "xpack.lens.xyChart.verticalAlignment.help": "指定图例显示在图表内时垂直对齐。", + "expressionXY.legendConfig.verticalAlignment.help": "指定图例显示在图表内时垂直对齐。", "xpack.lens.xyChart.verticalAxisLabel": "垂直轴", "xpack.lens.xyChart.verticalLeftAxisLabel": "垂直左轴", "xpack.lens.xyChart.verticalRightAxisLabel": "垂直右轴", - "xpack.lens.xyChart.xAxisGridlines.help": "指定 x 轴的网格线是否可见。", - "xpack.lens.xyChart.xAxisLabelsOrientation.help": "指定 x 轴的标签方向。", - "xpack.lens.xyChart.xAxisTickLabels.help": "指定 x 轴的刻度标签是否可见。", - "xpack.lens.xyChart.xAxisTitle.help": "指定 x 轴的标题是否可见。", - "xpack.lens.xyChart.xTitle.help": "X 轴标题", - "xpack.lens.xyChart.yLeftAxisgridlines.help": "指定左侧 y 轴的网格线是否可见。", - "xpack.lens.xyChart.yLeftAxisLabelsOrientation.help": "指定左 y 轴的标签方向。", - "xpack.lens.xyChart.yLeftAxisTickLabels.help": "指定左侧 y 轴的刻度标签是否可见。", - "xpack.lens.xyChart.yLeftAxisTitle.help": "指定左侧 y 轴的标题是否可见。", - "xpack.lens.xyChart.yLeftExtent.help": "左侧 Y 轴范围", - "xpack.lens.xyChart.yLeftTitle.help": "左侧 Y 轴标题", - "xpack.lens.xyChart.yRightAxisgridlines.help": "指定右侧 y 轴的网格线是否可见。", - "xpack.lens.xyChart.yRightAxisLabelsOrientation.help": "指定右 y 轴的标签方向。", - "xpack.lens.xyChart.yRightAxisTickLabels.help": "指定右侧 y 轴的刻度标签是否可见。", - "xpack.lens.xyChart.yRightAxisTitle.help": "指定右侧 y 轴的标题是否可见。", - "xpack.lens.xyChart.yRightExtent.help": "右侧 Y 轴范围", - "xpack.lens.xyChart.yRightTitle.help": "右侧 Y 轴标题", + "expressionXY.gridlinesConfig.x.help": "指定 x 轴的网格线是否可见。", + "expressionXY.labelsOrientationConfig.x.help": "指定 x 轴的标签方向。", + "expressionXY.tickLabelsConfig.x.help": "指定 x 轴的刻度标签是否可见。", + "expressionXY.axisTitlesVisibilityConfig.x.help": "指定 x 轴的标题是否可见。", + "expressionXY.xyVis.xTitle.help": "X 轴标题", + "expressionXY.gridlinesConfig.yLeft.help": "指定左侧 y 轴的网格线是否可见。", + "expressionXY.labelsOrientationConfig.yLeft.help": "指定左 y 轴的标签方向。", + "expressionXY.tickLabelsConfig.yLeft.help": "指定左侧 y 轴的刻度标签是否可见。", + "expressionXY.axisTitlesVisibilityConfig.yLeft.help": "指定左侧 y 轴的标题是否可见。", + "expressionXY.xyVis.yLeftExtent.help": "左侧 Y 轴范围", + "expressionXY.xyVis.yLeftTitle.help": "左侧 Y 轴标题", + "expressionXY.gridlinesConfig.yRight.help": "指定右侧 y 轴的网格线是否可见。", + "expressionXY.labelsOrientationConfig.yRight.help": "指定右 y 轴的标签方向。", + "expressionXY.tickLabelsConfig.yRight.help": "指定右侧 y 轴的刻度标签是否可见。", + "expressionXY.axisTitlesVisibilityConfig.yRight.help": "指定右侧 y 轴的标题是否可见。", + "expressionXY.xyVis.yRightExtent.help": "右侧 Y 轴范围", + "expressionXY.xyVis.yRightTitle.help": "右侧 Y 轴标题", "xpack.lens.xySuggestions.asPercentageTitle": "百分比", "xpack.lens.xySuggestions.barChartTitle": "条形图", "xpack.lens.xySuggestions.dateSuggestion": "{yTitle} / {xTitle}", @@ -7666,8 +7666,6 @@ "xpack.apm.transactionsTable.cardinalityWarning.docsLink": "在文档中了解详情", "xpack.apm.transactionsTable.cardinalityWarning.title": "此视图显示已报告事务的子集。", "xpack.apm.transactionsTable.linkText": "查看事务", - "xpack.apm.transactionsTable.loading": "正在加载……", - "xpack.apm.transactionsTable.noResults": "未找到事务组", "xpack.apm.transactionsTable.title": "事务", "xpack.apm.transactionTypesSelectCustomOptionText": "将 \\{searchValue\\} 添加为新事务类型", "xpack.apm.transactionTypesSelectPlaceholder": "选择事务类型", @@ -11449,7 +11447,6 @@ "xpack.enterpriseSearch.workplaceSearch.sources.learnCustom.features.button": "了解白金级功能", "xpack.enterpriseSearch.workplaceSearch.sources.learnMore.link": "了解详情", "xpack.enterpriseSearch.workplaceSearch.sources.learnMore.text": "{learnMoreLink}的权限", - "xpack.enterpriseSearch.workplaceSearch.sources.learnMoreCustom.text": "{learnMoreLink}的定制源。", "xpack.enterpriseSearch.workplaceSearch.sources.licenseCallout.description": "请与您的搜索体验管理员联系,以获取更多信息。", "xpack.enterpriseSearch.workplaceSearch.sources.licenseCallout.title": "专用源不再可用", "xpack.enterpriseSearch.workplaceSearch.sources.nextSyncRunningMessage": "一旦当前运行的作业完成", @@ -11611,10 +11608,8 @@ "xpack.fileUpload.geoFilePicker.noFeaturesDetected": "选定文件中未找到任何特征。", "xpack.fileUpload.geoFilePicker.previewSummary": "正在预览 {numFeatures} 个特征、{previewCoverage}% 的文件。", "xpack.fileUpload.geojsonImporter.noGeometry": "特征不包含必需的字段“geometry”", - "xpack.fileUpload.geoUploadWizard.creatingIndexPattern": "正在创建数据视图:{indexName}", "xpack.fileUpload.geoUploadWizard.dataIndexingError": "数据索引错误", "xpack.fileUpload.geoUploadWizard.dataIndexingStarted": "正在创建索引:{indexName}", - "xpack.fileUpload.geoUploadWizard.indexPatternError": "无法创建数据视图", "xpack.fileUpload.geoUploadWizard.writingToIndex": "正在写入索引:已完成 {progress}%", "xpack.fileUpload.import.noIdOrIndexSuppliedErrorMessage": "未提供任何 ID 或索引", "xpack.fileUpload.importComplete.copyButtonAriaLabel": "复制到剪贴板", @@ -11622,7 +11617,6 @@ "xpack.fileUpload.importComplete.indexingResponse": "导入响应", "xpack.fileUpload.importComplete.indexMgmtLink": "索引管理。", "xpack.fileUpload.importComplete.indexModsMsg": "要修改索引,请前往 ", - "xpack.fileUpload.importComplete.indexPatternResponse": "数据视图响应", "xpack.fileUpload.importComplete.permission.docLink": "查看文件导入权限", "xpack.fileUpload.importComplete.permissionFailureMsg": "您无权创建或将数据导入索引“{indexName}”。", "xpack.fileUpload.importComplete.uploadFailureMsgErrorBlock": "错误:{reason}", @@ -11641,7 +11635,6 @@ "xpack.fileUpload.indexNameForm.indexNameGuidelines": "索引名称指引", "xpack.fileUpload.indexNameForm.indexNameReqField": "索引名称,必填字段", "xpack.fileUpload.indexNameRequired": "需要索引名称", - "xpack.fileUpload.indexPatternAlreadyExistsErrorMessage": "数据视图已存在。", "xpack.fileUpload.indexSettings.enterIndexTypeLabel": "索引类型", "xpack.fileUpload.invalidRuntimeFieldMessage": "运行时字段无效", "xpack.fileUpload.maxFileSizeUiSetting.description": "设置导入文件时的文件大小限制。此设置支持的最高值为 1GB。", @@ -19048,7 +19041,6 @@ "xpack.ml.trainedModels.nodesList.modelsList.modelRoutingStateHeader": "路由状态", "xpack.ml.trainedModels.nodesList.modelsList.modelSizeHeader": "大小", "xpack.ml.trainedModels.nodesList.modelsList.modelStartTimeHeader": "开始时间", - "xpack.ml.trainedModels.nodesList.modelsList.modelStateHeader": "状态", "xpack.ml.trainedModels.nodesList.modelsList.nodeNameHeader": "节点名称", "xpack.ml.trainedModels.nodesList.modelsMemoryUsage": "已训练模型", "xpack.ml.trainedModels.nodesList.nodeMemoryUsageHeader": "内存使用", diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_execution_log.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_execution_log.ts index 55d4a72643c86..c7bb15ba12a98 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_execution_log.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/get_execution_log.ts @@ -26,7 +26,8 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo const dateStart = new Date(Date.now() - 600000).toISOString(); - describe('getExecutionLog', () => { + // FLAKY: https://github.com/elastic/kibana/issues/128225 + describe.skip('getExecutionLog', () => { const objectRemover = new ObjectRemover(supertest); beforeEach(async () => { @@ -68,6 +69,8 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo expect(response.status).to.eql(200); expect(response.body.total).to.eql(2); + expect(response.body.totalErrors).to.eql(0); + expect(response.body.errors).to.eql([]); const execLogs = response.body.data; expect(execLogs.length).to.eql(2); @@ -119,6 +122,8 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo expect(response.body.total).to.eql(0); expect(response.body.data).to.eql([]); + expect(response.body.totalErrors).to.eql(0); + expect(response.body.errors).to.eql([]); }); it('gets execution log for rule that performs ES searches', async () => { @@ -147,6 +152,8 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo expect(response.status).to.eql(200); expect(response.body.total).to.eql(1); + expect(response.body.totalErrors).to.eql(0); + expect(response.body.errors).to.eql([]); const execLogs = response.body.data; expect(execLogs.length).to.eql(1); @@ -201,6 +208,19 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo for (const log of execLogs) { expect(log.status).to.equal('failure'); expect(log.timed_out).to.equal(false); + expect(log.message).to.equal( + `rule execution failure: test.throw:${createdRule.id}: 'abc' - this alert is intended to fail` + ); + } + + expect(response.body.totalErrors).to.eql(1); + expect(response.body.errors.length).to.eql(1); + + for (const errors of response.body.errors) { + expect(errors.type).to.equal('alerting'); + expect(errors.message).to.equal( + `rule execution failure: test.throw:${createdRule.id}: 'abc' - this alert is intended to fail` + ); } }); @@ -237,6 +257,16 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo expect(log.status).to.equal('success'); expect(log.timed_out).to.equal(true); } + + expect(response.body.totalErrors).to.eql(1); + expect(response.body.errors.length).to.eql(1); + + for (const errors of response.body.errors) { + expect(errors.type).to.equal('alerting'); + expect(errors.message).to.equal( + `rule: test.patternLongRunning:${createdRule.id}: 'abc' execution cancelled due to timeout - exceeded rule type timeout of 3s` + ); + } }); it('gets execution log for rule that triggers actions', async () => { @@ -280,6 +310,8 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo expect(response.status).to.eql(200); expect(response.body.total).to.eql(1); + expect(response.body.totalErrors).to.eql(0); + expect(response.body.errors).to.eql([]); const execLogs = response.body.data; expect(execLogs.length).to.eql(1); @@ -351,6 +383,16 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo expect(log.num_succeeded_actions).to.equal(0); expect(log.num_errored_actions).to.equal(1); } + + expect(response.body.totalErrors).to.eql(1); + expect(response.body.errors.length).to.eql(1); + + for (const errors of response.body.errors) { + expect(errors.type).to.equal('actions'); + expect(errors.message).to.equal( + `action execution failure: test.throw:${createdConnector.id}: connector that throws - an error occurred while running the action executor: this action is intended to fail` + ); + } }); it('handles date_end if specified', async () => { @@ -375,6 +417,8 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo expect(response.body.total).to.eql(0); expect(response.body.data.length).to.eql(0); + expect(response.body.totalErrors).to.eql(0); + expect(response.body.errors.length).to.eql(0); }); it('handles sort query parameter', async () => { @@ -395,6 +439,8 @@ export default function createGetExecutionLogTests({ getService }: FtrProviderCo expect(response.status).to.eql(200); expect(response.body.total).to.eql(3); + expect(response.body.totalErrors).to.eql(0); + expect(response.body.errors).to.eql([]); const execLogs = response.body.data; expect(execLogs.length).to.eql(3); diff --git a/x-pack/test/api_integration/apis/file_upload/has_import_permission.ts b/x-pack/test/api_integration/apis/file_upload/has_import_permission.ts index 3977c4f0a06ad..6d73ebb8626c7 100644 --- a/x-pack/test/api_integration/apis/file_upload/has_import_permission.ts +++ b/x-pack/test/api_integration/apis/file_upload/has_import_permission.ts @@ -48,7 +48,7 @@ export default ({ getService }: FtrProviderContext) => { const resp = await supertestWithoutAuth .get( `/internal/file_upload/has_import_permission\ -?checkCreateIndexPattern=true\ +?checkCreateDataView=true\ &checkHasManagePipeline=true\ &indexName=${INDEX_NAME}` ) @@ -63,7 +63,7 @@ export default ({ getService }: FtrProviderContext) => { } }); - it('should return false when user can not create index pattern when checkCreateIndexPattern=true', async () => { + it('should return false when user can not create data view when checkCreateDataView=true', async () => { try { await security.role.create(IMPORTER_ROLE_NAME, {}); @@ -75,7 +75,7 @@ export default ({ getService }: FtrProviderContext) => { const resp = await supertestWithoutAuth .get( `/internal/file_upload/has_import_permission\ -?checkCreateIndexPattern=true\ +?checkCreateDataView=true\ &checkHasManagePipeline=false` ) .auth(IMPORTER_USER_NAME, IMPORT_USER_PASSWORD) @@ -102,7 +102,7 @@ export default ({ getService }: FtrProviderContext) => { const resp = await supertestWithoutAuth .get( `/internal/file_upload/has_import_permission\ -?checkCreateIndexPattern=false\ +?checkCreateDataView=false\ &checkHasManagePipeline=true` ) .auth(IMPORTER_USER_NAME, IMPORT_USER_PASSWORD) @@ -128,7 +128,7 @@ export default ({ getService }: FtrProviderContext) => { const resp = await supertestWithoutAuth .get( `/internal/file_upload/has_import_permission\ -?checkCreateIndexPattern=false\ +?checkCreateDataView=false\ &checkHasManagePipeline=false\ &indexName=${INDEX_NAME}` ) diff --git a/x-pack/test/api_integration/apis/ml/filters/get_filters.ts b/x-pack/test/api_integration/apis/ml/filters/get_filters.ts index 8d99650f6d509..0cfd91ffb9035 100644 --- a/x-pack/test/api_integration/apis/ml/filters/get_filters.ts +++ b/x-pack/test/api_integration/apis/ml/filters/get_filters.ts @@ -87,14 +87,14 @@ export default ({ getService }: FtrProviderContext) => { expect(body.items).to.eql(requestBody.items); }); - it(`should return 400 if filterId does not exist`, async () => { + it(`should return 404 if filterId does not exist`, async () => { const { body, status } = await supertest .get(`/api/ml/filters/filter_id_dne`) .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) .set(COMMON_REQUEST_HEADERS); - ml.api.assertResponseStatusCode(400, status, body); + ml.api.assertResponseStatusCode(404, status, body); - expect(body.error).to.eql('Bad Request'); + expect(body.error).to.eql('Not Found'); expect(body.message).to.contain('resource_not_found_exception'); }); }); diff --git a/x-pack/test/api_integration/apis/ml/filters/update_filters.ts b/x-pack/test/api_integration/apis/ml/filters/update_filters.ts index 737e2c21cf0f6..7515cabca7998 100644 --- a/x-pack/test/api_integration/apis/ml/filters/update_filters.ts +++ b/x-pack/test/api_integration/apis/ml/filters/update_filters.ts @@ -110,7 +110,7 @@ export default ({ getService }: FtrProviderContext) => { .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) .set(COMMON_REQUEST_HEADERS) .send(updateFilterRequestBody); - ml.api.assertResponseStatusCode(400, status, body); + ml.api.assertResponseStatusCode(404, status, body); expect(body.message).to.contain('resource_not_found_exception'); }); diff --git a/x-pack/test/apm_api_integration/tests/cold_start/cold_start.spec.ts b/x-pack/test/apm_api_integration/tests/cold_start/cold_start.spec.ts index fedf44d477d2d..a942862891969 100644 --- a/x-pack/test/apm_api_integration/tests/cold_start/cold_start.spec.ts +++ b/x-pack/test/apm_api_integration/tests/cold_start/cold_start.spec.ts @@ -141,8 +141,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { query: { start: startDate.toISOString(), end: endDate.subtract(1, 'seconds').toISOString(), - comparisonStart: comparisonStartDate.toISOString(), - comparisonEnd: comparisonEndDate.subtract(1, 'seconds').toISOString(), + offset: '6m', }, }); body = response.body; diff --git a/x-pack/test/apm_api_integration/tests/cold_start/cold_start_by_transaction_name/cold_start_by_transaction_name.spec.ts b/x-pack/test/apm_api_integration/tests/cold_start/cold_start_by_transaction_name/cold_start_by_transaction_name.spec.ts index d577077490b88..4cd9026f6ac51 100644 --- a/x-pack/test/apm_api_integration/tests/cold_start/cold_start_by_transaction_name/cold_start_by_transaction_name.spec.ts +++ b/x-pack/test/apm_api_integration/tests/cold_start/cold_start_by_transaction_name/cold_start_by_transaction_name.spec.ts @@ -143,8 +143,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { query: { start: startDate.toISOString(), end: endDate.subtract(1, 'seconds').toISOString(), - comparisonStart: comparisonStartDate.toISOString(), - comparisonEnd: comparisonEndDate.subtract(1, 'seconds').toISOString(), + offset: '6m', }, }); body = response.body; diff --git a/x-pack/test/apm_api_integration/tests/errors/distribution.spec.ts b/x-pack/test/apm_api_integration/tests/errors/distribution.spec.ts index d237574d551f7..9511284aba455 100644 --- a/x-pack/test/apm_api_integration/tests/errors/distribution.spec.ts +++ b/x-pack/test/apm_api_integration/tests/errors/distribution.spec.ts @@ -112,8 +112,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { query: { start: new Date(end - fiveMinutes).toISOString(), end: new Date(end).toISOString(), - comparisonStart: new Date(start).toISOString(), - comparisonEnd: new Date(start + fiveMinutes).toISOString(), + offset: '5m', }, }); errorsDistribution = response.body; @@ -157,8 +156,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { query: { start: '2021-01-03T00:00:00.000Z', end: '2021-01-03T00:15:00.000Z', - comparisonStart: '2021-01-02T00:00:00.000Z', - comparisonEnd: '2021-01-02T00:15:00.000Z', + offset: '1d', }, }); errorsDistribution = response.body; diff --git a/x-pack/test/apm_api_integration/tests/service_overview/instances_detailed_statistics.spec.ts b/x-pack/test/apm_api_integration/tests/service_overview/instances_detailed_statistics.spec.ts index e8c4b73ac2970..653a96ad79b3b 100644 --- a/x-pack/test/apm_api_integration/tests/service_overview/instances_detailed_statistics.spec.ts +++ b/x-pack/test/apm_api_integration/tests/service_overview/instances_detailed_statistics.spec.ts @@ -150,8 +150,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { serviceNodeIds: JSON.stringify(serviceNodeIds), start: moment(end).subtract(15, 'minutes').toISOString(), end, - comparisonStart: start, - comparisonEnd: moment(start).add(15, 'minutes').toISOString(), + offset: '15m', environment: 'ENVIRONMENT_ALL', kuery: '', }, diff --git a/x-pack/test/apm_api_integration/tests/service_overview/instances_main_statistics.spec.ts b/x-pack/test/apm_api_integration/tests/service_overview/instances_main_statistics.spec.ts index 4f847011ad56e..37e0d65ff9411 100644 --- a/x-pack/test/apm_api_integration/tests/service_overview/instances_main_statistics.spec.ts +++ b/x-pack/test/apm_api_integration/tests/service_overview/instances_main_statistics.spec.ts @@ -41,8 +41,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { transactionType: 'request', start: moment(end).subtract(15, 'minutes').toISOString(), end, - comparisonStart: start, - comparisonEnd: moment(start).add(15, 'minutes').toISOString(), + offset: '15m', environment: 'ENVIRONMENT_ALL', kuery: '', }, @@ -214,8 +213,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { transactionType: 'request', start: moment(end).subtract(15, 'minutes').toISOString(), end, - comparisonStart: start, - comparisonEnd: moment(start).add(15, 'minutes').toISOString(), + offset: '15m', environment: 'ENVIRONMENT_ALL', kuery: '', }, diff --git a/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_detailed_statistics.spec.ts b/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_detailed_statistics.spec.ts index 9d09e7046519b..8867327ac418a 100644 --- a/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_detailed_statistics.spec.ts +++ b/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_detailed_statistics.spec.ts @@ -141,8 +141,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { groupIds: JSON.stringify(errorIds), start: moment(end).subtract(7, 'minutes').toISOString(), end: new Date(end).toISOString(), - comparisonStart: new Date(start).toISOString(), - comparisonEnd: moment(start).add(7, 'minutes').toISOString(), + offset: '7m', }, }); errorGroupsDetailedStatistics = response.body; diff --git a/x-pack/test/apm_api_integration/tests/services/throughput.spec.ts b/x-pack/test/apm_api_integration/tests/services/throughput.spec.ts index a2428d13ae253..f319f3566a551 100644 --- a/x-pack/test/apm_api_integration/tests/services/throughput.spec.ts +++ b/x-pack/test/apm_api_integration/tests/services/throughput.spec.ts @@ -216,8 +216,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { query: { start: moment(end).subtract(7, 'minutes').toISOString(), end: new Date(end).toISOString(), - comparisonStart: new Date(start).toISOString(), - comparisonEnd: moment(start).add(7, 'minutes').toISOString(), + offset: '7m', }, }); throughputResponse = response.body; diff --git a/x-pack/test/apm_api_integration/tests/transactions/error_rate.spec.ts b/x-pack/test/apm_api_integration/tests/transactions/error_rate.spec.ts index 858c7c9327176..8790e4325f820 100644 --- a/x-pack/test/apm_api_integration/tests/transactions/error_rate.spec.ts +++ b/x-pack/test/apm_api_integration/tests/transactions/error_rate.spec.ts @@ -51,8 +51,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { transactionType, start: moment(end).subtract(15, 'minutes').toISOString(), end, - comparisonStart: start, - comparisonEnd: moment(start).add(15, 'minutes').toISOString(), + offset: '15m', environment: 'ENVIRONMENT_ALL', kuery: '', }, @@ -137,8 +136,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { transactionType, start: moment(end).subtract(15, 'minutes').toISOString(), end, - comparisonStart: start, - comparisonEnd: moment(start).add(15, 'minutes').toISOString(), + offset: '15m', environment: 'ENVIRONMENT_ALL', kuery: '', }, diff --git a/x-pack/test/apm_api_integration/tests/transactions/latency.spec.ts b/x-pack/test/apm_api_integration/tests/transactions/latency.spec.ts index a221325e15771..7a78fe2742ef5 100644 --- a/x-pack/test/apm_api_integration/tests/transactions/latency.spec.ts +++ b/x-pack/test/apm_api_integration/tests/transactions/latency.spec.ts @@ -181,8 +181,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { transactionType: 'request', start: moment(end).subtract(15, 'minutes').toISOString(), end, - comparisonStart: start, - comparisonEnd: moment(start).add(15, 'minutes').toISOString(), + offset: '15m', environment: 'ENVIRONMENT_ALL', kuery: '', }, diff --git a/x-pack/test/apm_api_integration/tests/transactions/transactions_groups_detailed_statistics.spec.ts b/x-pack/test/apm_api_integration/tests/transactions/transactions_groups_detailed_statistics.spec.ts index 02103b456c826..587206cb46a64 100644 --- a/x-pack/test/apm_api_integration/tests/transactions/transactions_groups_detailed_statistics.spec.ts +++ b/x-pack/test/apm_api_integration/tests/transactions/transactions_groups_detailed_statistics.spec.ts @@ -37,8 +37,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { transactionType?: string; environment?: string; kuery?: string; - comparisonStart?: string; - comparisonEnd?: string; + offset?: string; transactionNames?: string; latencyAggregationType?: LatencyAggregationType; numBuckets?: number; @@ -190,8 +189,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { query: { start: moment(end).subtract(7, 'minutes').toISOString(), end: new Date(end).toISOString(), - comparisonStart: new Date(start).toISOString(), - comparisonEnd: moment(start).add(7, 'minutes').toISOString(), + offset: '8m', }, }); }); diff --git a/x-pack/test/examples/embedded_lens/embedded_example.ts b/x-pack/test/examples/embedded_lens/embedded_example.ts index d11495f0450b4..bdd881b3ea318 100644 --- a/x-pack/test/examples/embedded_lens/embedded_example.ts +++ b/x-pack/test/examples/embedded_lens/embedded_example.ts @@ -27,12 +27,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.navigateToApp('embedded_lens_example'); await elasticChart.setNewChartUiDebugFlag(true); await testSubjects.click('lns-example-change-time-range'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); }); it('should show chart', async () => { await testSubjects.click('lns-example-change-color'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); await checkData(); }); @@ -60,7 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should load Lens editor', async () => { await testSubjects.click('lns-example-open-editor'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); await checkData(); }); }); diff --git a/x-pack/test/functional/apps/dashboard/_async_dashboard.ts b/x-pack/test/functional/apps/dashboard/_async_dashboard.ts index 92cdc72ffc81a..71ef909ffa24a 100644 --- a/x-pack/test/functional/apps/dashboard/_async_dashboard.ts +++ b/x-pack/test/functional/apps/dashboard/_async_dashboard.ts @@ -137,7 +137,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // check at least one visualization await renderable.waitForRender(); log.debug('Checking charts rendered'); - await elasticChart.waitForRenderComplete('lnsVisualizationContainer'); + await elasticChart.waitForRenderComplete('xyVisChart'); await appMenu.clickLink('Discover'); await retry.try(async function () { @@ -148,7 +148,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); log.debug('Checking charts rendered'); - await elasticChart.waitForRenderComplete('lnsVisualizationContainer'); + await elasticChart.waitForRenderComplete('xyVisChart'); }); it('toggle from Discover to Dashboard attempt 1', async () => { @@ -161,7 +161,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); log.debug('Checking charts rendered'); - await elasticChart.waitForRenderComplete('lnsVisualizationContainer'); + await elasticChart.waitForRenderComplete('xyVisChart'); }); it('toggle from Discover to Dashboard attempt 2', async () => { @@ -174,7 +174,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await renderable.waitForRender(); log.debug('Checking charts rendered'); - await elasticChart.waitForRenderComplete('lnsVisualizationContainer'); + await elasticChart.waitForRenderComplete('xyVisChart'); log.debug('Checking saved searches rendered'); await dashboardExpect.savedSearchRowCount(10); diff --git a/x-pack/test/functional/apps/dashboard/dashboard_lens_by_value.ts b/x-pack/test/functional/apps/dashboard/dashboard_lens_by_value.ts index 382449e5e2586..9e4c2554100b9 100644 --- a/x-pack/test/functional/apps/dashboard/dashboard_lens_by_value.ts +++ b/x-pack/test/functional/apps/dashboard/dashboard_lens_by_value.ts @@ -92,7 +92,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { operation: 'average', field: 'bytes', }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); await PageObjects.lens.notLinkedToOriginatingApp(); // return to origin should not be present in save modal diff --git a/x-pack/test/functional/apps/dashboard/feature_controls/time_to_visualize_security.ts b/x-pack/test/functional/apps/dashboard/feature_controls/time_to_visualize_security.ts index 1d2d3f6862e43..9eeb49f5eb0d2 100644 --- a/x-pack/test/functional/apps/dashboard/feature_controls/time_to_visualize_security.ts +++ b/x-pack/test/functional/apps/dashboard/feature_controls/time_to_visualize_security.ts @@ -130,7 +130,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await PageObjects.lens.switchToVisualization('lnsMetric'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('mtrVis'); await PageObjects.lens.assertMetric('Average of bytes', '5,727.322'); await PageObjects.header.waitUntilLoadingHasFinished(); diff --git a/x-pack/test/functional/apps/lens/add_to_dashboard.ts b/x-pack/test/functional/apps/lens/add_to_dashboard.ts index d9bdfbd1ffb6a..5fbfdd0a5806e 100644 --- a/x-pack/test/functional/apps/lens/add_to_dashboard.ts +++ b/x-pack/test/functional/apps/lens/add_to_dashboard.ts @@ -254,11 +254,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { field: 'bytes', }); - await PageObjects.lens.waitForVisualization(); - await PageObjects.lens.switchToVisualization('heatmap', 'heat'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('heatmapChart'); await PageObjects.lens.openDimensionEditor('lnsHeatmap_cellPanel > lns-dimensionTrigger'); await PageObjects.lens.openPalettePanel('lnsHeatmap'); await testSubjects.click('lnsPalettePanel_dynamicColoring_rangeType_groups_number'); diff --git a/x-pack/test/functional/apps/lens/chart_data.ts b/x-pack/test/functional/apps/lens/chart_data.ts index 8a43ff909fea5..ff2f5b339fe53 100644 --- a/x-pack/test/functional/apps/lens/chart_data.ts +++ b/x-pack/test/functional/apps/lens/chart_data.ts @@ -32,8 +32,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { operation: 'average', field: 'bytes', }); - - await PageObjects.lens.waitForVisualization(); }); const expectedData = [ @@ -75,34 +73,36 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { } it('should render xy chart', async () => { + await PageObjects.lens.waitForVisualization('xyVisChart'); + const data = await PageObjects.lens.getCurrentChartDebugState(); assertMatchesExpectedData(data!); }); it('should render pie chart', async () => { await PageObjects.lens.switchToVisualization('pie'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('partitionVisChart'); const data = await PageObjects.lens.getCurrentChartDebugState(); assertMatchesExpectedPieData(data!); }); it('should render donut chart', async () => { await PageObjects.lens.switchToVisualization('donut'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('partitionVisChart'); const data = await PageObjects.lens.getCurrentChartDebugState(); assertMatchesExpectedPieData(data!); }); it('should render treemap chart', async () => { await PageObjects.lens.switchToVisualization('treemap', 'treemap'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('partitionVisChart'); const data = await PageObjects.lens.getCurrentChartDebugState(); assertMatchesExpectedPieData(data!); }); it('should render heatmap chart', async () => { await PageObjects.lens.switchToVisualization('heatmap', 'heat'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('heatmapChart'); const debugState = await PageObjects.lens.getCurrentChartDebugState(); if (!debugState) { @@ -150,7 +150,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should render metric', async () => { await PageObjects.lens.switchToVisualization('lnsMetric'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('mtrVis'); await PageObjects.lens.assertMetric('Average of bytes', '5,727.322'); }); }); diff --git a/x-pack/test/functional/apps/lens/dashboard.ts b/x-pack/test/functional/apps/lens/dashboard.ts index e60e3ca76030c..97dc29280761f 100644 --- a/x-pack/test/functional/apps/lens/dashboard.ts +++ b/x-pack/test/functional/apps/lens/dashboard.ts @@ -91,8 +91,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); // Requires xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled - // setting set in kibana.yml to work (not enabled by default) - it('should be able to drill down to discover', async () => { + // setting set in kibana.yml to test (not enabled by default) + it('should hide old "explore underlying data" action', async () => { await PageObjects.common.navigateToApp('dashboard'); await PageObjects.dashboard.clickNewDashboard(); await dashboardAddPanel.clickOpenAddPanel(); @@ -102,13 +102,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.goToTimeRange(); await PageObjects.dashboard.saveDashboard('lnsDrilldown'); await panelActions.openContextMenu(); - await testSubjects.clickWhenNotDisabled('embeddablePanelAction-ACTION_EXPLORE_DATA'); - await PageObjects.discover.waitForDiscoverAppOnScreen(); - const el = await testSubjects.find('indexPattern-switch-link'); - const text = await el.getVisibleText(); - - expect(text).to.be('logstash-*'); + expect(await testSubjects.exists('embeddablePanelAction-ACTION_EXPLORE_DATA')).not.to.be.ok(); }); it('should be able to add filters by clicking in pie chart', async () => { diff --git a/x-pack/test/functional/apps/lens/disable_auto_apply.ts b/x-pack/test/functional/apps/lens/disable_auto_apply.ts index 3660de10ecd47..e280bbd148493 100644 --- a/x-pack/test/functional/apps/lens/disable_auto_apply.ts +++ b/x-pack/test/functional/apps/lens/disable_auto_apply.ts @@ -83,7 +83,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.applyChanges(); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); }); it('should hide suggestions when a change is made', async () => { diff --git a/x-pack/test/functional/apps/lens/drag_and_drop.ts b/x-pack/test/functional/apps/lens/drag_and_drop.ts index 1a7b8e96d6802..d5b929481e6dc 100644 --- a/x-pack/test/functional/apps/lens/drag_and_drop.ts +++ b/x-pack/test/functional/apps/lens/drag_and_drop.ts @@ -10,6 +10,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['visualize', 'lens', 'common', 'header']); + const xyChartContainer = 'xyVisChart'; describe('lens drag and drop tests', () => { describe('basic drag and drop', () => { @@ -18,7 +19,7 @@ export default function ({ getPageObjects }: FtrProviderContext) { await PageObjects.visualize.clickVisType('lens'); await PageObjects.lens.goToTimeRange(); await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.lens.dragFieldToWorkspace('@timestamp'); + await PageObjects.lens.dragFieldToWorkspace('@timestamp', xyChartContainer); expect(await PageObjects.lens.getDimensionTriggerText('lnsXY_xDimensionPanel')).to.eql( '@timestamp' @@ -136,7 +137,7 @@ export default function ({ getPageObjects }: FtrProviderContext) { it('Should duplicate and swap elements when dragging over secondary drop targets', async () => { await PageObjects.lens.removeLayer(); await PageObjects.lens.switchToVisualization('bar'); - await PageObjects.lens.dragFieldToWorkspace('@timestamp'); + await PageObjects.lens.dragFieldToWorkspace('@timestamp', xyChartContainer); await PageObjects.lens.dragDimensionToExtraDropType( 'lnsXY_xDimensionPanel > lns-dimensionTrigger', @@ -165,8 +166,8 @@ export default function ({ getPageObjects }: FtrProviderContext) { it('should combine breakdown dimension with the horizontal one', async () => { await PageObjects.lens.removeLayer(); - await PageObjects.lens.dragFieldToWorkspace('clientip'); - await PageObjects.lens.dragFieldToWorkspace('@message.raw'); + await PageObjects.lens.dragFieldToWorkspace('clientip', xyChartContainer); + await PageObjects.lens.dragFieldToWorkspace('@message.raw', xyChartContainer); await PageObjects.lens.dragDimensionToExtraDropType( 'lnsXY_splitDimensionPanel > lns-dimensionTrigger', @@ -180,7 +181,7 @@ export default function ({ getPageObjects }: FtrProviderContext) { it('should combine field to existing horizontal dimension', async () => { await PageObjects.lens.removeLayer(); - await PageObjects.lens.dragFieldToWorkspace('clientip'); + await PageObjects.lens.dragFieldToWorkspace('clientip', xyChartContainer); await PageObjects.lens.dragFieldToExtraDropType( '@message.raw', @@ -194,7 +195,7 @@ export default function ({ getPageObjects }: FtrProviderContext) { it('should combine two multi terms dimensions', async () => { await PageObjects.lens.removeLayer(); - await PageObjects.lens.dragFieldToWorkspace('clientip'); + await PageObjects.lens.dragFieldToWorkspace('clientip', xyChartContainer); await PageObjects.lens.dragFieldToExtraDropType( '@message.raw', @@ -313,10 +314,10 @@ export default function ({ getPageObjects }: FtrProviderContext) { await PageObjects.visualize.clickVisType('lens'); await PageObjects.lens.goToTimeRange(); await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.lens.dragFieldToWorkspace('@timestamp'); - await PageObjects.lens.waitForVisualization(); - await PageObjects.lens.dragFieldToWorkspace('clientip'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.dragFieldToWorkspace('@timestamp', xyChartContainer); + await PageObjects.lens.waitForVisualization(xyChartContainer); + await PageObjects.lens.dragFieldToWorkspace('clientip', xyChartContainer); + await PageObjects.lens.waitForVisualization(xyChartContainer); expect( await PageObjects.lens.getDimensionTriggersTexts('lnsXY_splitDimensionPanel') ).to.eql(['Top 3 values of clientip']); @@ -329,11 +330,11 @@ export default function ({ getPageObjects }: FtrProviderContext) { it('overwrite existing time dimension if one exists already', async () => { await PageObjects.lens.searchField('utc'); - await PageObjects.lens.dragFieldToWorkspace('utc_time'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.dragFieldToWorkspace('utc_time', xyChartContainer); + await PageObjects.lens.waitForVisualization(xyChartContainer); await PageObjects.lens.searchField('client'); - await PageObjects.lens.dragFieldToWorkspace('clientip'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.dragFieldToWorkspace('clientip', xyChartContainer); + await PageObjects.lens.waitForVisualization(xyChartContainer); expect(await PageObjects.lens.getDimensionTriggersTexts('lnsXY_xDimensionPanel')).to.eql([ 'utc_time', ]); diff --git a/x-pack/test/functional/apps/lens/epoch_millis.ts b/x-pack/test/functional/apps/lens/epoch_millis.ts index deaa3e720101e..d882d69ddd1fd 100644 --- a/x-pack/test/functional/apps/lens/epoch_millis.ts +++ b/x-pack/test/functional/apps/lens/epoch_millis.ts @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { operation: 'count', field: 'Records', }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('mtrVis'); expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('1'); }); @@ -52,7 +52,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.enableTimeShift(); await PageObjects.lens.setTimeShift('3d'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('mtrVis'); expect(await PageObjects.lens.getDatatableCellText(0, 0)).to.eql('2'); }); }); diff --git a/x-pack/test/functional/apps/lens/formula.ts b/x-pack/test/functional/apps/lens/formula.ts index c2e42328dc943..02d4fda0e96a6 100644 --- a/x-pack/test/functional/apps/lens/formula.ts +++ b/x-pack/test/functional/apps/lens/formula.ts @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); await PageObjects.lens.switchToFormula(); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); // .echLegendItem__title is the only viable way of getting the xy chart's // legend item(s), so we're using a class selector here. // 4th item is the other bucket @@ -174,7 +174,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { operation: 'formula', }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('mtrVis'); expect(await PageObjects.lens.getErrorCount()).to.eql(0); }); diff --git a/x-pack/test/functional/apps/lens/gauge.ts b/x-pack/test/functional/apps/lens/gauge.ts index cce05d7b9baba..c21ddf5b70791 100644 --- a/x-pack/test/functional/apps/lens/gauge.ts +++ b/x-pack/test/functional/apps/lens/gauge.ts @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { operation: 'average', field: 'bytes', }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); }); it('should switch to gauge and render a gauge with default values', async () => { diff --git a/x-pack/test/functional/apps/lens/heatmap.ts b/x-pack/test/functional/apps/lens/heatmap.ts index 946de0c9c8e93..1386e1beea899 100644 --- a/x-pack/test/functional/apps/lens/heatmap.ts +++ b/x-pack/test/functional/apps/lens/heatmap.ts @@ -33,12 +33,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { field: 'bytes', }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); }); it('should render heatmap chart with the temperature palette', async () => { await PageObjects.lens.switchToVisualization('heatmap', 'heat'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('heatmapChart'); const debugState = await PageObjects.lens.getCurrentChartDebugState(); if (!debugState) { @@ -78,7 +78,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { typeCharByChar: true, }); }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('heatmapChart'); const debugState = await PageObjects.lens.getCurrentChartDebugState(); @@ -98,7 +98,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should not change when passing from percentage to number', async () => { await testSubjects.click('lnsPalettePanel_dynamicColoring_rangeType_groups_number'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('heatmapChart'); const debugState = await PageObjects.lens.getCurrentChartDebugState(); @@ -124,7 +124,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.setValue('lnsPalettePanel_dynamicColoring_range_value_0', '0', { clearWithKeyboard: true, }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('heatmapChart'); const debugState = await PageObjects.lens.getCurrentChartDebugState(); @@ -144,7 +144,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should reset stop numbers when changing palette', async () => { await PageObjects.lens.changePaletteTo('status'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('heatmapChart'); const debugState = await PageObjects.lens.getCurrentChartDebugState(); @@ -164,7 +164,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { it('should not change when passing from number to percent', async () => { await testSubjects.click('lnsPalettePanel_dynamicColoring_rangeType_groups_percent'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('heatmapChart'); const debugState = await PageObjects.lens.getCurrentChartDebugState(); diff --git a/x-pack/test/functional/apps/lens/index.ts b/x-pack/test/functional/apps/lens/index.ts index 20da3e48fc8ae..f66f6cf2f30e5 100644 --- a/x-pack/test/functional/apps/lens/index.ts +++ b/x-pack/test/functional/apps/lens/index.ts @@ -58,6 +58,7 @@ export default function ({ getService, loadTestFile, getPageObjects }: FtrProvid loadTestFile(require.resolve('./multi_terms')); loadTestFile(require.resolve('./epoch_millis')); loadTestFile(require.resolve('./show_underlying_data')); + loadTestFile(require.resolve('./show_underlying_data_dashboard')); }); describe('', function () { diff --git a/x-pack/test/functional/apps/lens/inspector.ts b/x-pack/test/functional/apps/lens/inspector.ts index 9db804d324936..d94d3413c07b0 100644 --- a/x-pack/test/functional/apps/lens/inspector.ts +++ b/x-pack/test/functional/apps/lens/inspector.ts @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { field: 'bytes', }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); await inspector.open('lnsApp_inspectButton'); }); diff --git a/x-pack/test/functional/apps/lens/persistent_context.ts b/x-pack/test/functional/apps/lens/persistent_context.ts index ff677440e8fe0..445caa1abbec2 100644 --- a/x-pack/test/functional/apps/lens/persistent_context.ts +++ b/x-pack/test/functional/apps/lens/persistent_context.ts @@ -83,7 +83,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.navigationalSearch.clickOnOption(0); await PageObjects.lens.waitForEmptyWorkspace(); await PageObjects.lens.switchToVisualization('lnsMetric'); - await PageObjects.lens.dragFieldToWorkspace('@timestamp'); + await PageObjects.lens.dragFieldToWorkspace('@timestamp', 'mtrVis'); }); it('preserves time range', async () => { // fill the navigation search and select empty @@ -120,7 +120,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.clickVisType('lens'); await PageObjects.lens.waitForEmptyWorkspace(); await PageObjects.lens.switchToVisualization('lnsMetric'); - await PageObjects.lens.dragFieldToWorkspace('@timestamp'); + await PageObjects.lens.dragFieldToWorkspace('@timestamp', 'mtrVis'); const timePickerValues = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes(); expect(timePickerValues.start).to.eql(PageObjects.timePicker.defaultStartTime); diff --git a/x-pack/test/functional/apps/lens/rollup.ts b/x-pack/test/functional/apps/lens/rollup.ts index 7de0d7e76c95c..25ab766d04bbd 100644 --- a/x-pack/test/functional/apps/lens/rollup.ts +++ b/x-pack/test/functional/apps/lens/rollup.ts @@ -86,12 +86,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { operation: 'sum', field: 'bytes', }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('mtrVis'); await PageObjects.lens.assertMetric('Sum of bytes', '16,788'); await PageObjects.lens.switchFirstLayerIndexPattern('lens_rolled_up_data'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('mtrVis'); await PageObjects.lens.assertMetric('Sum of bytes', '16,788'); }); diff --git a/x-pack/test/functional/apps/lens/show_underlying_data.ts b/x-pack/test/functional/apps/lens/show_underlying_data.ts index cbe6820ccef4d..4bc8be22eb8f4 100644 --- a/x-pack/test/functional/apps/lens/show_underlying_data.ts +++ b/x-pack/test/functional/apps/lens/show_underlying_data.ts @@ -23,7 +23,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.clickVisualizeListItemTitle('lnsXYvis'); await PageObjects.lens.goToTimeRange(); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); + + await PageObjects.lens.configureDimension({ + dimension: 'lnsXY_splitDimensionPanel > lns-dimensionTrigger', + operation: 'terms', + field: 'extension.raw', + }); + + await PageObjects.lens.waitForVisualization('xyVisChart'); + // expect the button is shown and enabled await testSubjects.clickWhenNotDisabled(`lnsApp_openInDiscover`); @@ -35,7 +44,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.existOrFail('discoverChart'); // check the table columns const columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['ip', '@timestamp', 'bytes']); + expect(columns).to.eql(['extension.raw', '@timestamp', 'bytes']); await browser.closeCurrentWindow(); await browser.switchToWindow(lensWindowHandler); }); @@ -50,7 +59,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.closeDimensionEditor(); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); // expect the button is shown and enabled await testSubjects.clickWhenNotDisabled(`lnsApp_openInDiscover`); @@ -82,12 +91,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.click('indexPattern-filter-by-input > switchQueryLanguageButton'); // apparently setting a filter requires some time before and after typing to work properly await PageObjects.common.sleep(1000); - await PageObjects.lens.setFilterBy('memory:*'); + await PageObjects.lens.setFilterBy('machine.ram:*'); await PageObjects.common.sleep(1000); await PageObjects.lens.closeDimensionEditor(); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); await testSubjects.clickWhenNotDisabled(`lnsApp_openInDiscover`); @@ -97,7 +106,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.existOrFail('discoverChart'); // check the query expect(await queryBar.getQueryString()).be.eql( - '( ( ip: "86.252.46.140" ) OR ( ip: "155.34.86.215" ) OR ( ip: "133.198.170.210" ) )' + '( ( extension.raw: "png" ) OR ( extension.raw: "css" ) OR ( extension.raw: "jpg" ) )' ); const filterPills = await filterBar.getFiltersLabel(); expect(filterPills.length).to.be(1); @@ -117,13 +126,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); const input = await find.activeElement(); - await input.type(`bytes > 6000`); + await input.type(`bytes > 2000`); // the tooltip seems to be there as long as the focus is in the query string await input.pressKeys(browser.keys.RIGHT); await PageObjects.lens.closeDimensionEditor(); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); // expect the button is shown and enabled await testSubjects.clickWhenNotDisabled(`lnsApp_openInDiscover`); @@ -133,10 +142,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.existOrFail('discoverChart'); // check the columns const columns = await PageObjects.discover.getColumnHeaders(); - expect(columns).to.eql(['ip', '@timestamp', 'memory']); + expect(columns).to.eql(['extension.raw', '@timestamp', 'memory']); // check the query expect(await queryBar.getQueryString()).be.eql( - '( ( bytes > 6000 ) AND ( ( ip: "0.53.251.53" ) OR ( ip: "0.108.3.2" ) OR ( ip: "0.209.80.244" ) ) )' + '( ( bytes > 2000 ) AND ( ( extension.raw: "css" ) OR ( extension.raw: "gif" ) OR ( extension.raw: "jpg" ) ) )' ); await browser.closeCurrentWindow(); await browser.switchToWindow(lensWindowHandler); @@ -158,7 +167,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.setFilterBy('bytes > 4000'); await PageObjects.common.sleep(1000); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); // expect the button is shown and enabled await testSubjects.clickWhenNotDisabled(`lnsApp_openInDiscover`); @@ -169,7 +178,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // check the query expect(await queryBar.getQueryString()).be.eql( - '( ( bytes > 4000 ) AND ( ( ip: "0.53.251.53" ) OR ( ip: "0.108.3.2" ) OR ( ip: "0.209.80.244" ) ) )' + '( ( bytes > 4000 ) AND ( ( extension.raw: "css" ) OR ( extension.raw: "gif" ) OR ( extension.raw: "jpg" ) ) )' ); await browser.closeCurrentWindow(); await browser.switchToWindow(lensWindowHandler); diff --git a/x-pack/test/functional/apps/lens/show_underlying_data_dashboard.ts b/x-pack/test/functional/apps/lens/show_underlying_data_dashboard.ts new file mode 100644 index 0000000000000..dc25e5f77f412 --- /dev/null +++ b/x-pack/test/functional/apps/lens/show_underlying_data_dashboard.ts @@ -0,0 +1,113 @@ +/* + * 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 uuid from 'uuid'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function ({ getService, getPageObjects }: FtrProviderContext) { + const PageObjects = getPageObjects([ + 'visualize', + 'lens', + 'dashboard', + 'header', + 'discover', + 'common', + ]); + + const listingTable = getService('listingTable'); + const testSubjects = getService('testSubjects'); + const dashboardPanelActions = getService('dashboardPanelActions'); + const filterBarService = getService('filterBar'); + const queryBar = getService('queryBar'); + const browser = getService('browser'); + const retry = getService('retry'); + + describe('lens show underlying data from dashboard', () => { + it('should show the open button for a compatible saved visualization', async () => { + await PageObjects.visualize.gotoVisualizationLandingPage(); + await listingTable.searchForItemWithName('lnsXYvis'); + await PageObjects.lens.clickVisualizeListItemTitle('lnsXYvis'); + await PageObjects.lens.goToTimeRange(); + await PageObjects.lens.save('Embedded Visualization', true, false, false, 'new'); + + await PageObjects.dashboard.saveDashboard(`Open in Discover Testing ${uuid()}`, { + exitFromEditMode: true, + }); + + await dashboardPanelActions.openContextMenu(); + + await testSubjects.click('embeddablePanelAction-ACTION_OPEN_IN_DISCOVER'); + + const [dashboardWindowHandle, discoverWindowHandle] = await browser.getAllWindowHandles(); + await browser.switchToWindow(discoverWindowHandle); + + await PageObjects.header.waitUntilLoadingHasFinished(); + await testSubjects.existOrFail('discoverChart'); + // check the table columns + const columns = await PageObjects.discover.getColumnHeaders(); + expect(columns).to.eql(['ip', '@timestamp', 'bytes']); + + await browser.closeCurrentWindow(); + await browser.switchToWindow(dashboardWindowHandle); + }); + + it('should bring both dashboard context and visualization context to discover', async () => { + await PageObjects.dashboard.switchToEditMode(); + await dashboardPanelActions.clickEdit(); + + await queryBar.switchQueryLanguage('lucene'); + await queryBar.setQuery('host.keyword www.elastic.co'); + await queryBar.submitQuery(); + await filterBarService.addFilter('geo.src', 'is', 'AF'); + // the filter bar seems to need a moment to settle before saving and returning + await PageObjects.common.sleep(1000); + + await PageObjects.lens.saveAndReturn(); + + await queryBar.switchQueryLanguage('kql'); + await queryBar.setQuery('request.keyword : "/apm"'); + await queryBar.submitQuery(); + await filterBarService.addFilter( + 'host.raw', + 'is', + 'cdn.theacademyofperformingartsandscience.org' + ); + + await PageObjects.dashboard.clickQuickSave(); + + // make sure Open in Discover is also available in edit mode + await dashboardPanelActions.openContextMenuMorePanel(); + await testSubjects.existOrFail('embeddablePanelAction-ACTION_OPEN_IN_DISCOVER'); + + await PageObjects.dashboard.clickCancelOutOfEditMode(); + + await dashboardPanelActions.openContextMenu(); + + await testSubjects.click('embeddablePanelAction-ACTION_OPEN_IN_DISCOVER'); + + const [dashboardWindowHandle, discoverWindowHandle] = await browser.getAllWindowHandles(); + await browser.switchToWindow(discoverWindowHandle); + + await PageObjects.header.waitUntilLoadingHasFinished(); + + await retry.waitFor('filter count to be correct', async () => { + const filterCount = await filterBarService.getFilterCount(); + return filterCount === 3; + }); + + expect( + await filterBarService.hasFilter('host.raw', 'cdn.theacademyofperformingartsandscience.org') + ).to.be.ok(); + expect(await filterBarService.hasFilter('geo.src', 'AF')).to.be.ok(); + expect(await filterBarService.getFiltersLabel()).to.contain('Lens context (lucene)'); + expect(await queryBar.getQueryString()).to.be('request.keyword : "/apm"'); + + await browser.closeCurrentWindow(); + await browser.switchToWindow(dashboardWindowHandle); + }); + }); +} diff --git a/x-pack/test/functional/apps/lens/smokescreen.ts b/x-pack/test/functional/apps/lens/smokescreen.ts index f0cc3b0da7201..c2a98d2d5dedc 100644 --- a/x-pack/test/functional/apps/lens/smokescreen.ts +++ b/x-pack/test/functional/apps/lens/smokescreen.ts @@ -60,7 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await listingTable.searchForItemWithName('Afancilenstest'); await PageObjects.lens.clickVisualizeListItemTitle('Afancilenstest'); await PageObjects.lens.goToTimeRange(); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); expect(await PageObjects.lens.getTitle()).to.eql('Afancilenstest'); @@ -82,7 +82,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { keepOpen: true, }); await PageObjects.lens.addFilterToAgg(`geo.src : CN`); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); // Verify that the field was persisted from the transition expect(await PageObjects.lens.getFiltersAggLabels()).to.eql([`ip : *`, `geo.src : CN`]); @@ -199,7 +199,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const longLabel = 'Veryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryvery long label wrapping multiple lines'; await PageObjects.lens.editDimensionLabel(longLabel); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); await PageObjects.lens.closeDimensionEditor(); expect(await PageObjects.lens.getDimensionTriggerText('lnsXY_yDimensionPanel')).to.eql( @@ -239,19 +239,19 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); await PageObjects.lens.changeAxisSide('right'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); let data = await PageObjects.lens.getCurrentChartDebugState(); expect(data?.axes?.y.length).to.eql(2); expect(data?.axes?.y.some(({ position }) => position === 'right')).to.eql(true); await PageObjects.lens.changeAxisSide('left'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); data = await PageObjects.lens.getCurrentChartDebugState(); expect(data?.axes?.y.length).to.eql(1); expect(data?.axes?.y.some(({ position }) => position === 'right')).to.eql(false); await PageObjects.lens.changeAxisSide('right'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); await PageObjects.lens.closeDimensionEditor(); }); @@ -261,7 +261,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.openVisualOptions(); await testSubjects.click('lns_valueLabels_inside'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); // check for value labels let data = await PageObjects.lens.getCurrentChartDebugState(); @@ -269,7 +269,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // switch to stacked bar chart await PageObjects.lens.switchToVisualization('bar_stacked'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); // check for value labels data = await PageObjects.lens.getCurrentChartDebugState(); @@ -282,14 +282,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.setValue('lnsyLeftAxisTitle', axisTitle, { clearWithKeyboard: true, }); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); let data = await PageObjects.lens.getCurrentChartDebugState(); expect(data?.axes?.y?.[0].title).to.eql(axisTitle); // hide the gridlines await testSubjects.click('lnsshowyLeftAxisGridlines'); - await PageObjects.lens.waitForVisualization(); + await PageObjects.lens.waitForVisualization('xyVisChart'); data = await PageObjects.lens.getCurrentChartDebugState(); expect(data?.axes?.y?.[0].gridlines.length).to.eql(0); diff --git a/x-pack/test/functional/apps/lens/tsvb_open_in_lens.ts b/x-pack/test/functional/apps/lens/tsvb_open_in_lens.ts index 0856fbb4ff1ec..0315d20e5fc91 100644 --- a/x-pack/test/functional/apps/lens/tsvb_open_in_lens.ts +++ b/x-pack/test/functional/apps/lens/tsvb_open_in_lens.ts @@ -48,7 +48,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('visualizes field to Lens and loads fields to the dimesion editor', async () => { const button = await testSubjects.find('visualizeEditInLensButton'); await button.click(); - await lens.waitForVisualization(); + await lens.waitForVisualization('xyVisChart'); await retry.try(async () => { const dimensions = await testSubjects.findAll('lns-dimensionTrigger'); expect(dimensions).to.have.length(2); @@ -72,7 +72,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await header.waitUntilLoadingHasFinished(); const button = await testSubjects.find('visualizeEditInLensButton'); await button.click(); - await lens.waitForVisualization(); + await lens.waitForVisualization('xyVisChart'); expect(await filterBar.hasFilter('extension', 'css')).to.be(true); }); @@ -86,7 +86,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await header.waitUntilLoadingHasFinished(); const button = await testSubjects.find('visualizeEditInLensButton'); await button.click(); - await lens.waitForVisualization(); + await lens.waitForVisualization('xyVisChart'); expect(await queryBar.getQueryString()).to.equal('machine.os : ios'); }); @@ -128,7 +128,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const button = await testSubjects.find('visualizeEditInLensButton'); await button.click(); - await lens.waitForVisualization(); + await lens.waitForVisualization('xyVisChart'); await retry.try(async () => { const dimensions = await testSubjects.findAll('lns-dimensionTrigger'); expect(await dimensions[1].getVisibleText()).to.be('Count of records'); @@ -157,7 +157,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const button = await testSubjects.find('visualizeEditInLensButton'); await button.click(); - await lens.waitForVisualization(); + await lens.waitForVisualization('mtrVis'); await retry.try(async () => { const dimensions = await testSubjects.findAll('lns-dimensionTrigger'); expect(await dimensions[1].getVisibleText()).to.be('Count of records'); diff --git a/x-pack/test/functional/apps/maps/lens/choropleth_chart.ts b/x-pack/test/functional/apps/maps/lens/choropleth_chart.ts index daa490f8ef051..420f895fe6aa6 100644 --- a/x-pack/test/functional/apps/maps/lens/choropleth_chart.ts +++ b/x-pack/test/functional/apps/maps/lens/choropleth_chart.ts @@ -47,7 +47,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.visualize.clickVisType('lens'); await PageObjects.lens.goToTimeRange(); - await PageObjects.lens.dragFieldToWorkspace('geo.dest'); + await PageObjects.lens.dragFieldToWorkspace('geo.dest', 'xyVisChart'); // add filter to force data fetch to set activeData await filterBar.addFilter('bytes', 'is between', '200', '10000'); diff --git a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts index a20962e607af2..a65468e0ca3ec 100644 --- a/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts +++ b/x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer.ts @@ -254,7 +254,10 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { const lensMetricField = testData.expected.metricFields![0]; if (lensMetricField) { - await ml.dataVisualizerTable.assertLensActionShowChart(lensMetricField.fieldName); + await ml.dataVisualizerTable.assertLensActionShowChart( + lensMetricField.fieldName, + 'mtrVis' + ); await ml.navigation.browserBackTo('dataVisualizerTable'); } const lensNonMetricField = testData.expected.nonMetricFields?.find( @@ -262,7 +265,10 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { ); if (lensNonMetricField) { - await ml.dataVisualizerTable.assertLensActionShowChart(lensNonMetricField.fieldName); + await ml.dataVisualizerTable.assertLensActionShowChart( + lensNonMetricField.fieldName, + 'mtrVis' + ); await ml.navigation.browserBackTo('dataVisualizerTable'); } }); diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index a4f6493d513cb..fa46052705c91 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -201,7 +201,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont * * @param field - the desired field for the dimension * */ - async dragFieldToWorkspace(field: string) { + async dragFieldToWorkspace(field: string, visualizationTestSubj?: string) { const from = `lnsFieldListPanelField-${field}`; await find.existsByCssSelector(from); await browser.html5DragAndDrop( @@ -209,7 +209,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont testSubjects.getCssSelector('lnsWorkspace') ); await this.waitForLensDragDropToFinish(); - await this.waitForVisualization(); + await this.waitForVisualization(visualizationTestSubj); }, /** diff --git a/x-pack/test/functional/services/ml/data_visualizer_table.ts b/x-pack/test/functional/services/ml/data_visualizer_table.ts index cf9b1f8fa35a5..e5c0dafbd00f7 100644 --- a/x-pack/test/functional/services/ml/data_visualizer_table.ts +++ b/x-pack/test/functional/services/ml/data_visualizer_table.ts @@ -565,12 +565,12 @@ export function MachineLearningDataVisualizerTableProvider( } } - public async assertLensActionShowChart(fieldName: string) { + public async assertLensActionShowChart(fieldName: string, visualizationContainer?: string) { await retry.tryForTime(30 * 1000, async () => { await testSubjects.clickWhenNotDisabled( this.rowSelector(fieldName, 'dataVisualizerActionViewInLensButton') ); - await testSubjects.existOrFail('lnsVisualizationContainer', { + await testSubjects.existOrFail(visualizationContainer ?? 'lnsVisualizationContainer', { timeout: 15 * 1000, }); }); diff --git a/x-pack/test/load/config.ts b/x-pack/test/load/config.ts index a243635e5ea4c..2d20806f3e9e8 100644 --- a/x-pack/test/load/config.ts +++ b/x-pack/test/load/config.ts @@ -13,6 +13,8 @@ import { GatlingTestRunner } from './runner'; // These "secret" values are intentionally written in the source. const APM_SERVER_URL = 'https://142fea2d3047486e925eb8b223559cae.apm.europe-west1.gcp.cloud.es.io'; const APM_PUBLIC_TOKEN = 'pWFFEym07AKBBhUE2i'; +const AGGS_SHARD_DELAY = process.env.LOAD_TESTING_SHARD_DELAY; +const DISABLE_PLUGINS = process.env.LOAD_TESTING_DISABLE_PLUGINS; export default async function ({ readConfigFile }: FtrConfigProviderContext) { const kibanaCommonTestsConfig = await readConfigFile( @@ -43,6 +45,8 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...xpackFunctionalTestsConfig.get('kbnTestServer.sourceArgs'), '--no-base-path', '--env.name=development', + ...(!!AGGS_SHARD_DELAY ? ['--data.search.aggs.shardDelay.enabled=true'] : []), + ...(!!DISABLE_PLUGINS ? ['--plugins.initialize=false'] : []), ], env: { ELASTIC_APM_ACTIVE: process.env.ELASTIC_APM_ACTIVE, diff --git a/x-pack/test/search_sessions_integration/tests/apps/dashboard/async_search/save_search_session_relative_time.ts b/x-pack/test/search_sessions_integration/tests/apps/dashboard/async_search/save_search_session_relative_time.ts index 71bf03365e66d..d257a2fb560dd 100644 --- a/x-pack/test/search_sessions_integration/tests/apps/dashboard/async_search/save_search_session_relative_time.ts +++ b/x-pack/test/search_sessions_integration/tests/apps/dashboard/async_search/save_search_session_relative_time.ts @@ -63,7 +63,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await searchSessions.save(); await searchSessions.expectState('backgroundCompleted'); - await checkSampleDashboardLoaded(); + await checkSampleDashboardLoaded('xyVisChart'); // load URL to restore a saved session await PageObjects.searchSessionsManagement.goTo(); @@ -74,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.dashboard.waitForRenderComplete(); - await checkSampleDashboardLoaded(); + await checkSampleDashboardLoaded('xyVisChart'); // Check that session is restored await searchSessions.expectState('restored'); @@ -83,11 +83,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // HELPERS - async function checkSampleDashboardLoaded() { + async function checkSampleDashboardLoaded(visualizationContainer?: string) { log.debug('Checking no error labels'); await testSubjects.missingOrFail('embeddableErrorLabel'); log.debug('Checking charts rendered'); - await elasticChart.waitForRenderComplete('lnsVisualizationContainer'); + await elasticChart.waitForRenderComplete(visualizationContainer ?? 'lnsVisualizationContainer'); log.debug('Checking saved searches rendered'); await dashboardExpect.savedSearchRowCount(11); log.debug('Checking input controls rendered'); diff --git a/yarn.lock b/yarn.lock index 9a480a2a16295..ce17dc8768523 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29254,7 +29254,7 @@ vega-scale@^7.0.3, vega-scale@^7.1.1, vega-scale@^7.2.0, vega-scale@~7.2.0: vega-time "^2.1.0" vega-util "^1.17.0" -vega-scenegraph@^4.10.0, vega-scenegraph@^4.9.2, vega-scenegraph@^4.9.3, vega-scenegraph@~4.10.0: +vega-scenegraph@^4.10.0, vega-scenegraph@^4.9.2, vega-scenegraph@^4.9.3: version "4.10.0" resolved "https://registry.yarnpkg.com/vega-scenegraph/-/vega-scenegraph-4.10.0.tgz#232643372760ea081f2a899f640530777c2e2ba8" integrity sha512-znUQAulNJnuXSza8+Qg1objNpXcHxP9KZwwp0XW4H/AHbzVhHEigZagb8xKDpQI1/8OSk2WZf9Bkr7CrsFC0hg== @@ -29266,6 +29266,18 @@ vega-scenegraph@^4.10.0, vega-scenegraph@^4.9.2, vega-scenegraph@^4.9.3, vega-sc vega-scale "^7.2.0" vega-util "^1.15.2" +vega-scenegraph@~4.10.1: + version "4.10.1" + resolved "https://registry.yarnpkg.com/vega-scenegraph/-/vega-scenegraph-4.10.1.tgz#944da67b8a28758fab2e1306259fb7ff6be89f6b" + integrity sha512-takIpkmNxYHhJYALOYzhTin3EDzbys6U4g+l1yJZVlXG9YTdiCMuEVAdtaQOCqF9/7qytD6pCrMxJY2HaoN0qQ== + dependencies: + d3-path "^3.0.1" + d3-shape "^3.1.0" + vega-canvas "^1.2.5" + vega-loader "^4.4.0" + vega-scale "^7.2.0" + vega-util "^1.15.2" + vega-schema-url-parser@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/vega-schema-url-parser/-/vega-schema-url-parser-2.2.0.tgz#a0d1e02915adfbfcb1fd517c8c2ebe2419985c1e" @@ -29375,10 +29387,10 @@ vega-wordcloud@~4.1.3: vega-statistics "^1.7.9" vega-util "^1.15.2" -vega@^5.22.0: - version "5.22.0" - resolved "https://registry.yarnpkg.com/vega/-/vega-5.22.0.tgz#9286832a0bc523ee39b1f3baff9a2ca1957a61f0" - integrity sha512-ZIehKTrMY93sWaWIn/2N2LwsCN8XymQthxQA5fQwTmefVl7OOvcYmsGFJ9nttXUF4n0z5WRXkSsPZcJHHBlOKw== +vega@^5.22.1: + version "5.22.1" + resolved "https://registry.yarnpkg.com/vega/-/vega-5.22.1.tgz#e028f3645de18e0070317bc04410282975549e1e" + integrity sha512-KJBI7OWSzpfCPbmWl3GQCqBqbf2TIdpWS0mzO6MmWbvdMhWHf74P9IVnx1B1mhg0ZTqWFualx9ZYhWzMMwudaQ== dependencies: vega-crossfilter "~4.1.0" vega-dataflow "~5.7.4" @@ -29397,7 +29409,7 @@ vega@^5.22.0: vega-regression "~1.1.0" vega-runtime "~6.1.3" vega-scale "~7.2.0" - vega-scenegraph "~4.10.0" + vega-scenegraph "~4.10.1" vega-statistics "~1.8.0" vega-time "~2.1.0" vega-transforms "~4.10.0"