Skip to content

Commit

Permalink
Merge branch 'main' into issue-119454-es-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Dec 24, 2021
2 parents a3b4059 + 54cc284 commit 53658ec
Show file tree
Hide file tree
Showing 270 changed files with 4,112 additions and 96,011 deletions.
4 changes: 2 additions & 2 deletions api_docs/alerting.json
Original file line number Diff line number Diff line change
Expand Up @@ -3450,10 +3450,10 @@
},
{
"parentPluginId": "alerting",
"id": "def-common.AlertingFrameworkHealth.alertingFrameworkHeath",
"id": "def-common.AlertingFrameworkHealth.alertingFrameworkHealth",
"type": "Object",
"tags": [],
"label": "alertingFrameworkHeath",
"label": "alertingFrameworkHealth",
"description": [],
"signature": [
{
Expand Down
3 changes: 3 additions & 0 deletions docs/api/alerting/health.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ The health API response contains the following properties:
| `alerting_framework_health`
| This state property has three substates that identify the health of the alerting framework API: `decryption_health`, `execution_health`, and `read_health`.

| deprecated::`alerting_framework_heath`
| This state property has a typo, use `alerting_framework_health` instead. It has three substates that identify the health of the alerting framework API: `decryption_health`, `execution_health`, and `read_health`.

|===

`alerting_framework_health` consists of the following properties:
Expand Down
6 changes: 3 additions & 3 deletions docs/api/alerting/legacy/health.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The API returns the following:
{
"isSufficientlySecure":true,
"hasPermanentEncryptionKey":true,
"alertingFrameworkHeath":{
"alertingFrameworkHealth":{
"decryptionHealth":{
"status":"ok",
"timestamp":"2021-02-10T23:35:04.949Z"
Expand Down Expand Up @@ -73,12 +73,12 @@ The health API response contains the following properties:
| `hasPermanentEncryptionKey`
| Return the state `false` if Encrypted Saved Object plugin has not a permanent encryption Key.

| `alertingFrameworkHeath`
| `alertingFrameworkHealth`
| This state property has three substates that identify the health of the alerting framework API: `decryptionHealth`, `executionHealth`, and `readHealth`.

|===

`alertingFrameworkHeath` consists of the following properties:
`alertingFrameworkHealth` consists of the following properties:

[cols="2*<"]
|===
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@
"@types/kbn__server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository/npm_module_types",
"@types/kbn__std": "link:bazel-bin/packages/kbn-std/npm_module_types",
"@types/kbn__telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools/npm_module_types",
"@types/kbn__utility-types": "link:bazel-bin/packages/kbn-utility-types/npm_module_types",
"@types/kbn__utils": "link:bazel-bin/packages/kbn-utils/npm_module_types",
"@types/license-checker": "15.0.0",
"@types/listr": "^0.14.0",
"@types/loader-utils": "^1.1.3",
Expand Down
2 changes: 2 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ filegroup(
"//packages/kbn-server-route-repository:build_types",
"//packages/kbn-std:build_types",
"//packages/kbn-telemetry-tools:build_types",
"//packages/kbn-utility-types:build_types",
"//packages/kbn-utils:build_types",
],
)

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-apm-config-loader/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUNTIME_DEPS = [

TYPES_DEPS = [
"//packages/elastic-safer-lodash-set",
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"@npm//@elastic/apm-rum",
"@npm//@types/jest",
"@npm//@types/js-yaml",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TYPES_DEPS = [
"//packages/kbn-optimizer:npm_module_types",
"//packages/kbn-server-http-tools:npm_module_types",
"//packages/kbn-std:npm_module_types",
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"@npm//argsplit",
"@npm//chokidar",
"@npm//elastic-apm-node",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TYPES_DEPS = [
"//packages/kbn-config-schema:npm_module_types",
"//packages/kbn-logging",
"//packages/kbn-std:npm_module_types",
"//packages/kbn-utility-types",
"//packages/kbn-utility-types:npm_module_types",
"//packages/kbn-i18n:npm_module_types",
"@npm//load-json-file",
"@npm//rxjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"@npm//@babel/parser",
"@npm//@babel/types",
"@npm//@types/babel__core",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-docs-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/kbn-config:npm_module_types",
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"@npm//ts-morph",
"@npm//@types/dedent",
"@npm//@types/jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es-archiver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-test",
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"@npm//@elastic/elasticsearch",
"@npm//aggregate-error",
"@npm//globby",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es-query/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-utility-types",
"//packages/kbn-utility-types:npm_module_types",
"//packages/kbn-i18n:npm_module_types",
"@npm//@elastic/elasticsearch",
"@npm//tslib",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ TYPES_DEPS = [
"//packages/kbn-std:npm_module_types",
"//packages/kbn-ui-shared-deps-npm",
"//packages/kbn-ui-shared-deps-src",
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"@npm//chalk",
"@npm//clean-webpack-plugin",
"@npm//cpy",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-generator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"//packages/kbn-dev-utils:npm_module_types",
"@npm//del",
"@npm//execa",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-helpers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-optimizer:npm_module_types",
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"@npm//del",
"@npm//execa",
"@npm//globby",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-std/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-utility-types",
"//packages/kbn-utility-types:npm_module_types",
"@npm//query-string",
"@npm//rxjs",
"@npm//tslib",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-storybook/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TYPES_DEPS = [
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-ui-shared-deps-npm",
"//packages/kbn-ui-shared-deps-src",
"//packages/kbn-utils",
"//packages/kbn-utils:npm_module_types",
"@npm//@storybook/addons",
"@npm//@storybook/api",
"@npm//@storybook/components",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-telemetry-tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUNTIME_DEPS = [

TYPES_DEPS = [
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-utility-types",
"//packages/kbn-utility-types:npm_module_types",
"@npm//tslib",
"@npm//@types/glob",
"@npm//@types/jest",
Expand Down
7 changes: 4 additions & 3 deletions packages/kbn-test-subj-selector/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "pkg_npm")

PKG_BASE_NAME = "kbn-test-subj-selector"
PKG_REQUIRE_NAME = "@kbn/test-subj-selector"
Expand All @@ -20,14 +21,14 @@ NPM_MODULE_EXTRA_FILES = [
"README.md",
]

DEPS = []
RUNTIME_DEPS = []

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES + [
":srcs",
],
deps = DEPS,
deps = RUNTIME_DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-test/src/jest/utils/testbed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export type {
TestBedConfig,
AsyncTestBedConfig,
SetupFunc,
UnwrapPromise,
SyncSetupFunc,
AsyncSetupFunc,
} from './types';
5 changes: 0 additions & 5 deletions packages/kbn-test/src/jest/utils/testbed/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,3 @@ export interface MemoryRouterConfig {
/** A callBack that will be called with the React Router instance once mounted */
onRouter?: (router: any) => void;
}

/**
* Utility type: extracts returned type from a Promise.
*/
export type UnwrapPromise<T> = T extends Promise<infer P> ? P : T;
7 changes: 4 additions & 3 deletions packages/kbn-tinymath/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("@npm//peggy:index.bzl", "peggy")
load("//src/dev/bazel:index.bzl", "pkg_npm")

PKG_BASE_NAME = "kbn-tinymath"
PKG_REQUIRE_NAME = "@kbn/tinymath"
Expand All @@ -26,7 +27,7 @@ NPM_MODULE_EXTRA_FILES = [
"README.md",
]

DEPS = [
RUNTIME_DEPS = [
"@npm//lodash",
]

Expand All @@ -49,7 +50,7 @@ js_library(
":srcs",
":grammar"
],
deps = DEPS,
deps = RUNTIME_DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
7 changes: 4 additions & 3 deletions packages/kbn-ui-framework/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "pkg_npm")

PKG_BASE_NAME = "kbn-ui-framework"
PKG_REQUIRE_NAME = "@kbn/ui-framework"
Expand All @@ -19,14 +20,14 @@ NPM_MODULE_EXTRA_FILES = [
"README.md",
]

DEPS = []
RUNTIME_DEPS = []

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES + [
":srcs",
],
deps = DEPS,
deps = RUNTIME_DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
26 changes: 22 additions & 4 deletions packages/kbn-utility-types/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_BASE_NAME = "kbn-utility-types"
PKG_REQUIRE_NAME = "@kbn/utility-types"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__utility-types"

SOURCE_FILES = glob([
"src/jest/index.ts",
Expand Down Expand Up @@ -66,7 +67,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
deps = RUNTIME_DEPS + [":target_node"],
package_name = "@kbn/utility-types",
visibility = ["//visibility:public"],
)
Expand All @@ -85,3 +86,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)

pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)

filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)
8 changes: 3 additions & 5 deletions packages/kbn-utility-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ TypeScript utility types for usage in Kibana.
## Usage

```ts
import { UnwrapPromise } from '@kbn/utility-types';
import { UnwrapObservable } from '@kbn/utility-types';

type A = Promise<string>;
type B = UnwrapPromise<A>; // string
type A = Observable<string>;
type B = UnwrapObservable<A>; // string
```


Expand All @@ -27,6 +27,4 @@ type B = UnwrapPromise<A>; // string
- `ShallowPromise<T>` &mdash; Same as `Promise` type, but it flat maps the wrapped type.
- `UnionToIntersection<T>` &mdash; Converts a union of types into an intersection.
- `UnwrapObservable<T>` &mdash; Returns wrapped type of an observable.
- `UnwrapPromise<T>` &mdash; Returns wrapped type of a promise.
- `UnwrapPromiseOrReturn<T>` &mdash; Returns wrapped type of a promise or the type itself, if it isn't a promise.
- `Values<T>` &mdash; Returns object or array value types.
1 change: 0 additions & 1 deletion packages/kbn-utility-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "target_node/index.js",
"types": "target_types/index.d.ts",
"kibana": {
"devOnly": false
},
Expand Down
11 changes: 0 additions & 11 deletions packages/kbn-utility-types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

import { PromiseType } from 'utility-types';
export type { $Values, Assign, Class, Optional, Required } from 'utility-types';

export type {
Expand All @@ -27,16 +26,6 @@ export type MaybePromise<T> = T | Promise<T>;
*/
export type ShallowPromise<T> = T extends Promise<infer U> ? Promise<U> : Promise<T>;

/**
* Returns wrapped type of a `Promise`.
*/
export type UnwrapPromise<T extends Promise<any>> = PromiseType<T>;

/**
* Returns wrapped type of a promise, or returns type as is, if it is not a promise.
*/
export type UnwrapPromiseOrReturn<T> = T extends Promise<infer U> ? U : T;

/**
* Minimal interface for an object resembling an `Observable`.
*/
Expand Down
Loading

0 comments on commit 53658ec

Please sign in to comment.