diff --git a/Jenkinsfile b/Jenkinsfile
index ec0bc2327321..c0afcac731ff 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -17,6 +17,8 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'oss-ciGroup4': getOssCiGroupWorker(4),
'oss-ciGroup5': getOssCiGroupWorker(5),
'oss-ciGroup6': getOssCiGroupWorker(6),
+ ]),
+ 'kibana-oss-agent2': withWorkers('kibana-oss-tests2', { buildOss() }, [
'oss-ciGroup7': getOssCiGroupWorker(7),
'oss-ciGroup8': getOssCiGroupWorker(8),
'oss-ciGroup9': getOssCiGroupWorker(9),
@@ -32,6 +34,8 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
'xpack-ciGroup3': getXpackCiGroupWorker(3),
'xpack-ciGroup4': getXpackCiGroupWorker(4),
'xpack-ciGroup5': getXpackCiGroupWorker(5),
+ ]),
+ 'kibana-xpack-agent2': withWorkers('kibana-xpack-tests2', { buildXpack() }, [
'xpack-ciGroup6': getXpackCiGroupWorker(6),
'xpack-ciGroup7': getXpackCiGroupWorker(7),
'xpack-ciGroup8': getXpackCiGroupWorker(8),
diff --git a/docs/development/core/public/kibana-plugin-public.applicationsetup.registermountcontext.md b/docs/development/core/public/kibana-plugin-public.applicationsetup.registermountcontext.md
index 0b5bd8eeb36e..f264ba500ed6 100644
--- a/docs/development/core/public/kibana-plugin-public.applicationsetup.registermountcontext.md
+++ b/docs/development/core/public/kibana-plugin-public.applicationsetup.registermountcontext.md
@@ -9,7 +9,7 @@ Register a context provider for application mounting. Will only be available to
Signature:
```typescript
-registerMountContext(contextName: T, provider: IContextProvider): void;
+registerMountContext(contextName: T, provider: IContextProvider): void;
```
## Parameters
@@ -17,7 +17,7 @@ registerMountContext(contextName: T, provider:
| Parameter | Type | Description |
| --- | --- | --- |
| contextName | T
| The key of [AppMountContext](./kibana-plugin-public.appmountcontext.md) this provider's return value should be attached to. |
-| provider | IContextProvider<AppMountContext, T>
| A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
+| provider | IContextProvider<App['mount'], T>
| A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
Returns:
diff --git a/docs/development/core/public/kibana-plugin-public.applicationstart.registermountcontext.md b/docs/development/core/public/kibana-plugin-public.applicationstart.registermountcontext.md
index fc86aaf658b6..62821fcbb92b 100644
--- a/docs/development/core/public/kibana-plugin-public.applicationstart.registermountcontext.md
+++ b/docs/development/core/public/kibana-plugin-public.applicationstart.registermountcontext.md
@@ -9,7 +9,7 @@ Register a context provider for application mounting. Will only be available to
Signature:
```typescript
-registerMountContext(contextName: T, provider: IContextProvider): void;
+registerMountContext(contextName: T, provider: IContextProvider): void;
```
## Parameters
@@ -17,7 +17,7 @@ registerMountContext(contextName: T, provider:
| Parameter | Type | Description |
| --- | --- | --- |
| contextName | T
| The key of [AppMountContext](./kibana-plugin-public.appmountcontext.md) this provider's return value should be attached to. |
-| provider | IContextProvider<AppMountContext, T>
| A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
+| provider | IContextProvider<App['mount'], T>
| A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
Returns:
diff --git a/docs/development/core/public/kibana-plugin-public.appmountcontext.core.md b/docs/development/core/public/kibana-plugin-public.appmountcontext.core.md
index 63b3ead814f0..f4dee0f29af3 100644
--- a/docs/development/core/public/kibana-plugin-public.appmountcontext.core.md
+++ b/docs/development/core/public/kibana-plugin-public.appmountcontext.core.md
@@ -18,5 +18,8 @@ core: {
notifications: NotificationsStart;
overlays: OverlayStart;
uiSettings: UiSettingsClientContract;
+ injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
};
```
diff --git a/docs/development/core/public/kibana-plugin-public.appmountcontext.md b/docs/development/core/public/kibana-plugin-public.appmountcontext.md
index c6541e3eca39..97d143d518f6 100644
--- a/docs/development/core/public/kibana-plugin-public.appmountcontext.md
+++ b/docs/development/core/public/kibana-plugin-public.appmountcontext.md
@@ -16,5 +16,5 @@ export interface AppMountContext
| Property | Type | Description |
| --- | --- | --- |
-| [core](./kibana-plugin-public.appmountcontext.core.md) | {
application: Pick<ApplicationStart, 'capabilities' | 'navigateToApp'>;
chrome: ChromeStart;
docLinks: DocLinksStart;
http: HttpStart;
i18n: I18nStart;
notifications: NotificationsStart;
overlays: OverlayStart;
uiSettings: UiSettingsClientContract;
}
| Core service APIs available to mounted applications. |
+| [core](./kibana-plugin-public.appmountcontext.core.md) | {
application: Pick<ApplicationStart, 'capabilities' | 'navigateToApp'>;
chrome: ChromeStart;
docLinks: DocLinksStart;
http: HttpStart;
i18n: I18nStart;
notifications: NotificationsStart;
overlays: OverlayStart;
uiSettings: UiSettingsClientContract;
injectedMetadata: {
getInjectedVar: (name: string, defaultValue?: any) => unknown;
};
}
| Core service APIs available to mounted applications. |
diff --git a/docs/development/core/public/kibana-plugin-public.contextsetup.createcontextcontainer.md b/docs/development/core/public/kibana-plugin-public.contextsetup.createcontextcontainer.md
index 2644596354e3..5334eee84257 100644
--- a/docs/development/core/public/kibana-plugin-public.contextsetup.createcontextcontainer.md
+++ b/docs/development/core/public/kibana-plugin-public.contextsetup.createcontextcontainer.md
@@ -9,9 +9,9 @@ Creates a new [IContextContainer](./kibana-plugin-public.icontextcontainer.md) f
Signature:
```typescript
-createContextContainer(): IContextContainer;
+createContextContainer>(): IContextContainer;
```
Returns:
-`IContextContainer`
+`IContextContainer`
diff --git a/docs/development/core/public/kibana-plugin-public.coresetup.injectedmetadata.md b/docs/development/core/public/kibana-plugin-public.coresetup.injectedmetadata.md
new file mode 100644
index 000000000000..f9c1a283e380
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.coresetup.injectedmetadata.md
@@ -0,0 +1,19 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md)
+
+## CoreSetup.injectedMetadata property
+
+> Warning: This API is now obsolete.
+>
+>
+
+exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. Use the legacy platform API instead.
+
+Signature:
+
+```typescript
+injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
+```
diff --git a/docs/development/core/public/kibana-plugin-public.coresetup.md b/docs/development/core/public/kibana-plugin-public.coresetup.md
index 9b94e2db5283..f9335425fed4 100644
--- a/docs/development/core/public/kibana-plugin-public.coresetup.md
+++ b/docs/development/core/public/kibana-plugin-public.coresetup.md
@@ -20,6 +20,7 @@ export interface CoreSetup
| [context](./kibana-plugin-public.coresetup.context.md) | ContextSetup
| [ContextSetup](./kibana-plugin-public.contextsetup.md) |
| [fatalErrors](./kibana-plugin-public.coresetup.fatalerrors.md) | FatalErrorsSetup
| [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md) |
| [http](./kibana-plugin-public.coresetup.http.md) | HttpSetup
| [HttpSetup](./kibana-plugin-public.httpsetup.md) |
+| [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md) | {
getInjectedVar: (name: string, defaultValue?: any) => unknown;
}
| exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. Use the legacy platform API instead. |
| [notifications](./kibana-plugin-public.coresetup.notifications.md) | NotificationsSetup
| [NotificationsSetup](./kibana-plugin-public.notificationssetup.md) |
| [uiSettings](./kibana-plugin-public.coresetup.uisettings.md) | UiSettingsClientContract
| [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) |
diff --git a/docs/development/core/public/kibana-plugin-public.corestart.injectedmetadata.md b/docs/development/core/public/kibana-plugin-public.corestart.injectedmetadata.md
new file mode 100644
index 000000000000..9224b97bc430
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.corestart.injectedmetadata.md
@@ -0,0 +1,19 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreStart](./kibana-plugin-public.corestart.md) > [injectedMetadata](./kibana-plugin-public.corestart.injectedmetadata.md)
+
+## CoreStart.injectedMetadata property
+
+> Warning: This API is now obsolete.
+>
+>
+
+exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. Use the legacy platform API instead.
+
+Signature:
+
+```typescript
+injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
+```
diff --git a/docs/development/core/public/kibana-plugin-public.corestart.md b/docs/development/core/public/kibana-plugin-public.corestart.md
index 5c1626958c4d..47eba78bf43e 100644
--- a/docs/development/core/public/kibana-plugin-public.corestart.md
+++ b/docs/development/core/public/kibana-plugin-public.corestart.md
@@ -21,6 +21,7 @@ export interface CoreStart
| [docLinks](./kibana-plugin-public.corestart.doclinks.md) | DocLinksStart
| [DocLinksStart](./kibana-plugin-public.doclinksstart.md) |
| [http](./kibana-plugin-public.corestart.http.md) | HttpStart
| [HttpStart](./kibana-plugin-public.httpstart.md) |
| [i18n](./kibana-plugin-public.corestart.i18n.md) | I18nStart
| [I18nStart](./kibana-plugin-public.i18nstart.md) |
+| [injectedMetadata](./kibana-plugin-public.corestart.injectedmetadata.md) | {
getInjectedVar: (name: string, defaultValue?: any) => unknown;
}
| exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. Use the legacy platform API instead. |
| [notifications](./kibana-plugin-public.corestart.notifications.md) | NotificationsStart
| [NotificationsStart](./kibana-plugin-public.notificationsstart.md) |
| [overlays](./kibana-plugin-public.corestart.overlays.md) | OverlayStart
| [OverlayStart](./kibana-plugin-public.overlaystart.md) |
| [savedObjects](./kibana-plugin-public.corestart.savedobjects.md) | SavedObjectsStart
| [SavedObjectsStart](./kibana-plugin-public.savedobjectsstart.md) |
diff --git a/docs/development/core/public/kibana-plugin-public.handlercontexttype.md b/docs/development/core/public/kibana-plugin-public.handlercontexttype.md
new file mode 100644
index 000000000000..b083449d2b70
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.handlercontexttype.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HandlerContextType](./kibana-plugin-public.handlercontexttype.md)
+
+## HandlerContextType type
+
+Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-public.handlerfunction.md) to represent the type of the context.
+
+Signature:
+
+```typescript
+export declare type HandlerContextType> = T extends HandlerFunction ? U : never;
+```
diff --git a/docs/development/core/public/kibana-plugin-public.handlerfunction.md b/docs/development/core/public/kibana-plugin-public.handlerfunction.md
new file mode 100644
index 000000000000..98c342c17691
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.handlerfunction.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HandlerFunction](./kibana-plugin-public.handlerfunction.md)
+
+## HandlerFunction type
+
+A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-public.icontextcontainer.md)
+
+Signature:
+
+```typescript
+export declare type HandlerFunction = (context: T, ...args: any[]) => any;
+```
diff --git a/docs/development/core/public/kibana-plugin-public.handlerparameters.md b/docs/development/core/public/kibana-plugin-public.handlerparameters.md
new file mode 100644
index 000000000000..f46c4b649e94
--- /dev/null
+++ b/docs/development/core/public/kibana-plugin-public.handlerparameters.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HandlerParameters](./kibana-plugin-public.handlerparameters.md)
+
+## HandlerParameters type
+
+Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-public.handlerfunction.md), excluding the [HandlerContextType](./kibana-plugin-public.handlercontexttype.md).
+
+Signature:
+
+```typescript
+export declare type HandlerParameters> = T extends (context: any, ...args: infer U) => any ? U : never;
+```
diff --git a/docs/development/core/public/kibana-plugin-public.icontextcontainer.createhandler.md b/docs/development/core/public/kibana-plugin-public.icontextcontainer.createhandler.md
index 2a995df45757..af3b5e3fc2eb 100644
--- a/docs/development/core/public/kibana-plugin-public.icontextcontainer.createhandler.md
+++ b/docs/development/core/public/kibana-plugin-public.icontextcontainer.createhandler.md
@@ -9,7 +9,7 @@ Create a new handler function pre-wired to context for the plugin.
Signature:
```typescript
-createHandler(pluginOpaqueId: PluginOpaqueId, handler: IContextHandler): (...rest: THandlerParameters) => THandlerReturn extends Promise ? THandlerReturn : Promise;
+createHandler(pluginOpaqueId: PluginOpaqueId, handler: THandler): (...rest: HandlerParameters) => ShallowPromise>;
```
## Parameters
@@ -17,11 +17,11 @@ createHandler(pluginOpaqueId: PluginOpaqueId, handler: IContextHandlerPluginOpaqueId | The plugin opaque ID for the plugin that registers this handler. |
-| handler | IContextHandler<TContext, THandlerReturn, THandlerParameters>
| Handler function to pass context object to. |
+| handler | THandler
| Handler function to pass context object to. |
Returns:
-`(...rest: THandlerParameters) => THandlerReturn extends Promise ? THandlerReturn : Promise`
+`(...rest: HandlerParameters) => ShallowPromise>`
A function that takes `THandlerParameters`, calls `handler` with a new context, and returns a Promise of the `handler` return value.
diff --git a/docs/development/core/public/kibana-plugin-public.icontextcontainer.md b/docs/development/core/public/kibana-plugin-public.icontextcontainer.md
index 0bc7c8f3808d..f16c07b3d790 100644
--- a/docs/development/core/public/kibana-plugin-public.icontextcontainer.md
+++ b/docs/development/core/public/kibana-plugin-public.icontextcontainer.md
@@ -9,7 +9,7 @@ An object that handles registration of context providers and configuring handler
Signature:
```typescript
-export interface IContextContainer
+export interface IContextContainer>
```
## Methods
diff --git a/docs/development/core/public/kibana-plugin-public.icontextcontainer.registercontext.md b/docs/development/core/public/kibana-plugin-public.icontextcontainer.registercontext.md
index 2cf10a6ec841..775f95bd7aff 100644
--- a/docs/development/core/public/kibana-plugin-public.icontextcontainer.registercontext.md
+++ b/docs/development/core/public/kibana-plugin-public.icontextcontainer.registercontext.md
@@ -9,7 +9,7 @@ Register a new context provider.
Signature:
```typescript
-registerContext(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider): this;
+registerContext>(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider): this;
```
## Parameters
@@ -18,7 +18,7 @@ registerContext(pluginOpaqueId: PluginOpaqu
| --- | --- | --- |
| pluginOpaqueId | PluginOpaqueId
| The plugin opaque ID for the plugin that registers this context. |
| contextName | TContextName
| The key of the TContext
object this provider supplies the value for. |
-| provider | IContextProvider<TContext, TContextName, THandlerParameters>
| A [IContextProvider](./kibana-plugin-public.icontextprovider.md) to be called each time a new context is created. |
+| provider | IContextProvider<THandler, TContextName>
| A [IContextProvider](./kibana-plugin-public.icontextprovider.md) to be called each time a new context is created. |
Returns:
diff --git a/docs/development/core/public/kibana-plugin-public.icontexthandler.md b/docs/development/core/public/kibana-plugin-public.icontexthandler.md
deleted file mode 100644
index 2251b1131c31..000000000000
--- a/docs/development/core/public/kibana-plugin-public.icontexthandler.md
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IContextHandler](./kibana-plugin-public.icontexthandler.md)
-
-## IContextHandler type
-
-A function registered by a plugin to perform some action.
-
-Signature:
-
-```typescript
-export declare type IContextHandler = (context: TContext, ...rest: THandlerParameters) => TReturn;
-```
-
-## Remarks
-
-A new `TContext` will be built for each handler before invoking.
-
diff --git a/docs/development/core/public/kibana-plugin-public.icontextprovider.md b/docs/development/core/public/kibana-plugin-public.icontextprovider.md
index a84917d6e144..40f0ee3782f6 100644
--- a/docs/development/core/public/kibana-plugin-public.icontextprovider.md
+++ b/docs/development/core/public/kibana-plugin-public.icontextprovider.md
@@ -9,7 +9,7 @@ A function that returns a context value for a specific key of given context type
Signature:
```typescript
-export declare type IContextProvider, TContextName extends keyof TContext, TProviderParameters extends any[] = []> = (context: Partial, ...rest: TProviderParameters) => Promise | TContext[TContextName];
+export declare type IContextProvider, TContextName extends keyof HandlerContextType> = (context: Partial>, ...rest: HandlerParameters) => Promise[TContextName]> | HandlerContextType[TContextName];
```
## Remarks
diff --git a/docs/development/core/public/kibana-plugin-public.md b/docs/development/core/public/kibana-plugin-public.md
index e2ef807a7501..7531cf9a0633 100644
--- a/docs/development/core/public/kibana-plugin-public.md
+++ b/docs/development/core/public/kibana-plugin-public.md
@@ -91,11 +91,13 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [AppUnmount](./kibana-plugin-public.appunmount.md) | A function called when an application should be unmounted from the page. This function should be synchronous. |
| [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) | |
| [ChromeNavLinkUpdateableFields](./kibana-plugin-public.chromenavlinkupdateablefields.md) | |
+| [HandlerContextType](./kibana-plugin-public.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-public.handlerfunction.md) to represent the type of the context. |
+| [HandlerFunction](./kibana-plugin-public.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-public.icontextcontainer.md) |
+| [HandlerParameters](./kibana-plugin-public.handlerparameters.md) | Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-public.handlerfunction.md), excluding the [HandlerContextType](./kibana-plugin-public.handlercontexttype.md). |
| [HttpBody](./kibana-plugin-public.httpbody.md) | |
| [HttpHandler](./kibana-plugin-public.httphandler.md) | |
| [HttpSetup](./kibana-plugin-public.httpsetup.md) | |
| [HttpStart](./kibana-plugin-public.httpstart.md) | |
-| [IContextHandler](./kibana-plugin-public.icontexthandler.md) | A function registered by a plugin to perform some action. |
| [IContextProvider](./kibana-plugin-public.icontextprovider.md) | A function that returns a context value for a specific key of given context type. |
| [OverlayBannerMount](./kibana-plugin-public.overlaybannermount.md) | A function that will mount the banner inside the provided element. |
| [OverlayBannerUnmount](./kibana-plugin-public.overlaybannerunmount.md) | A function that will unmount the banner from the element. |
diff --git a/docs/development/core/server/kibana-plugin-server.basepath.get.md b/docs/development/core/server/kibana-plugin-server.basepath.get.md
index 2b3b6c899e8d..04feca7ccc5a 100644
--- a/docs/development/core/server/kibana-plugin-server.basepath.get.md
+++ b/docs/development/core/server/kibana-plugin-server.basepath.get.md
@@ -9,5 +9,5 @@ returns `basePath` value, specific for an incoming request.
Signature:
```typescript
-get: (request: KibanaRequest | LegacyRequest) => string;
+get: (request: LegacyRequest | KibanaRequest) => string;
```
diff --git a/docs/development/core/server/kibana-plugin-server.basepath.md b/docs/development/core/server/kibana-plugin-server.basepath.md
index 45fb697b329f..bfa1ea02aec1 100644
--- a/docs/development/core/server/kibana-plugin-server.basepath.md
+++ b/docs/development/core/server/kibana-plugin-server.basepath.md
@@ -16,11 +16,11 @@ export declare class BasePath
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
-| [get](./kibana-plugin-server.basepath.get.md) | | (request: KibanaRequest<unknown, unknown, unknown> | LegacyRequest) => string
| returns basePath
value, specific for an incoming request. |
+| [get](./kibana-plugin-server.basepath.get.md) | | (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown>) => string
| returns basePath
value, specific for an incoming request. |
| [prepend](./kibana-plugin-server.basepath.prepend.md) | | (path: string) => string
| returns a new basePath
value, prefixed with passed url
. |
| [remove](./kibana-plugin-server.basepath.remove.md) | | (path: string) => string
| returns a new basePath
value, cleaned up from passed url
. |
| [serverBasePath](./kibana-plugin-server.basepath.serverbasepath.md) | | string
| returns the server's basePathSee [BasePath.get](./kibana-plugin-server.basepath.get.md) for getting the basePath value for a specific request |
-| [set](./kibana-plugin-server.basepath.set.md) | | (request: KibanaRequest<unknown, unknown, unknown> | LegacyRequest, requestSpecificBasePath: string) => void
| sets basePath
value, specific for an incoming request. |
+| [set](./kibana-plugin-server.basepath.set.md) | | (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown>, requestSpecificBasePath: string) => void
| sets basePath
value, specific for an incoming request. |
## Remarks
diff --git a/docs/development/core/server/kibana-plugin-server.basepath.set.md b/docs/development/core/server/kibana-plugin-server.basepath.set.md
index 1272a134ef5c..cec70ee853bf 100644
--- a/docs/development/core/server/kibana-plugin-server.basepath.set.md
+++ b/docs/development/core/server/kibana-plugin-server.basepath.set.md
@@ -9,5 +9,5 @@ sets `basePath` value, specific for an incoming request.
Signature:
```typescript
-set: (request: KibanaRequest | LegacyRequest, requestSpecificBasePath: string) => void;
+set: (request: LegacyRequest | KibanaRequest, requestSpecificBasePath: string) => void;
```
diff --git a/docs/development/core/server/kibana-plugin-server.contextsetup.createcontextcontainer.md b/docs/development/core/server/kibana-plugin-server.contextsetup.createcontextcontainer.md
index f44e6a3d7640..7096bfc43a52 100644
--- a/docs/development/core/server/kibana-plugin-server.contextsetup.createcontextcontainer.md
+++ b/docs/development/core/server/kibana-plugin-server.contextsetup.createcontextcontainer.md
@@ -9,9 +9,9 @@ Creates a new [IContextContainer](./kibana-plugin-server.icontextcontainer.md) f
Signature:
```typescript
-createContextContainer(): IContextContainer;
+createContextContainer>(): IContextContainer;
```
Returns:
-`IContextContainer`
+`IContextContainer`
diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.http.md b/docs/development/core/server/kibana-plugin-server.coresetup.http.md
index 254f2728abef..8474f4ef940d 100644
--- a/docs/development/core/server/kibana-plugin-server.coresetup.http.md
+++ b/docs/development/core/server/kibana-plugin-server.coresetup.http.md
@@ -14,7 +14,7 @@ http: {
registerOnPostAuth: HttpServiceSetup['registerOnPostAuth'];
basePath: HttpServiceSetup['basePath'];
isTlsEnabled: HttpServiceSetup['isTlsEnabled'];
- registerRouteHandlerContext: (name: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer;
+ registerRouteHandlerContext: (name: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer;
createRouter: () => IRouter;
};
```
diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.md b/docs/development/core/server/kibana-plugin-server.coresetup.md
index ed487a570f28..528557e91bd1 100644
--- a/docs/development/core/server/kibana-plugin-server.coresetup.md
+++ b/docs/development/core/server/kibana-plugin-server.coresetup.md
@@ -18,5 +18,5 @@ export interface CoreSetup
| --- | --- | --- |
| [context](./kibana-plugin-server.coresetup.context.md) | {
createContextContainer: ContextSetup['createContextContainer'];
}
| |
| [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md) | {
adminClient$: Observable<ClusterClient>;
dataClient$: Observable<ClusterClient>;
createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ClusterClient;
}
| |
-| [http](./kibana-plugin-server.coresetup.http.md) | {
createCookieSessionStorageFactory: HttpServiceSetup['createCookieSessionStorageFactory'];
registerOnPreAuth: HttpServiceSetup['registerOnPreAuth'];
registerAuth: HttpServiceSetup['registerAuth'];
registerOnPostAuth: HttpServiceSetup['registerOnPostAuth'];
basePath: HttpServiceSetup['basePath'];
isTlsEnabled: HttpServiceSetup['isTlsEnabled'];
registerRouteHandlerContext: <T extends keyof RequestHandlerContext>(name: T, provider: RequestHandlerContextProvider<RequestHandlerContext>) => RequestHandlerContextContainer<RequestHandlerContext>;
createRouter: () => IRouter;
}
| |
+| [http](./kibana-plugin-server.coresetup.http.md) | {
createCookieSessionStorageFactory: HttpServiceSetup['createCookieSessionStorageFactory'];
registerOnPreAuth: HttpServiceSetup['registerOnPreAuth'];
registerAuth: HttpServiceSetup['registerAuth'];
registerOnPostAuth: HttpServiceSetup['registerOnPostAuth'];
basePath: HttpServiceSetup['basePath'];
isTlsEnabled: HttpServiceSetup['isTlsEnabled'];
registerRouteHandlerContext: <T extends keyof RequestHandlerContext>(name: T, provider: RequestHandlerContextProvider<T>) => RequestHandlerContextContainer;
createRouter: () => IRouter;
}
| |
diff --git a/docs/development/core/server/kibana-plugin-server.handlercontexttype.md b/docs/development/core/server/kibana-plugin-server.handlercontexttype.md
new file mode 100644
index 000000000000..e8f1f346e8b8
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.handlercontexttype.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HandlerContextType](./kibana-plugin-server.handlercontexttype.md)
+
+## HandlerContextType type
+
+Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-server.handlerfunction.md) to represent the type of the context.
+
+Signature:
+
+```typescript
+export declare type HandlerContextType> = T extends HandlerFunction ? U : never;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.handlerfunction.md b/docs/development/core/server/kibana-plugin-server.handlerfunction.md
new file mode 100644
index 000000000000..97acd37946fc
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.handlerfunction.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HandlerFunction](./kibana-plugin-server.handlerfunction.md)
+
+## HandlerFunction type
+
+A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-server.icontextcontainer.md)
+
+Signature:
+
+```typescript
+export declare type HandlerFunction = (context: T, ...args: any[]) => any;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.handlerparameters.md b/docs/development/core/server/kibana-plugin-server.handlerparameters.md
new file mode 100644
index 000000000000..3dd7998a71a1
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-server.handlerparameters.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HandlerParameters](./kibana-plugin-server.handlerparameters.md)
+
+## HandlerParameters type
+
+Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-server.handlerfunction.md), excluding the [HandlerContextType](./kibana-plugin-server.handlercontexttype.md).
+
+Signature:
+
+```typescript
+export declare type HandlerParameters> = T extends (context: any, ...args: infer U) => any ? U : never;
+```
diff --git a/docs/development/core/server/kibana-plugin-server.httpservicesetup.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.md
index 92bf158ad331..eec63cf5c809 100644
--- a/docs/development/core/server/kibana-plugin-server.httpservicesetup.md
+++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.md
@@ -10,6 +10,6 @@
```typescript
export declare type HttpServiceSetup = Omit & {
createRouter: (path: string, plugin?: PluginOpaqueId) => IRouter;
- registerRouteHandlerContext: (pluginOpaqueId: PluginOpaqueId, contextName: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer;
+ registerRouteHandlerContext: (pluginOpaqueId: PluginOpaqueId, contextName: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer;
};
```
diff --git a/docs/development/core/server/kibana-plugin-server.icontextcontainer.createhandler.md b/docs/development/core/server/kibana-plugin-server.icontextcontainer.createhandler.md
index c5549ab017e5..09a9e28d6d0f 100644
--- a/docs/development/core/server/kibana-plugin-server.icontextcontainer.createhandler.md
+++ b/docs/development/core/server/kibana-plugin-server.icontextcontainer.createhandler.md
@@ -9,7 +9,7 @@ Create a new handler function pre-wired to context for the plugin.
Signature:
```typescript
-createHandler(pluginOpaqueId: PluginOpaqueId, handler: IContextHandler): (...rest: THandlerParameters) => THandlerReturn extends Promise ? THandlerReturn : Promise;
+createHandler(pluginOpaqueId: PluginOpaqueId, handler: THandler): (...rest: HandlerParameters) => ShallowPromise>;
```
## Parameters
@@ -17,11 +17,11 @@ createHandler(pluginOpaqueId: PluginOpaqueId, handler: IContextHandlerPluginOpaqueId | The plugin opaque ID for the plugin that registers this handler. |
-| handler | IContextHandler<TContext, THandlerReturn, THandlerParameters>
| Handler function to pass context object to. |
+| handler | THandler
| Handler function to pass context object to. |
Returns:
-`(...rest: THandlerParameters) => THandlerReturn extends Promise ? THandlerReturn : Promise`
+`(...rest: HandlerParameters) => ShallowPromise>`
A function that takes `THandlerParameters`, calls `handler` with a new context, and returns a Promise of the `handler` return value.
diff --git a/docs/development/core/server/kibana-plugin-server.icontextcontainer.md b/docs/development/core/server/kibana-plugin-server.icontextcontainer.md
index 1ab699be105b..114da31442ff 100644
--- a/docs/development/core/server/kibana-plugin-server.icontextcontainer.md
+++ b/docs/development/core/server/kibana-plugin-server.icontextcontainer.md
@@ -9,7 +9,7 @@ An object that handles registration of context providers and configuring handler
Signature:
```typescript
-export interface IContextContainer
+export interface IContextContainer>
```
## Methods
diff --git a/docs/development/core/server/kibana-plugin-server.icontextcontainer.registercontext.md b/docs/development/core/server/kibana-plugin-server.icontextcontainer.registercontext.md
index 1a63f63dc91b..30d3fc154d1e 100644
--- a/docs/development/core/server/kibana-plugin-server.icontextcontainer.registercontext.md
+++ b/docs/development/core/server/kibana-plugin-server.icontextcontainer.registercontext.md
@@ -9,7 +9,7 @@ Register a new context provider.
Signature:
```typescript
-registerContext(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider): this;
+registerContext>(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider): this;
```
## Parameters
@@ -18,7 +18,7 @@ registerContext(pluginOpaqueId: PluginOpaqu
| --- | --- | --- |
| pluginOpaqueId | PluginOpaqueId
| The plugin opaque ID for the plugin that registers this context. |
| contextName | TContextName
| The key of the TContext
object this provider supplies the value for. |
-| provider | IContextProvider<TContext, TContextName, THandlerParameters>
| A [IContextProvider](./kibana-plugin-server.icontextprovider.md) to be called each time a new context is created. |
+| provider | IContextProvider<THandler, TContextName>
| A [IContextProvider](./kibana-plugin-server.icontextprovider.md) to be called each time a new context is created. |
Returns:
diff --git a/docs/development/core/server/kibana-plugin-server.icontexthandler.md b/docs/development/core/server/kibana-plugin-server.icontexthandler.md
deleted file mode 100644
index c1f5acc22734..000000000000
--- a/docs/development/core/server/kibana-plugin-server.icontexthandler.md
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [IContextHandler](./kibana-plugin-server.icontexthandler.md)
-
-## IContextHandler type
-
-A function registered by a plugin to perform some action.
-
-Signature:
-
-```typescript
-export declare type IContextHandler = (context: TContext, ...rest: THandlerParameters) => TReturn;
-```
-
-## Remarks
-
-A new `TContext` will be built for each handler before invoking.
-
diff --git a/docs/development/core/server/kibana-plugin-server.icontextprovider.md b/docs/development/core/server/kibana-plugin-server.icontextprovider.md
index 250e6a2be3f6..39ace8b9bc57 100644
--- a/docs/development/core/server/kibana-plugin-server.icontextprovider.md
+++ b/docs/development/core/server/kibana-plugin-server.icontextprovider.md
@@ -9,7 +9,7 @@ A function that returns a context value for a specific key of given context type
Signature:
```typescript
-export declare type IContextProvider, TContextName extends keyof TContext, TProviderParameters extends any[] = []> = (context: Partial, ...rest: TProviderParameters) => Promise | TContext[TContextName];
+export declare type IContextProvider, TContextName extends keyof HandlerContextType> = (context: Partial>, ...rest: HandlerParameters) => Promise[TContextName]> | HandlerContextType[TContextName];
```
## Remarks
diff --git a/docs/development/core/server/kibana-plugin-server.md b/docs/development/core/server/kibana-plugin-server.md
index d943228bbea0..3c01e7aeef32 100644
--- a/docs/development/core/server/kibana-plugin-server.md
+++ b/docs/development/core/server/kibana-plugin-server.md
@@ -116,11 +116,13 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [ElasticsearchClientConfig](./kibana-plugin-server.elasticsearchclientconfig.md) | |
| [GetAuthHeaders](./kibana-plugin-server.getauthheaders.md) | Get headers to authenticate a user against Elasticsearch. |
| [GetAuthState](./kibana-plugin-server.getauthstate.md) | Get authentication state for a request. Returned by auth
interceptor. |
+| [HandlerContextType](./kibana-plugin-server.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-server.handlerfunction.md) to represent the type of the context. |
+| [HandlerFunction](./kibana-plugin-server.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-server.icontextcontainer.md) |
+| [HandlerParameters](./kibana-plugin-server.handlerparameters.md) | Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-server.handlerfunction.md), excluding the [HandlerContextType](./kibana-plugin-server.handlercontexttype.md). |
| [Headers](./kibana-plugin-server.headers.md) | Http request headers to read. |
| [HttpResponsePayload](./kibana-plugin-server.httpresponsepayload.md) | Data send to the client as a response payload. |
| [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) | |
| [IBasePath](./kibana-plugin-server.ibasepath.md) | Access or manipulate the Kibana base path[BasePath](./kibana-plugin-server.basepath.md) |
-| [IContextHandler](./kibana-plugin-server.icontexthandler.md) | A function registered by a plugin to perform some action. |
| [IContextProvider](./kibana-plugin-server.icontextprovider.md) | A function that returns a context value for a specific key of given context type. |
| [IsAuthenticated](./kibana-plugin-server.isauthenticated.md) | Return authentication status for a request. |
| [KibanaResponseFactory](./kibana-plugin-server.kibanaresponsefactory.md) | Creates an object containing request response payload, HTTP headers, error details, and other data transmitted to the client. |
@@ -136,8 +138,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [RequestHandler](./kibana-plugin-server.requesthandler.md) | A function executed when route path matched requested resource path. Request handler is expected to return a result of one of [KibanaResponseFactory](./kibana-plugin-server.kibanaresponsefactory.md) functions. |
| [RequestHandlerContextContainer](./kibana-plugin-server.requesthandlercontextcontainer.md) | An object that handles registration of http request context providers. |
| [RequestHandlerContextProvider](./kibana-plugin-server.requesthandlercontextprovider.md) | Context provider for request handler. Extends request context object with provided functionality or data. |
-| [RequestHandlerParams](./kibana-plugin-server.requesthandlerparams.md) | Parameters passed to the request handler function. |
-| [RequestHandlerReturn](./kibana-plugin-server.requesthandlerreturn.md) | Expected outcome the request handler function. |
| [ResponseError](./kibana-plugin-server.responseerror.md) | Error message and optional data send to the client in case of error. |
| [ResponseErrorAttributes](./kibana-plugin-server.responseerrorattributes.md) | Additional data to provide error details. |
| [ResponseHeaders](./kibana-plugin-server.responseheaders.md) | Http response headers to set. |
diff --git a/docs/development/core/server/kibana-plugin-server.requesthandlercontextcontainer.md b/docs/development/core/server/kibana-plugin-server.requesthandlercontextcontainer.md
index afdb48859706..b76a9ce7d235 100644
--- a/docs/development/core/server/kibana-plugin-server.requesthandlercontextcontainer.md
+++ b/docs/development/core/server/kibana-plugin-server.requesthandlercontextcontainer.md
@@ -9,5 +9,5 @@ An object that handles registration of http request context providers.
Signature:
```typescript
-export declare type RequestHandlerContextContainer = IContextContainer, RequestHandlerParams>;
+export declare type RequestHandlerContextContainer = IContextContainer>;
```
diff --git a/docs/development/core/server/kibana-plugin-server.requesthandlercontextprovider.md b/docs/development/core/server/kibana-plugin-server.requesthandlercontextprovider.md
index 0d9cc6b70b80..ea7294b721aa 100644
--- a/docs/development/core/server/kibana-plugin-server.requesthandlercontextprovider.md
+++ b/docs/development/core/server/kibana-plugin-server.requesthandlercontextprovider.md
@@ -9,5 +9,5 @@ Context provider for request handler. Extends request context object with provid
Signature:
```typescript
-export declare type RequestHandlerContextProvider = IContextProvider;
+export declare type RequestHandlerContextProvider = IContextProvider, TContextName>;
```
diff --git a/docs/development/core/server/kibana-plugin-server.requesthandlerparams.md b/docs/development/core/server/kibana-plugin-server.requesthandlerparams.md
deleted file mode 100644
index 7f466845b4d4..000000000000
--- a/docs/development/core/server/kibana-plugin-server.requesthandlerparams.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [RequestHandlerParams](./kibana-plugin-server.requesthandlerparams.md)
-
-## RequestHandlerParams type
-
-Parameters passed to the request handler function.
-
-Signature:
-
-```typescript
-export declare type RequestHandlerParams = [KibanaRequest, KibanaResponseFactory];
-```
diff --git a/docs/development/core/server/kibana-plugin-server.requesthandlerreturn.md b/docs/development/core/server/kibana-plugin-server.requesthandlerreturn.md
deleted file mode 100644
index 6c01e21b6ecb..000000000000
--- a/docs/development/core/server/kibana-plugin-server.requesthandlerreturn.md
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [RequestHandlerReturn](./kibana-plugin-server.requesthandlerreturn.md)
-
-## RequestHandlerReturn type
-
-Expected outcome the request handler function.
-
-Signature:
-
-```typescript
-export declare type RequestHandlerReturn = KibanaResponse;
-```
diff --git a/docs/management/index-patterns.asciidoc b/docs/management/index-patterns.asciidoc
index 25c07dc50248..8d9ef515108e 100644
--- a/docs/management/index-patterns.asciidoc
+++ b/docs/management/index-patterns.asciidoc
@@ -35,8 +35,11 @@ image:management/index-patterns/images/rollup-index-pattern.png["Menu with rollu
{kib} makes it easy for you to create an index pattern by walking you through
the process. Just start typing in the *Index pattern* field, and {kib} looks for
-the names of {es} indices that match your input. If you want to include
-system indices in your search, toggle the switch in the upper right.
+the names of {es} indices that match your input. Make sure that the name of the
+index pattern is unique.
+
+If you want to include system indices in your search, toggle the switch in the
+upper right.
[role="screenshot"]
image:management/index-patterns/images/create-index-pattern.png["Create index pattern"]
diff --git a/docs/settings/monitoring-settings.asciidoc b/docs/settings/monitoring-settings.asciidoc
index 7330c7e144b6..97fb891c95bd 100644
--- a/docs/settings/monitoring-settings.asciidoc
+++ b/docs/settings/monitoring-settings.asciidoc
@@ -21,7 +21,7 @@ To control how data is collected from your {es} nodes, you configure
{ref}/monitoring-settings.html[`xpack.monitoring.collection`
settings] in `elasticsearch.yml`. To control how monitoring data is collected
from Logstash, you configure
-{logstash-ref}/configuring-logstash.html#monitoring-settings[`xpack.monitoring` settings]
+{logstash-ref}/monitoring-internal-collection.html#monitoring-settings[`xpack.monitoring` settings]
in `logstash.yml`.
For more information, see
diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc
index 5b3db22a39ea..091714cdd15e 100644
--- a/docs/setup/settings.asciidoc
+++ b/docs/setup/settings.asciidoc
@@ -271,7 +271,7 @@ identifies this Kibana instance.
`server.port:`:: *Default: 5601* Kibana is served by a back end server. This
setting specifies the port to use.
-`server.rewriteBasePath:`:: *Default: true* Specifies whether Kibana should
+`server.rewriteBasePath:`:: *Default: false* Specifies whether Kibana should
rewrite requests that are prefixed with `server.basePath` or require that they
are rewritten by your reverse proxy.
diff --git a/package.json b/package.json
index 8aff95748560..ef6aba59139f 100644
--- a/package.json
+++ b/package.json
@@ -105,7 +105,7 @@
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/register": "^7.5.5",
- "@elastic/charts": "^12.0.2",
+ "@elastic/charts": "^12.1.0",
"@elastic/datemath": "5.0.2",
"@elastic/eui": "14.4.0",
"@elastic/filesaver": "1.1.2",
@@ -195,7 +195,6 @@
"markdown-it": "^8.4.1",
"mini-css-extract-plugin": "0.8.0",
"minimatch": "^3.0.4",
- "mkdirp": "0.5.1",
"moment": "^2.20.1",
"moment-timezone": "^0.5.14",
"mustache": "2.3.2",
@@ -240,7 +239,7 @@
"style-loader": "0.23.1",
"symbol-observable": "^1.2.0",
"tar": "4.4.13",
- "terser-webpack-plugin": "^1.4.1",
+ "terser-webpack-plugin": "^2.1.2",
"thread-loader": "^2.1.3",
"tinygradient": "0.4.3",
"tinymath": "1.2.1",
@@ -250,7 +249,7 @@
"tslib": "^1.9.3",
"type-detect": "^4.0.8",
"ui-select": "0.19.8",
- "url-loader": "2.1.0",
+ "url-loader": "2.2.0",
"uuid": "3.3.2",
"val-loader": "^1.1.1",
"validate-npm-package-name": "2.2.2",
@@ -259,8 +258,8 @@
"vega-schema-url-parser": "1.0.0",
"vega-tooltip": "^0.9.14",
"vision": "^5.3.3",
- "webpack": "4.39.2",
- "webpack-merge": "4.2.1",
+ "webpack": "4.41.0",
+ "webpack-merge": "4.2.2",
"whatwg-fetch": "^3.0.0",
"yauzl": "2.10.0"
},
@@ -322,7 +321,6 @@
"@types/lru-cache": "^5.1.0",
"@types/markdown-it": "^0.0.7",
"@types/minimatch": "^2.0.29",
- "@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.7",
"@types/moment-timezone": "^0.5.8",
"@types/mustache": "^0.8.31",
@@ -348,6 +346,7 @@
"@types/supertest": "^2.0.5",
"@types/type-detect": "^4.0.1",
"@types/uuid": "^3.4.4",
+ "@types/vinyl-fs": "^2.4.11",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "1.13.0",
"@typescript-eslint/parser": "1.13.0",
@@ -360,7 +359,7 @@
"chai": "3.5.0",
"chance": "1.0.18",
"cheerio": "0.22.0",
- "chokidar": "3.0.2",
+ "chokidar": "3.2.1",
"chromedriver": "^77.0.0",
"classnames": "2.2.6",
"dedent": "^0.7.0",
@@ -399,6 +398,7 @@
"gulp-babel": "^8.0.0",
"gulp-sourcemaps": "2.6.5",
"has-ansi": "^3.0.0",
+ "iedriver": "^3.14.1",
"image-diff": "1.6.3",
"intl-messageformat-parser": "^1.4.0",
"is-path-inside": "^2.1.0",
diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js
index c3e8f5601e47..4412ce81368a 100644
--- a/packages/eslint-config-kibana/.eslintrc.js
+++ b/packages/eslint-config-kibana/.eslintrc.js
@@ -22,6 +22,11 @@ module.exports = {
from: 'expect.js',
to: '@kbn/expect',
},
+ {
+ from: 'mkdirp',
+ to: false,
+ disallowedMessage: `Don't use 'mkdirp', use the new { recursive: true } option of Fs.mkdir instead`
+ },
{
from: 'x-pack',
toRelative: 'x-pack',
diff --git a/packages/kbn-es/package.json b/packages/kbn-es/package.json
index 1064d719af83..5521d57c22e8 100644
--- a/packages/kbn-es/package.json
+++ b/packages/kbn-es/package.json
@@ -5,7 +5,7 @@
"license": "Apache-2.0",
"private": true,
"dependencies": {
- "@elastic/elasticsearch": "^7.3.0",
+ "@elastic/elasticsearch": "^7.4.0",
"@kbn/dev-utils": "1.0.0",
"abort-controller": "^2.0.3",
"chalk": "^2.4.2",
@@ -14,7 +14,6 @@
"execa": "^1.0.0",
"getopts": "^2.2.4",
"glob": "^7.1.2",
- "mkdirp": "^0.5.1",
"node-fetch": "^2.6.0",
"simple-git": "^1.91.0",
"tar-fs": "^1.16.3",
diff --git a/packages/kbn-es/src/artifact.js b/packages/kbn-es/src/artifact.js
index 3398663a2acf..19d95e82fe48 100644
--- a/packages/kbn-es/src/artifact.js
+++ b/packages/kbn-es/src/artifact.js
@@ -22,7 +22,6 @@ const AbortController = require('abort-controller');
const fs = require('fs');
const { promisify } = require('util');
const { pipeline, Transform } = require('stream');
-const mkdirp = require('mkdirp');
const chalk = require('chalk');
const { createHash } = require('crypto');
const path = require('path');
@@ -285,7 +284,8 @@ exports.Artifact = class Artifact {
let first500Bytes = Buffer.alloc(0);
let contentLength = 0;
- mkdirp.sync(path.dirname(tmpPath));
+ fs.mkdirSync(path.dirname(tmpPath), { recursive: true });
+
await asyncPipeline(
resp.body,
new Transform({
diff --git a/packages/kbn-es/src/cli_commands/build_snapshots.js b/packages/kbn-es/src/cli_commands/build_snapshots.js
index eca904c144af..7c2dcff4aa79 100644
--- a/packages/kbn-es/src/cli_commands/build_snapshots.js
+++ b/packages/kbn-es/src/cli_commands/build_snapshots.js
@@ -24,7 +24,6 @@ const { pipeline, Transform } = require('stream');
const Fs = require('fs');
const getopts = require('getopts');
-const mkdirp = require('mkdirp');
const del = require('del');
const { buildSnapshot, log } = require('../utils');
@@ -49,7 +48,7 @@ exports.run = async (defaults = {}) => {
const outputDir = resolve(process.cwd(), options.output);
del.sync(outputDir);
- mkdirp.sync(outputDir);
+ Fs.mkdirSync(outputDir, { recursive: true });
for (const license of ['oss', 'trial']) {
for (const platform of ['darwin', 'win32', 'linux']) {
diff --git a/packages/kbn-es/src/utils/cache.js b/packages/kbn-es/src/utils/cache.js
index 01f4b9f374c9..a8bc663ecf09 100644
--- a/packages/kbn-es/src/utils/cache.js
+++ b/packages/kbn-es/src/utils/cache.js
@@ -18,7 +18,6 @@
*/
const fs = require('fs');
-const mkdirp = require('mkdirp');
const path = require('path');
exports.readMeta = function readMeta(file) {
@@ -48,6 +47,6 @@ exports.writeMeta = function readMeta(file, details = {}) {
...details,
};
- mkdirp.sync(path.dirname(file));
+ fs.mkdirSync(path.dirname(file), { recursive: true });
fs.writeFileSync(`${file}.meta`, JSON.stringify(meta, null, 2));
};
diff --git a/packages/kbn-es/src/utils/decompress.js b/packages/kbn-es/src/utils/decompress.js
index a0e0d832ff73..b4299594c506 100644
--- a/packages/kbn-es/src/utils/decompress.js
+++ b/packages/kbn-es/src/utils/decompress.js
@@ -21,7 +21,6 @@ const fs = require('fs');
const path = require('path');
const yauzl = require('yauzl');
-const mkdirp = require('mkdirp');
const zlib = require('zlib');
const tarFs = require('tar-fs');
@@ -38,7 +37,7 @@ function decompressTarball(archive, dirPath) {
}
function decompressZip(input, output) {
- mkdirp.sync(output);
+ fs.mkdirSync(output, { recursive: true });
return new Promise((resolve, reject) => {
yauzl.open(input, { lazyEntries: true }, (err, zipfile) => {
if (err) {
@@ -63,7 +62,7 @@ function decompressZip(input, output) {
const fileName = path.resolve(output, zipPath);
if (/\/$/.test(entry.fileName)) {
- mkdirp.sync(fileName);
+ fs.mkdirSync(fileName, { recursive: true });
zipfile.readEntry();
} else {
// file entry
diff --git a/packages/kbn-es/src/utils/decompress.test.js b/packages/kbn-es/src/utils/decompress.test.js
index ff36e9521257..a267950abc7a 100644
--- a/packages/kbn-es/src/utils/decompress.test.js
+++ b/packages/kbn-es/src/utils/decompress.test.js
@@ -20,7 +20,6 @@
const { decompress } = require('./decompress');
const fs = require('fs');
const path = require('path');
-const mkdirp = require('mkdirp');
const del = require('del');
const os = require('os');
@@ -34,9 +33,9 @@ const zipSnapshot = path.resolve(dataFolder, 'snapshot.zip');
const tarGzSnapshot = path.resolve(dataFolder, 'snapshot.tar.gz');
beforeEach(() => {
- mkdirp.sync(tmpFolder);
- mkdirp.sync(dataFolder);
- mkdirp.sync(esFolder);
+ fs.mkdirSync(tmpFolder, { recursive: true });
+ fs.mkdirSync(dataFolder, { recursive: true });
+ fs.mkdirSync(esFolder, { recursive: true });
fs.copyFileSync(path.resolve(fixturesFolder, 'snapshot.zip'), zipSnapshot);
fs.copyFileSync(path.resolve(fixturesFolder, 'snapshot.tar.gz'), tarGzSnapshot);
diff --git a/packages/kbn-es/src/utils/extract_config_files.js b/packages/kbn-es/src/utils/extract_config_files.js
index 7ad75dcbbf34..a8a44a149e9b 100644
--- a/packages/kbn-es/src/utils/extract_config_files.js
+++ b/packages/kbn-es/src/utils/extract_config_files.js
@@ -19,7 +19,6 @@
const path = require('path');
const fs = require('fs');
-const mkdirp = require('mkdirp');
/**
* Copies config references to an absolute path to
@@ -62,7 +61,7 @@ function copyFileSync(src, dest) {
const destPath = path.dirname(dest);
if (!fs.existsSync(destPath)) {
- mkdirp(destPath);
+ fs.mkdirSync(destPath, { recursive: true });
}
fs.writeFileSync(dest, fs.readFileSync(src));
diff --git a/packages/kbn-eslint-import-resolver-kibana/package.json b/packages/kbn-eslint-import-resolver-kibana/package.json
index 14a922492426..9fae27011767 100755
--- a/packages/kbn-eslint-import-resolver-kibana/package.json
+++ b/packages/kbn-eslint-import-resolver-kibana/package.json
@@ -16,6 +16,6 @@
"glob-all": "^3.1.0",
"lru-cache": "^4.1.5",
"resolve": "^1.7.1",
- "webpack": "^4.39.2"
+ "webpack": "^4.41.0"
}
}
diff --git a/packages/kbn-eslint-plugin-eslint/rules/module_migration.js b/packages/kbn-eslint-plugin-eslint/rules/module_migration.js
index c5f2aff9bfdc..8119d338ee53 100644
--- a/packages/kbn-eslint-plugin-eslint/rules/module_migration.js
+++ b/packages/kbn-eslint-plugin-eslint/rules/module_migration.js
@@ -31,6 +31,14 @@ function checkModuleNameNode(context, mappings, node) {
let newSource;
+ if (mapping.to === false) {
+ context.report({
+ message: mapping.disallowedMessage || `Importing "${mapping.from}" is not allowed`,
+ loc: node.loc,
+ });
+ return;
+ }
+
// support for toRelative added to migrate away from X-Pack being bundled
// within node modules. after that migration, this can be removed.
if (mapping.toRelative) {
@@ -66,11 +74,21 @@ module.exports = {
type: 'string',
},
to: {
- type: 'string',
+ anyOf: [
+ {
+ type: 'string',
+ },
+ {
+ const: false,
+ },
+ ],
},
toRelative: {
type: 'string',
},
+ disallowedMessage: {
+ type: 'string',
+ },
},
anyOf: [
{
diff --git a/packages/kbn-interpreter/package.json b/packages/kbn-interpreter/package.json
index a9b30c17e292..f2aa2e1ced9c 100644
--- a/packages/kbn-interpreter/package.json
+++ b/packages/kbn-interpreter/package.json
@@ -30,8 +30,8 @@
"sass-loader": "^7.3.1",
"style-loader": "0.23.1",
"supports-color": "^7.0.0",
- "url-loader": "2.1.0",
- "webpack": "4.39.2",
- "webpack-cli": "^3.3.7"
+ "url-loader": "2.2.0",
+ "webpack": "4.41.0",
+ "webpack-cli": "^3.3.9"
}
}
diff --git a/packages/kbn-plugin-helpers/lib/index.d.ts b/packages/kbn-plugin-helpers/lib/index.d.ts
new file mode 100644
index 000000000000..1515bf6b84bf
--- /dev/null
+++ b/packages/kbn-plugin-helpers/lib/index.d.ts
@@ -0,0 +1,26 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+export function babelRegister(): void;
+export function resolveKibanaPath(path: string): string;
+export function readFtrConfigFile(path: string): any;
+export function run(
+ task: 'build' | 'start' | 'testAll' | 'testBrowser' | 'testServer' | 'postinstall',
+ options: any
+): Promise;
diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json
index 47af4e288afa..215963c0769b 100644
--- a/packages/kbn-plugin-helpers/package.json
+++ b/packages/kbn-plugin-helpers/package.json
@@ -21,7 +21,7 @@
"globby": "^8.0.1",
"gulp-babel": "^8.0.0",
"gulp-rename": "1.4.0",
- "gulp-zip": "4.2.0",
+ "gulp-zip": "5.0.1",
"inquirer": "^1.2.2",
"minimatch": "^3.0.4",
"node-sass": "^4.9.4",
diff --git a/packages/kbn-plugin-helpers/tsconfig.json b/packages/kbn-plugin-helpers/tsconfig.json
new file mode 100644
index 000000000000..f5559aa7290c
--- /dev/null
+++ b/packages/kbn-plugin-helpers/tsconfig.json
@@ -0,0 +1,4 @@
+{
+ "extends": "../../tsconfig.json",
+ "include": ["lib/index.d.ts"]
+}
diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js
index b054e21c856a..5d2f5c786f2c 100644
--- a/packages/kbn-pm/dist/index.js
+++ b/packages/kbn-pm/dist/index.js
@@ -2697,11 +2697,11 @@ async function linkProjectExecutables(projectsByName, projectGraph) {
"use strict";
__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unlink", function() { return unlink; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyDirectory", function() { return copyDirectory; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chmod", function() { return chmod; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readFile", function() { return readFile; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chmod", function() { return chmod; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mkdirp", function() { return mkdirp; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unlink", function() { return unlink; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyDirectory", function() { return copyDirectory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSymlink", function() { return isSymlink; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDirectory", function() { return isDirectory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFile", function() { return isFile; });
@@ -2710,14 +2710,12 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cmd_shim__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var mkdirp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31);
-/* harmony import */ var mkdirp__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(mkdirp__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33);
-/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(ncp__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16);
-/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29);
-/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33);
+/* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(ncp__WEBPACK_IMPORTED_MODULE_2__);
+/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
+/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
+/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29);
+/* harmony import */ var util__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_4__);
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
@@ -2741,16 +2739,17 @@ __webpack_require__.r(__webpack_exports__);
-
-const lstat = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.lstat);
-const readFile = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.readFile);
-const symlink = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.symlink);
-const chmod = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.chmod);
-const cmdShim = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(cmd_shim__WEBPACK_IMPORTED_MODULE_0___default.a);
-const mkdirp = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(mkdirp__WEBPACK_IMPORTED_MODULE_2___default.a);
-const unlink = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.unlink);
-const copyDirectory = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(ncp__WEBPACK_IMPORTED_MODULE_3__["ncp"]);
-
+const lstat = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.lstat);
+const readFile = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.readFile);
+const symlink = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.symlink);
+const chmod = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.chmod);
+const cmdShim = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(cmd_shim__WEBPACK_IMPORTED_MODULE_0___default.a);
+const mkdir = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.mkdir);
+const mkdirp = async path => await mkdir(path, {
+ recursive: true
+});
+const unlink = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.unlink);
+const copyDirectory = Object(util__WEBPACK_IMPORTED_MODULE_4__["promisify"])(ncp__WEBPACK_IMPORTED_MODULE_2__["ncp"]);
async function statTest(path, block) {
try {
@@ -2808,7 +2807,7 @@ async function createSymlink(src, dest, type) {
}
} else {
const posixType = type === 'exec' ? 'file' : type;
- const relativeSource = Object(path__WEBPACK_IMPORTED_MODULE_4__["relative"])(Object(path__WEBPACK_IMPORTED_MODULE_4__["dirname"])(dest), src);
+ const relativeSource = Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(Object(path__WEBPACK_IMPORTED_MODULE_3__["dirname"])(dest), src);
await forceCreate(relativeSource, dest, posixType);
}
}
diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json
index a3d3baed3750..8480e74ceb3a 100644
--- a/packages/kbn-pm/package.json
+++ b/packages/kbn-pm/package.json
@@ -26,7 +26,6 @@
"@types/indent-string": "^3.0.0",
"@types/lodash.clonedeepwith": "^4.5.3",
"@types/log-symbols": "^2.0.0",
- "@types/mkdirp": "^0.5.2",
"@types/ncp": "^2.0.1",
"@types/node": "^10.12.27",
"@types/ora": "^1.3.5",
@@ -50,10 +49,9 @@
"indent-string": "^3.2.0",
"lodash.clonedeepwith": "^4.5.0",
"log-symbols": "^2.2.0",
- "mkdirp": "^0.5.1",
"ncp": "^2.0.0",
"ora": "^1.4.0",
- "prettier": "^1.14.3",
+ "prettier": "^1.18.2",
"read-pkg": "^5.2.0",
"rxjs": "^6.2.1",
"spawn-sync": "^1.0.15",
@@ -63,8 +61,8 @@
"tempy": "^0.3.0",
"typescript": "3.5.3",
"unlazy-loader": "^0.1.3",
- "webpack": "^4.39.2",
- "webpack-cli": "^3.3.7",
+ "webpack": "^4.41.0",
+ "webpack-cli": "^3.3.9",
"wrap-ansi": "^3.0.1",
"write-pkg": "^4.0.0"
},
diff --git a/packages/kbn-pm/src/utils/fs.ts b/packages/kbn-pm/src/utils/fs.ts
index 8ccaca29f97e..9484c3a61e60 100644
--- a/packages/kbn-pm/src/utils/fs.ts
+++ b/packages/kbn-pm/src/utils/fs.ts
@@ -19,22 +19,20 @@
import cmdShimCb from 'cmd-shim';
import fs from 'fs';
-import mkdirpCb from 'mkdirp';
import { ncp } from 'ncp';
import { dirname, relative } from 'path';
import { promisify } from 'util';
const lstat = promisify(fs.lstat);
-const readFile = promisify(fs.readFile);
+export const readFile = promisify(fs.readFile);
const symlink = promisify(fs.symlink);
-const chmod = promisify(fs.chmod);
+export const chmod = promisify(fs.chmod);
const cmdShim = promisify(cmdShimCb);
-const mkdirp = promisify(mkdirpCb);
+const mkdir = promisify(fs.mkdir);
+export const mkdirp = async (path: string) => await mkdir(path, { recursive: true });
export const unlink = promisify(fs.unlink);
export const copyDirectory = promisify(ncp);
-export { chmod, readFile, mkdirp };
-
async function statTest(path: string, block: (stats: fs.Stats) => boolean) {
try {
return block(await lstat(path));
diff --git a/packages/kbn-spec-to-console/package.json b/packages/kbn-spec-to-console/package.json
index 674a801e9286..2e5f897894a9 100644
--- a/packages/kbn-spec-to-console/package.json
+++ b/packages/kbn-spec-to-console/package.json
@@ -18,7 +18,7 @@
"homepage": "https://github.com/jbudz/spec-to-console#readme",
"devDependencies": {
"jest": "^24.9.0",
- "prettier": "^1.14.3"
+ "prettier": "^1.18.2"
},
"dependencies": {
"commander": "^3.0.0",
diff --git a/src/legacy/core_plugins/vis_type_timeseries/common/es_types.js b/packages/kbn-test/index.d.ts
similarity index 86%
rename from src/legacy/core_plugins/vis_type_timeseries/common/es_types.js
rename to packages/kbn-test/index.d.ts
index 7e6a53753fae..aa55df9215c2 100644
--- a/src/legacy/core_plugins/vis_type_timeseries/common/es_types.js
+++ b/packages/kbn-test/index.d.ts
@@ -17,10 +17,4 @@
* under the License.
*/
-export const ES_TYPES = {
- NUMBER: 'number',
- STRING: 'string',
- KEYWORD: 'keyword',
- TEXT: 'text',
- DATE: 'date',
-};
+export * from './src/index';
diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json
index 6891f01bae2a..d02b2cf41d3f 100644
--- a/packages/kbn-test/package.json
+++ b/packages/kbn-test/package.json
@@ -21,7 +21,7 @@
"getopts": "^2.2.4",
"glob": "^7.1.2",
"rxjs": "^6.2.1",
- "tar-fs": "^1.16.2",
+ "tar-fs": "^1.16.3",
"tmp": "^0.1.0",
"zlib": "^1.0.5"
}
diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts b/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts
index d9cf282d8f4b..52672d5f039f 100644
--- a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts
+++ b/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts
@@ -134,7 +134,7 @@ export const schema = Joi.object()
browser: Joi.object()
.keys({
type: Joi.string()
- .valid('chrome', 'firefox')
+ .valid('chrome', 'firefox', 'ie')
.default('chrome'),
logPollingMs: Joi.number().default(100),
diff --git a/packages/kbn-test/src/index.js b/packages/kbn-test/src/index.ts
similarity index 87%
rename from packages/kbn-test/src/index.js
rename to packages/kbn-test/src/index.ts
index 8313d0c7334b..9167fd190dc8 100644
--- a/packages/kbn-test/src/index.js
+++ b/packages/kbn-test/src/index.ts
@@ -17,20 +17,28 @@
* under the License.
*/
+// @ts-ignore not typed yet
export { runTestsCli, startServersCli } from './functional_tests/cli';
+// @ts-ignore not typed yet
export { runTests, startServers } from './functional_tests/tasks';
+// @ts-ignore not typed yet
export { OPTIMIZE_BUNDLE_DIR, KIBANA_ROOT } from './functional_tests/lib/paths';
+// @ts-ignore not typed yet
export { esTestConfig, createEsTestCluster } from './es';
+// @ts-ignore not typed yet
export { kbnTestConfig, kibanaServerTestUser, kibanaTestUser, adminTestUser } from './kbn';
+// @ts-ignore not typed yet
export { setupUsers, DEFAULT_SUPERUSER_PASS } from './functional_tests/lib/auth';
+// @ts-ignore not typed yet
export { readConfigFile } from './functional_test_runner/lib/config/read_config_file';
+// @ts-ignore not typed yet
export { runFtrCli } from './functional_test_runner/cli';
export {
diff --git a/packages/kbn-test/src/mocha/index.js b/packages/kbn-test/src/mocha/index.ts
similarity index 88%
rename from packages/kbn-test/src/mocha/index.js
rename to packages/kbn-test/src/mocha/index.ts
index f18282d4a8b1..99c0f6f4230b 100644
--- a/packages/kbn-test/src/mocha/index.js
+++ b/packages/kbn-test/src/mocha/index.ts
@@ -17,8 +17,13 @@
* under the License.
*/
+// @ts-ignore not typed yet
export { createAutoJUnitReporter } from './auto_junit_reporter';
+// @ts-ignore not typed yet
export { setupJUnitReportGeneration } from './junit_report_generation';
+// @ts-ignore not typed yet
export { runMochaCli } from './run_mocha_cli';
+// @ts-ignore not typed yet
export { recordLog, snapshotLogsForRunnable } from './log_cache';
+// @ts-ignore not typed yet
export { escapeCdata } from './xml';
diff --git a/packages/kbn-test/src/mocha/junit_report_generation.js b/packages/kbn-test/src/mocha/junit_report_generation.js
index 3463c738df5a..54df5c5f3349 100644
--- a/packages/kbn-test/src/mocha/junit_report_generation.js
+++ b/packages/kbn-test/src/mocha/junit_report_generation.js
@@ -18,10 +18,9 @@
*/
import { resolve, dirname, relative } from 'path';
-import { writeFileSync } from 'fs';
+import { writeFileSync, mkdirSync } from 'fs';
import { inspect } from 'util';
-import mkdirp from 'mkdirp';
import xmlBuilder from 'xmlbuilder';
import { getSnapshotOfRunnableLogs } from './log_cache';
@@ -150,7 +149,7 @@ export function setupJUnitReportGeneration(runner, options = {}) {
spacebeforeslash: '',
});
- mkdirp.sync(dirname(reportPath));
+ mkdirSync(dirname(reportPath), { recursive: true });
writeFileSync(reportPath, reportXML, 'utf8');
});
}
diff --git a/packages/kbn-test/tsconfig.json b/packages/kbn-test/tsconfig.json
index 825fddc0bdcc..fdb53de52687 100644
--- a/packages/kbn-test/tsconfig.json
+++ b/packages/kbn-test/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"include": [
"types/**/*",
- "src/functional_test_runner/**/*",
- "src/mocha/xml.ts"
+ "src/**/*",
+ "index.d.ts"
]
}
diff --git a/packages/kbn-ui-framework/package.json b/packages/kbn-ui-framework/package.json
index bd9658934100..cb4d2e3cadf9 100644
--- a/packages/kbn-ui-framework/package.json
+++ b/packages/kbn-ui-framework/package.json
@@ -37,7 +37,7 @@
"babel-loader": "^8.0.6",
"brace": "0.11.1",
"chalk": "^2.4.2",
- "chokidar": "3.0.2",
+ "chokidar": "3.2.1",
"core-js": "^3.2.1",
"css-loader": "^2.1.1",
"expose-loader": "^0.7.5",
@@ -68,8 +68,8 @@
"sass-loader": "^7.3.1",
"sinon": "^7.4.2",
"style-loader": "^0.23.1",
- "webpack": "^4.39.2",
- "webpack-dev-server": "^3.8.0",
+ "webpack": "^4.41.0",
+ "webpack-dev-server": "^3.8.2",
"yeoman-generator": "1.1.1",
"yo": "2.0.6"
}
diff --git a/renovate.json5 b/renovate.json5
index e5dd29aa6319..e8fd7b6ceda5 100644
--- a/renovate.json5
+++ b/renovate.json5
@@ -67,6 +67,17 @@
'(\\b|_)jest(\\b|_)',
],
},
+ {
+ groupSlug: '@elastic/charts',
+ groupName: '@elastic/charts related packages',
+ packageNames: [
+ '@elastic/charts',
+ '@types/elastic__charts',
+ ],
+ reviewers: [
+ 'markov00',
+ ],
+ },
{
groupSlug: 'mocha',
groupName: 'mocha related packages',
@@ -248,6 +259,18 @@
'(\\b|_)storybook(\\b|_)',
],
},
+ {
+ groupSlug: 'typescript',
+ groupName: 'typescript related packages',
+ packagePatterns: [
+ '(\\b|_)ts(\\b|_)',
+ '(\\b|_)typescript(\\b|_)',
+ ],
+ packageNames: [
+ 'tslib',
+ '@types/tslib',
+ ],
+ },
{
groupSlug: 'json-stable-stringify',
groupName: 'json-stable-stringify related packages',
@@ -464,14 +487,6 @@
'@types/minimatch',
],
},
- {
- groupSlug: 'mkdirp',
- groupName: 'mkdirp related packages',
- packageNames: [
- 'mkdirp',
- '@types/mkdirp',
- ],
- },
{
groupSlug: 'mustache',
groupName: 'mustache related packages',
@@ -592,6 +607,14 @@
'@types/uuid',
],
},
+ {
+ groupSlug: 'vinyl-fs',
+ groupName: 'vinyl-fs related packages',
+ packageNames: [
+ 'vinyl-fs',
+ '@types/vinyl-fs',
+ ],
+ },
{
groupSlug: 'zen-observable',
groupName: 'zen-observable related packages',
@@ -624,6 +647,14 @@
'@types/color',
],
},
+ {
+ groupSlug: 'fancy-log',
+ groupName: 'fancy-log related packages',
+ packageNames: [
+ 'fancy-log',
+ '@types/fancy-log',
+ ],
+ },
{
groupSlug: 'file-saver',
groupName: 'file-saver related packages',
@@ -632,6 +663,14 @@
'@types/file-saver',
],
},
+ {
+ groupSlug: 'getos',
+ groupName: 'getos related packages',
+ packageNames: [
+ 'getos',
+ '@types/getos',
+ ],
+ },
{
groupSlug: 'git-url-parse',
groupName: 'git-url-parse related packages',
diff --git a/src/cli/serve/integration_tests/reload_logging_config.test.js b/src/cli/serve/integration_tests/reload_logging_config.test.js
index 206118d2d1be..8e8bdb15abc6 100644
--- a/src/cli/serve/integration_tests/reload_logging_config.test.js
+++ b/src/cli/serve/integration_tests/reload_logging_config.test.js
@@ -21,7 +21,6 @@ import { spawn } from 'child_process';
import fs from 'fs';
import path from 'path';
import os from 'os';
-import mkdirp from 'mkdirp';
import rimraf from 'rimraf';
import { safeDump } from 'js-yaml';
@@ -59,7 +58,7 @@ describe('Server logging configuration', function () {
isJson = true;
setLoggingJson(true);
- mkdirp.sync(tempDir);
+ fs.mkdirSync(tempDir, { recursive: true });
});
afterEach(() => {
diff --git a/src/cli_plugin/install/download.test.js b/src/cli_plugin/install/download.test.js
index 97586f962737..9de6491f3c95 100644
--- a/src/cli_plugin/install/download.test.js
+++ b/src/cli_plugin/install/download.test.js
@@ -21,7 +21,7 @@ import sinon from 'sinon';
import nock from 'nock';
import glob from 'glob-all';
import rimraf from 'rimraf';
-import mkdirp from 'mkdirp';
+import Fs from 'fs';
import Logger from '../lib/logger';
import { UnsupportedProtocolError } from '../lib/errors';
import { download, _downloadSingle, _getFilePath, _checkFilePathDeprecation } from './download';
@@ -64,7 +64,7 @@ describe('kibana cli', function () {
sinon.stub(logger, 'log');
sinon.stub(logger, 'error');
rimraf.sync(testWorkingPath);
- mkdirp.sync(testWorkingPath);
+ Fs.mkdirSync(testWorkingPath, { recursive: true });
});
afterEach(function () {
diff --git a/src/cli_plugin/install/install.js b/src/cli_plugin/install/install.js
index 57d2d485b9dd..10816591f7d7 100644
--- a/src/cli_plugin/install/install.js
+++ b/src/cli_plugin/install/install.js
@@ -17,8 +17,10 @@
* under the License.
*/
+import Fs from 'fs';
+import { promisify } from 'util';
+
import { download } from './download';
-import Promise from 'bluebird';
import path from 'path';
import { cleanPrevious, cleanArtifacts } from './cleanup';
import { extract, getPackData } from './pack';
@@ -27,9 +29,8 @@ import { sync as rimrafSync } from 'rimraf';
import { errorIfXPackInstall } from '../lib/error_if_x_pack';
import { existingInstall, assertVersion } from './kibana';
import { prepareExternalProjectDependencies } from '@kbn/pm';
-import mkdirp from 'mkdirp';
-const mkdir = Promise.promisify(mkdirp);
+const mkdir = promisify(Fs.mkdir);
export default async function install(settings, logger) {
try {
@@ -37,7 +38,7 @@ export default async function install(settings, logger) {
await cleanPrevious(settings, logger);
- await mkdir(settings.workingPath);
+ await mkdir(settings.workingPath, { recursive: true });
await download(settings, logger);
diff --git a/src/cli_plugin/install/kibana.test.js b/src/cli_plugin/install/kibana.test.js
index 4a4ca6ebe303..64de96b34e80 100644
--- a/src/cli_plugin/install/kibana.test.js
+++ b/src/cli_plugin/install/kibana.test.js
@@ -27,7 +27,6 @@ import sinon from 'sinon';
import Logger from '../lib/logger';
import { join } from 'path';
import rimraf from 'rimraf';
-import mkdirp from 'mkdirp';
import fs from 'fs';
import { existingInstall, assertVersion } from './kibana';
@@ -55,7 +54,7 @@ describe('kibana cli', function () {
beforeEach(function () {
rimraf.sync(testWorkingPath);
- mkdirp.sync(testWorkingPath);
+ fs.mkdirSync(testWorkingPath, { recursive: true });
sinon.stub(logger, 'log');
sinon.stub(logger, 'error');
});
diff --git a/src/cli_plugin/install/pack.test.js b/src/cli_plugin/install/pack.test.js
index bc854f66a692..1bc2504397fb 100644
--- a/src/cli_plugin/install/pack.test.js
+++ b/src/cli_plugin/install/pack.test.js
@@ -17,10 +17,11 @@
* under the License.
*/
+import Fs from 'fs';
+
import sinon from 'sinon';
import glob from 'glob-all';
import rimraf from 'rimraf';
-import mkdirp from 'mkdirp';
import Logger from '../lib/logger';
import { extract, getPackData } from './pack';
import { _downloadSingle } from './download';
@@ -58,7 +59,7 @@ describe('kibana cli', function () {
logger = new Logger(settings);
sinon.stub(logger, 'log');
sinon.stub(logger, 'error');
- mkdirp.sync(testWorkingPath);
+ Fs.mkdirSync(testWorkingPath, { recursive: true });
});
afterEach(function () {
diff --git a/src/cli_plugin/install/zip.js b/src/cli_plugin/install/zip.js
index 7f928275525d..1d5d49b6c63b 100644
--- a/src/cli_plugin/install/zip.js
+++ b/src/cli_plugin/install/zip.js
@@ -19,8 +19,7 @@
import yauzl from 'yauzl';
import path from 'path';
-import mkdirp from 'mkdirp';
-import { createWriteStream } from 'fs';
+import { createWriteStream, mkdir } from 'fs';
import { get } from 'lodash';
/**
@@ -112,7 +111,7 @@ export function extractArchive(archive, targetDir, extractPath) {
}
if (_isDirectory(fileName)) {
- mkdirp(fileName, function (err) {
+ mkdir(fileName, { recursive: true }, function (err) {
if (err) {
return reject(err);
}
@@ -127,7 +126,7 @@ export function extractArchive(archive, targetDir, extractPath) {
}
// ensure parent directory exists
- mkdirp(path.dirname(fileName), function (err) {
+ mkdir(path.dirname(fileName), { recursive: true }, function (err) {
if (err) {
return reject(err);
}
diff --git a/src/cli_plugin/list/list.test.js b/src/cli_plugin/list/list.test.js
index c72f6c330543..425a6bee5394 100644
--- a/src/cli_plugin/list/list.test.js
+++ b/src/cli_plugin/list/list.test.js
@@ -19,16 +19,15 @@
import sinon from 'sinon';
import rimraf from 'rimraf';
-import mkdirp from 'mkdirp';
import Logger from '../lib/logger';
import list from './list';
import { join } from 'path';
-import { writeFileSync, appendFileSync } from 'fs';
+import { writeFileSync, appendFileSync, mkdirSync } from 'fs';
function createPlugin(name, version, pluginBaseDir) {
const pluginDir = join(pluginBaseDir, name);
- mkdirp.sync(pluginDir);
+ mkdirSync(pluginDir, { recursive: true });
appendFileSync(join(pluginDir, 'package.json'), '{"version": "' + version + '"}');
}
@@ -48,7 +47,7 @@ describe('kibana cli', function () {
sinon.stub(logger, 'log');
sinon.stub(logger, 'error');
rimraf.sync(pluginDir);
- mkdirp.sync(pluginDir);
+ mkdirSync(pluginDir, { recursive: true });
});
afterEach(function () {
@@ -97,7 +96,7 @@ describe('kibana cli', function () {
it('list should throw an exception if a plugin does not have a package.json', function () {
createPlugin('plugin1', '1.0.0', pluginDir);
- mkdirp.sync(join(pluginDir, 'empty-plugin'));
+ mkdirSync(join(pluginDir, 'empty-plugin'), { recursive: true });
expect(function () {
list(settings, logger);
@@ -107,7 +106,7 @@ describe('kibana cli', function () {
it('list should throw an exception if a plugin have an empty package.json', function () {
createPlugin('plugin1', '1.0.0', pluginDir);
const invalidPluginDir = join(pluginDir, 'invalid-plugin');
- mkdirp.sync(invalidPluginDir);
+ mkdirSync(invalidPluginDir, { recursive: true });
appendFileSync(join(invalidPluginDir, 'package.json'), '');
expect(function () {
diff --git a/src/cli_plugin/remove/remove.test.js b/src/cli_plugin/remove/remove.test.js
index 971881dd0b87..5d936d027852 100644
--- a/src/cli_plugin/remove/remove.test.js
+++ b/src/cli_plugin/remove/remove.test.js
@@ -20,11 +20,10 @@
import sinon from 'sinon';
import glob from 'glob-all';
import rimraf from 'rimraf';
-import mkdirp from 'mkdirp';
import Logger from '../lib/logger';
import remove from './remove';
import { join } from 'path';
-import { writeFileSync, existsSync } from 'fs';
+import { writeFileSync, existsSync, mkdirSync } from 'fs';
describe('kibana cli', function () {
@@ -42,7 +41,7 @@ describe('kibana cli', function () {
sinon.stub(logger, 'log');
sinon.stub(logger, 'error');
rimraf.sync(pluginDir);
- mkdirp.sync(pluginDir);
+ mkdirSync(pluginDir, { recursive: true });
});
afterEach(function () {
@@ -72,7 +71,7 @@ describe('kibana cli', function () {
it('remove x-pack if it exists', () => {
settings.pluginPath = join(pluginDir, 'x-pack');
settings.plugin = 'x-pack';
- mkdirp.sync(join(pluginDir, 'x-pack'));
+ mkdirSync(join(pluginDir, 'x-pack'), { recursive: true });
expect(existsSync(settings.pluginPath)).toEqual(true);
remove(settings, logger);
expect(existsSync(settings.pluginPath)).toEqual(false);
@@ -88,8 +87,8 @@ describe('kibana cli', function () {
it('delete the specified folder.', function () {
settings.pluginPath = join(pluginDir, 'foo');
- mkdirp.sync(join(pluginDir, 'foo'));
- mkdirp.sync(join(pluginDir, 'bar'));
+ mkdirSync(join(pluginDir, 'foo'), { recursive: true });
+ mkdirSync(join(pluginDir, 'bar'), { recursive: true });
remove(settings, logger);
diff --git a/src/core/public/application/application_service.tsx b/src/core/public/application/application_service.tsx
index d1855a0370f0..935844baddf8 100644
--- a/src/core/public/application/application_service.tsx
+++ b/src/core/public/application/application_service.tsx
@@ -27,12 +27,9 @@ import { AppRouter } from './ui';
import { HttpStart } from '../http';
import { ContextSetup, IContextContainer } from '../context';
import {
- AppMountContext,
App,
LegacyApp,
AppMounter,
- AppUnmount,
- AppMountParameters,
InternalApplicationSetup,
InternalApplicationStart,
} from './types';
@@ -64,11 +61,7 @@ export class ApplicationService {
private readonly apps$ = new BehaviorSubject>(new Map());
private readonly legacyApps$ = new BehaviorSubject>(new Map());
private readonly capabilities = new CapabilitiesService();
- private mountContext?: IContextContainer<
- AppMountContext,
- AppUnmount | Promise,
- [AppMountParameters]
- >;
+ private mountContext?: IContextContainer;
public setup({ context }: SetupDeps): InternalApplicationSetup {
this.mountContext = context.createContextContainer();
@@ -98,7 +91,7 @@ export class ApplicationService {
this.legacyApps$.next(new Map([...this.legacyApps$.value.entries(), [app.id, app]]));
},
- registerMountContext: this.mountContext.registerContext,
+ registerMountContext: this.mountContext!.registerContext,
};
}
diff --git a/src/core/public/application/types.ts b/src/core/public/application/types.ts
index 018d7569ce41..5b1d4affe884 100644
--- a/src/core/public/application/types.ts
+++ b/src/core/public/application/types.ts
@@ -114,6 +114,15 @@ export interface AppMountContext {
overlays: OverlayStart;
/** {@link UiSettingsClient} */
uiSettings: UiSettingsClientContract;
+ /**
+ * exposed temporarily until https://github.com/elastic/kibana/issues/41990 done
+ * use *only* to retrieve config values. There is no way to set injected values
+ * in the new platform. Use the legacy platform API instead.
+ * @deprecated
+ * */
+ injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
};
}
@@ -193,7 +202,7 @@ export interface ApplicationSetup {
*/
registerMountContext(
contextName: T,
- provider: IContextProvider
+ provider: IContextProvider
): void;
}
@@ -224,7 +233,7 @@ export interface InternalApplicationSetup {
registerMountContext(
pluginOpaqueId: PluginOpaqueId,
contextName: T,
- provider: IContextProvider
+ provider: IContextProvider
): void;
}
@@ -261,7 +270,7 @@ export interface ApplicationStart {
*/
registerMountContext(
contextName: T,
- provider: IContextProvider
+ provider: IContextProvider
): void;
}
@@ -291,7 +300,7 @@ export interface InternalApplicationStart
registerMountContext(
pluginOpaqueId: PluginOpaqueId,
contextName: T,
- provider: IContextProvider
+ provider: IContextProvider
): void;
// Internal APIs
diff --git a/src/core/public/context/context_service.ts b/src/core/public/context/context_service.ts
index 704524d83863..dadc509c9782 100644
--- a/src/core/public/context/context_service.ts
+++ b/src/core/public/context/context_service.ts
@@ -18,7 +18,7 @@
*/
import { PluginOpaqueId } from '../../server';
-import { IContextContainer, ContextContainer } from '../../utils/context';
+import { IContextContainer, ContextContainer, HandlerFunction } from '../../utils/context';
import { CoreContext } from '../core_system';
interface StartDeps {
@@ -31,15 +31,8 @@ export class ContextService {
public setup({ pluginDependencies }: StartDeps): ContextSetup {
return {
- createContextContainer: <
- TContext extends {},
- THandlerReturn,
- THandlerParameters extends any[] = []
- >() =>
- new ContextContainer(
- pluginDependencies,
- this.core.coreId
- ),
+ createContextContainer: >() =>
+ new ContextContainer(pluginDependencies, this.core.coreId),
};
}
}
@@ -111,9 +104,5 @@ export interface ContextSetup {
/**
* Creates a new {@link IContextContainer} for a service owner.
*/
- createContextContainer<
- TContext extends {},
- THandlerReturn,
- THandlerParmaters extends any[] = []
- >(): IContextContainer;
+ createContextContainer>(): IContextContainer;
}
diff --git a/src/core/public/context/index.ts b/src/core/public/context/index.ts
index 28b2641b2a5a..f22c4168d754 100644
--- a/src/core/public/context/index.ts
+++ b/src/core/public/context/index.ts
@@ -18,4 +18,10 @@
*/
export { ContextService, ContextSetup } from './context_service';
-export { IContextContainer, IContextProvider, IContextHandler } from '../../utils/context';
+export {
+ IContextContainer,
+ IContextProvider,
+ HandlerFunction,
+ HandlerContextType,
+ HandlerParameters,
+} from '../../utils/context';
diff --git a/src/core/public/core_system.ts b/src/core/public/core_system.ts
index 7b9ed50f0959..7a87f97208a7 100644
--- a/src/core/public/core_system.ts
+++ b/src/core/public/core_system.ts
@@ -236,6 +236,7 @@ export class CoreSystem {
notifications,
overlays,
uiSettings,
+ injectedMetadata: pick(injectedMetadata, ['getInjectedVar']),
}));
const core: InternalCoreStart = {
diff --git a/src/core/public/index.ts b/src/core/public/index.ts
index 393a7076759e..9640f6f510c4 100644
--- a/src/core/public/index.ts
+++ b/src/core/public/index.ts
@@ -67,7 +67,14 @@ import { UiSettingsClient, UiSettingsState, UiSettingsClientContract } from './u
import { ApplicationSetup, Capabilities, ApplicationStart } from './application';
import { DocLinksStart } from './doc_links';
import { SavedObjectsStart } from './saved_objects';
-import { IContextContainer, IContextProvider, ContextSetup, IContextHandler } from './context';
+import {
+ IContextContainer,
+ IContextProvider,
+ ContextSetup,
+ HandlerFunction,
+ HandlerContextType,
+ HandlerParameters,
+} from './context';
export { CoreContext, CoreSystem } from './core_system';
export { RecursiveReadonly } from '../utils';
@@ -138,6 +145,15 @@ export interface CoreSetup {
notifications: NotificationsSetup;
/** {@link UiSettingsClient} */
uiSettings: UiSettingsClientContract;
+ /**
+ * exposed temporarily until https://github.com/elastic/kibana/issues/41990 done
+ * use *only* to retrieve config values. There is no way to set injected values
+ * in the new platform. Use the legacy platform API instead.
+ * @deprecated
+ * */
+ injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
}
/**
@@ -168,6 +184,15 @@ export interface CoreStart {
overlays: OverlayStart;
/** {@link UiSettingsClient} */
uiSettings: UiSettingsClientContract;
+ /**
+ * exposed temporarily until https://github.com/elastic/kibana/issues/41990 done
+ * use *only* to retrieve config values. There is no way to set injected values
+ * in the new platform. Use the legacy platform API instead.
+ * @deprecated
+ * */
+ injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
}
/**
@@ -217,7 +242,9 @@ export {
ChromeRecentlyAccessedHistoryItem,
ChromeStart,
IContextContainer,
- IContextHandler,
+ HandlerFunction,
+ HandlerContextType,
+ HandlerParameters,
IContextProvider,
ContextSetup,
DocLinksStart,
diff --git a/src/core/public/mocks.ts b/src/core/public/mocks.ts
index 7c99f69d6fd7..8ce163fd59e1 100644
--- a/src/core/public/mocks.ts
+++ b/src/core/public/mocks.ts
@@ -28,6 +28,7 @@ import { overlayServiceMock } from './overlays/overlay_service.mock';
import { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock';
import { savedObjectsMock } from './saved_objects/saved_objects_service.mock';
import { contextServiceMock } from './context/context_service.mock';
+import { injectedMetadataServiceMock } from './injected_metadata/injected_metadata_service.mock';
export { chromeServiceMock } from './chrome/chrome_service.mock';
export { docLinksServiceMock } from './doc_links/doc_links_service.mock';
@@ -48,6 +49,9 @@ function createCoreSetupMock() {
http: httpServiceMock.createSetupContract(),
notifications: notificationServiceMock.createSetupContract(),
uiSettings: uiSettingsServiceMock.createSetupContract(),
+ injectedMetadata: {
+ getInjectedVar: injectedMetadataServiceMock.createSetupContract().getInjectedVar,
+ },
};
return mock;
@@ -64,6 +68,9 @@ function createCoreStartMock() {
overlays: overlayServiceMock.createStartContract(),
uiSettings: uiSettingsServiceMock.createStartContract(),
savedObjects: savedObjectsMock.createStartContract(),
+ injectedMetadata: {
+ getInjectedVar: injectedMetadataServiceMock.createStartContract().getInjectedVar,
+ },
};
return mock;
diff --git a/src/core/public/plugins/plugin_context.ts b/src/core/public/plugins/plugin_context.ts
index f4e25d27447b..51bd118d280e 100644
--- a/src/core/public/plugins/plugin_context.ts
+++ b/src/core/public/plugins/plugin_context.ts
@@ -86,6 +86,9 @@ export function createPluginSetupContext<
http: deps.http,
notifications: deps.notifications,
uiSettings: deps.uiSettings,
+ injectedMetadata: {
+ getInjectedVar: deps.injectedMetadata.getInjectedVar,
+ },
};
}
@@ -125,5 +128,8 @@ export function createPluginStartContext<
overlays: deps.overlays,
uiSettings: deps.uiSettings,
savedObjects: deps.savedObjects,
+ injectedMetadata: {
+ getInjectedVar: deps.injectedMetadata.getInjectedVar,
+ },
};
}
diff --git a/src/core/public/plugins/plugins_service.test.ts b/src/core/public/plugins/plugins_service.test.ts
index d6411554e5f8..358bf71ac918 100644
--- a/src/core/public/plugins/plugins_service.test.ts
+++ b/src/core/public/plugins/plugins_service.test.ts
@@ -17,7 +17,7 @@
* under the License.
*/
-import { omit } from 'lodash';
+import { omit, pick } from 'lodash';
import {
MockedPluginInitializer,
@@ -76,12 +76,12 @@ beforeEach(() => {
context: contextServiceMock.createSetupContract(),
fatalErrors: fatalErrorsServiceMock.createSetupContract(),
http: httpServiceMock.createSetupContract(),
- injectedMetadata: injectedMetadataServiceMock.createSetupContract(),
+ injectedMetadata: pick(injectedMetadataServiceMock.createStartContract(), 'getInjectedVar'),
notifications: notificationServiceMock.createSetupContract(),
uiSettings: uiSettingsServiceMock.createSetupContract(),
};
mockSetupContext = {
- ...omit(mockSetupDeps, 'injectedMetadata'),
+ ...mockSetupDeps,
application: expect.any(Object),
};
mockStartDeps = {
@@ -90,14 +90,14 @@ beforeEach(() => {
http: httpServiceMock.createStartContract(),
chrome: chromeServiceMock.createStartContract(),
i18n: i18nServiceMock.createStartContract(),
- injectedMetadata: injectedMetadataServiceMock.createStartContract(),
+ injectedMetadata: pick(injectedMetadataServiceMock.createStartContract(), 'getInjectedVar'),
notifications: notificationServiceMock.createStartContract(),
overlays: overlayServiceMock.createStartContract(),
uiSettings: uiSettingsServiceMock.createStartContract(),
savedObjects: savedObjectsMock.createStartContract(),
};
mockStartContext = {
- ...omit(mockStartDeps, 'injectedMetadata'),
+ ...mockStartDeps,
application: expect.any(Object),
chrome: omit(mockStartDeps.chrome, 'getComponent'),
};
diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md
index 102e77b564a6..0156cbaebb94 100644
--- a/src/core/public/public.api.md
+++ b/src/core/public/public.api.md
@@ -9,6 +9,7 @@ import { MouseEventHandler } from 'react';
import { Observable } from 'rxjs';
import React from 'react';
import * as Rx from 'rxjs';
+import { ShallowPromise } from '@kbn/utility-types';
import { EuiGlobalToastListToast as Toast } from '@elastic/eui';
// @public
@@ -31,7 +32,7 @@ export interface AppBase {
// @public (undocumented)
export interface ApplicationSetup {
register(app: App): void;
- registerMountContext(contextName: T, provider: IContextProvider): void;
+ registerMountContext(contextName: T, provider: IContextProvider): void;
}
// @public (undocumented)
@@ -44,7 +45,7 @@ export interface ApplicationStart {
path?: string;
state?: any;
}): void;
- registerMountContext(contextName: T, provider: IContextProvider): void;
+ registerMountContext(contextName: T, provider: IContextProvider): void;
}
// @public
@@ -58,6 +59,9 @@ export interface AppMountContext {
notifications: NotificationsStart;
overlays: OverlayStart;
uiSettings: UiSettingsClientContract;
+ injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
};
}
@@ -213,7 +217,7 @@ export interface ChromeStart {
// @public
export interface ContextSetup {
- createContextContainer(): IContextContainer;
+ createContextContainer>(): IContextContainer;
}
// @internal (undocumented)
@@ -234,6 +238,10 @@ export interface CoreSetup {
fatalErrors: FatalErrorsSetup;
// (undocumented)
http: HttpSetup;
+ // @deprecated
+ injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
// (undocumented)
notifications: NotificationsSetup;
// (undocumented)
@@ -252,6 +260,10 @@ export interface CoreStart {
http: HttpStart;
// (undocumented)
i18n: I18nStart;
+ // @deprecated
+ injectedMetadata: {
+ getInjectedVar: (name: string, defaultValue?: any) => unknown;
+ };
// (undocumented)
notifications: NotificationsStart;
// (undocumented)
@@ -389,6 +401,15 @@ export interface FatalErrorsSetup {
get$: () => Rx.Observable;
}
+// @public
+export type HandlerContextType> = T extends HandlerFunction ? U : never;
+
+// @public
+export type HandlerFunction = (context: T, ...args: any[]) => any;
+
+// @public
+export type HandlerParameters> = T extends (context: any, ...args: infer U) => any ? U : never;
+
// @public (undocumented)
export type HttpBody = BodyInit | null | any;
@@ -551,16 +572,13 @@ export interface I18nStart {
}
// @public
-export interface IContextContainer {
- createHandler(pluginOpaqueId: PluginOpaqueId, handler: IContextHandler): (...rest: THandlerParameters) => THandlerReturn extends Promise ? THandlerReturn : Promise;
- registerContext(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider): this;
+export interface IContextContainer> {
+ createHandler(pluginOpaqueId: PluginOpaqueId, handler: THandler): (...rest: HandlerParameters) => ShallowPromise>;
+ registerContext>(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider): this;
}
// @public
-export type IContextHandler = (context: TContext, ...rest: THandlerParameters) => TReturn;
-
-// @public
-export type IContextProvider, TContextName extends keyof TContext, TProviderParameters extends any[] = []> = (context: Partial, ...rest: TProviderParameters) => Promise | TContext[TContextName];
+export type IContextProvider, TContextName extends keyof HandlerContextType> = (context: Partial>, ...rest: HandlerParameters) => Promise[TContextName]> | HandlerContextType[TContextName];
// @public @deprecated
export interface LegacyCoreSetup extends CoreSetup {
diff --git a/src/core/server/context/context_service.ts b/src/core/server/context/context_service.ts
index 80935840c553..1c5bd41a01f0 100644
--- a/src/core/server/context/context_service.ts
+++ b/src/core/server/context/context_service.ts
@@ -18,7 +18,7 @@
*/
import { PluginOpaqueId } from '../../server';
-import { IContextContainer, ContextContainer } from '../../utils/context';
+import { IContextContainer, ContextContainer, HandlerFunction } from '../../utils/context';
import { CoreContext } from '../core_context';
interface SetupDeps {
@@ -31,15 +31,8 @@ export class ContextService {
public setup({ pluginDependencies }: SetupDeps): ContextSetup {
return {
- createContextContainer: <
- TContext extends {},
- THandlerReturn,
- THandlerParameters extends any[] = []
- >() => {
- return new ContextContainer(
- pluginDependencies,
- this.core.coreId
- );
+ createContextContainer: >() => {
+ return new ContextContainer(pluginDependencies, this.core.coreId);
},
};
}
@@ -112,9 +105,5 @@ export interface ContextSetup {
/**
* Creates a new {@link IContextContainer} for a service owner.
*/
- createContextContainer<
- TContext extends {},
- THandlerReturn,
- THandlerParmaters extends any[] = []
- >(): IContextContainer;
+ createContextContainer>(): IContextContainer;
}
diff --git a/src/core/server/context/index.ts b/src/core/server/context/index.ts
index 28b2641b2a5a..f22c4168d754 100644
--- a/src/core/server/context/index.ts
+++ b/src/core/server/context/index.ts
@@ -18,4 +18,10 @@
*/
export { ContextService, ContextSetup } from './context_service';
-export { IContextContainer, IContextProvider, IContextHandler } from '../../utils/context';
+export {
+ IContextContainer,
+ IContextProvider,
+ HandlerFunction,
+ HandlerContextType,
+ HandlerParameters,
+} from '../../utils/context';
diff --git a/src/core/server/http/http_service.ts b/src/core/server/http/http_service.ts
index 5814991a2dd2..0ac5ad927635 100644
--- a/src/core/server/http/http_service.ts
+++ b/src/core/server/http/http_service.ts
@@ -83,8 +83,8 @@ export type HttpServiceSetup = Omit & {
registerRouteHandlerContext: (
pluginOpaqueId: PluginOpaqueId,
contextName: T,
- provider: RequestHandlerContextProvider
- ) => RequestHandlerContextContainer;
+ provider: RequestHandlerContextProvider
+ ) => RequestHandlerContextContainer;
};
/** @public */
@@ -103,7 +103,7 @@ export class HttpService implements CoreService;
+ private requestHandlerContext?: RequestHandlerContextContainer;
constructor(private readonly coreContext: CoreContext) {
this.logger = coreContext.logger;
@@ -150,7 +150,7 @@ export class HttpService implements CoreService(
pluginOpaqueId: PluginOpaqueId,
contextName: T,
- provider: RequestHandlerContextProvider
+ provider: RequestHandlerContextProvider
) => this.requestHandlerContext!.registerContext(pluginOpaqueId, contextName, provider),
};
diff --git a/src/core/server/http/types.ts b/src/core/server/http/types.ts
index a391b2e2e5d4..cade4ea4d4f2 100644
--- a/src/core/server/http/types.ts
+++ b/src/core/server/http/types.ts
@@ -16,30 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { IContextProvider, IContextContainer } from '../context';
-import { KibanaRequest, KibanaResponseFactory, KibanaResponse } from './router';
-
-/**
- * Parameters passed to the request handler function.
- * @public
- */
-export type RequestHandlerParams = [KibanaRequest, KibanaResponseFactory];
-/**
- * Expected outcome the request handler function.
- * @public
- */
-export type RequestHandlerReturn = KibanaResponse;
+import { IContextProvider, IContextContainer } from '../context';
+import { RequestHandler } from './router';
+import { RequestHandlerContext } from '..';
/**
* An object that handles registration of http request context providers.
* @public
*/
-export type RequestHandlerContextContainer = IContextContainer<
- TContext,
- RequestHandlerReturn | Promise,
- RequestHandlerParams
->;
+export type RequestHandlerContextContainer = IContextContainer>;
/**
* Context provider for request handler.
@@ -47,8 +33,6 @@ export type RequestHandlerContextContainer = IContextContainer<
*
* @public
*/
-export type RequestHandlerContextProvider = IContextProvider<
- TContext,
- keyof TContext,
- RequestHandlerParams
->;
+export type RequestHandlerContextProvider<
+ TContextName extends keyof RequestHandlerContext
+> = IContextProvider, TContextName>;
diff --git a/src/core/server/index.ts b/src/core/server/index.ts
index d3fe64ddc1e0..ca497e0f2d32 100644
--- a/src/core/server/index.ts
+++ b/src/core/server/index.ts
@@ -59,7 +59,13 @@ import { SavedObjectsServiceStart } from './saved_objects';
export { bootstrap } from './bootstrap';
export { ConfigPath, ConfigService } from './config';
-export { IContextContainer, IContextProvider, IContextHandler } from './context';
+export {
+ IContextContainer,
+ IContextProvider,
+ HandlerFunction,
+ HandlerContextType,
+ HandlerParameters,
+} from './context';
export { CoreId } from './core_context';
export {
CallAPIOptions,
@@ -102,8 +108,6 @@ export {
RequestHandler,
RequestHandlerContextContainer,
RequestHandlerContextProvider,
- RequestHandlerParams,
- RequestHandlerReturn,
ResponseError,
ResponseErrorAttributes,
ResponseHeaders,
@@ -212,8 +216,8 @@ export interface CoreSetup {
isTlsEnabled: HttpServiceSetup['isTlsEnabled'];
registerRouteHandlerContext: (
name: T,
- provider: RequestHandlerContextProvider
- ) => RequestHandlerContextContainer;
+ provider: RequestHandlerContextProvider
+ ) => RequestHandlerContextContainer;
createRouter: () => IRouter;
};
}
diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md
index ae839644fc2e..6451e2b9b715 100644
--- a/src/core/server/server.api.md
+++ b/src/core/server/server.api.md
@@ -21,6 +21,7 @@ import { Request } from 'hapi';
import { ResponseObject } from 'hapi';
import { ResponseToolkit } from 'hapi';
import { Server } from 'hapi';
+import { ShallowPromise } from '@kbn/utility-types';
import { Stream } from 'stream';
import { Type } from '@kbn/config-schema';
import { TypeOf } from '@kbn/config-schema';
@@ -61,11 +62,11 @@ export interface AuthToolkit {
export class BasePath {
// @internal
constructor(serverBasePath?: string);
- get: (request: KibanaRequest | LegacyRequest) => string;
+ get: (request: LegacyRequest | KibanaRequest) => string;
prepend: (path: string) => string;
remove: (path: string) => string;
readonly serverBasePath: string;
- set: (request: KibanaRequest | LegacyRequest, requestSpecificBasePath: string) => void;
+ set: (request: LegacyRequest | KibanaRequest, requestSpecificBasePath: string) => void;
}
// Warning: (ae-forgotten-export) The symbol "BootstrapArgs" needs to be exported by the entry point index.d.ts
@@ -109,7 +110,7 @@ export class ConfigService {
// @public
export interface ContextSetup {
- createContextContainer(): IContextContainer;
+ createContextContainer>(): IContextContainer;
}
// @internal (undocumented)
@@ -135,7 +136,7 @@ export interface CoreSetup {
registerOnPostAuth: HttpServiceSetup['registerOnPostAuth'];
basePath: HttpServiceSetup['basePath'];
isTlsEnabled: HttpServiceSetup['isTlsEnabled'];
- registerRouteHandlerContext: (name: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer;
+ registerRouteHandlerContext: (name: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer;
createRouter: () => IRouter;
};
}
@@ -219,6 +220,15 @@ export type GetAuthState = (request: KibanaRequest | LegacyRequest) => {
state: unknown;
};
+// @public
+export type HandlerContextType> = T extends HandlerFunction ? U : never;
+
+// @public
+export type HandlerFunction = (context: T, ...args: any[]) => any;
+
+// @public
+export type HandlerParameters> = T extends (context: any, ...args: infer U) => any ? U : never;
+
// @public
export type Headers = {
[header in KnownHeaders]?: string | string[] | undefined;
@@ -258,7 +268,7 @@ export interface HttpServerSetup {
// @public (undocumented)
export type HttpServiceSetup = Omit & {
createRouter: (path: string, plugin?: PluginOpaqueId) => IRouter;
- registerRouteHandlerContext: (pluginOpaqueId: PluginOpaqueId, contextName: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer;
+ registerRouteHandlerContext: (pluginOpaqueId: PluginOpaqueId, contextName: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer;
};
// @public (undocumented)
@@ -270,16 +280,13 @@ export interface HttpServiceStart {
export type IBasePath = Pick;
// @public
-export interface IContextContainer {
- createHandler(pluginOpaqueId: PluginOpaqueId, handler: IContextHandler): (...rest: THandlerParameters) => THandlerReturn extends Promise ? THandlerReturn : Promise;
- registerContext(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider): this;
+export interface IContextContainer> {
+ createHandler(pluginOpaqueId: PluginOpaqueId, handler: THandler): (...rest: HandlerParameters) => ShallowPromise>;
+ registerContext>(pluginOpaqueId: PluginOpaqueId, contextName: TContextName, provider: IContextProvider): this;
}
// @public
-export type IContextHandler = (context: TContext, ...rest: THandlerParameters) => TReturn;
-
-// @public
-export type IContextProvider, TContextName extends keyof TContext, TProviderParameters extends any[] = []> = (context: Partial, ...rest: TProviderParameters) => Promise | TContext[TContextName];
+export type IContextProvider, TContextName extends keyof HandlerContextType> = (context: Partial>, ...rest: HandlerParameters) => Promise[TContextName]> | HandlerContextType[TContextName];
// @public
export interface IKibanaSocket {
@@ -602,16 +609,10 @@ export interface RequestHandlerContext {
}
// @public
-export type RequestHandlerContextContainer = IContextContainer, RequestHandlerParams>;
-
-// @public
-export type RequestHandlerContextProvider = IContextProvider;
-
-// @public
-export type RequestHandlerParams = [KibanaRequest, KibanaResponseFactory];
+export type RequestHandlerContextContainer = IContextContainer>;
// @public
-export type RequestHandlerReturn = KibanaResponse;
+export type RequestHandlerContextProvider = IContextProvider, TContextName>;
// @public
export type ResponseError = string | Error | {
diff --git a/src/core/utils/context.mock.ts b/src/core/utils/context.mock.ts
index 4d91c11542b2..de844f3f0f07 100644
--- a/src/core/utils/context.mock.ts
+++ b/src/core/utils/context.mock.ts
@@ -19,7 +19,7 @@
import { IContextContainer } from './context';
-export type ContextContainerMock = jest.Mocked>;
+export type ContextContainerMock = jest.Mocked>;
const createContextMock = () => {
const contextMock: ContextContainerMock = {
diff --git a/src/core/utils/context.test.ts b/src/core/utils/context.test.ts
index 1249c14736fb..4bfeddc2e08c 100644
--- a/src/core/utils/context.test.ts
+++ b/src/core/utils/context.test.ts
@@ -44,7 +44,7 @@ const coreId = Symbol();
describe('ContextContainer', () => {
it('does not allow the same context to be registered twice', () => {
- const contextContainer = new ContextContainer(plugins, coreId);
+ const contextContainer = new ContextContainer<(context: MyContext) => string>(plugins, coreId);
contextContainer.registerContext(coreId, 'ctxFromA', () => 'aString');
expect(() =>
@@ -56,7 +56,10 @@ describe('ContextContainer', () => {
describe('registerContext', () => {
it('throws error if called with an unknown symbol', async () => {
- const contextContainer = new ContextContainer(plugins, coreId);
+ const contextContainer = new ContextContainer<(context: MyContext) => string>(
+ plugins,
+ coreId
+ );
await expect(() =>
contextContainer.registerContext(Symbol('unknown'), 'ctxFromA', jest.fn())
).toThrowErrorMatchingInlineSnapshot(
@@ -67,7 +70,10 @@ describe('ContextContainer', () => {
describe('context building', () => {
it('resolves dependencies', async () => {
- const contextContainer = new ContextContainer(plugins, coreId);
+ const contextContainer = new ContextContainer<(context: MyContext) => string>(
+ plugins,
+ coreId
+ );
expect.assertions(8);
contextContainer.registerContext(coreId, 'core1', context => {
expect(context).toEqual({});
@@ -118,7 +124,10 @@ describe('ContextContainer', () => {
it('exposes all core context to all providers regardless of registration order', async () => {
expect.assertions(4);
- const contextContainer = new ContextContainer(plugins, coreId);
+ const contextContainer = new ContextContainer<(context: MyContext) => string>(
+ plugins,
+ coreId
+ );
contextContainer
.registerContext(pluginA, 'ctxFromA', context => {
expect(context).toEqual({ core1: 'core', core2: 101 });
@@ -146,7 +155,10 @@ describe('ContextContainer', () => {
it('exposes all core context to core providers', async () => {
expect.assertions(4);
- const contextContainer = new ContextContainer(plugins, coreId);
+ const contextContainer = new ContextContainer<(context: MyContext) => string>(
+ plugins,
+ coreId
+ );
contextContainer
.registerContext(coreId, 'core1', context => {
@@ -171,7 +183,10 @@ describe('ContextContainer', () => {
});
it('does not expose plugin contexts to core handler', async () => {
- const contextContainer = new ContextContainer(plugins, coreId);
+ const contextContainer = new ContextContainer<(context: MyContext) => string>(
+ plugins,
+ coreId
+ );
contextContainer
.registerContext(coreId, 'core1', context => 'core')
@@ -189,10 +204,9 @@ describe('ContextContainer', () => {
it('passes additional arguments to providers', async () => {
expect.assertions(6);
- const contextContainer = new ContextContainer(
- plugins,
- coreId
- );
+ const contextContainer = new ContextContainer<
+ (context: MyContext, arg1: string, arg2: number) => string
+ >(plugins, coreId);
contextContainer.registerContext(coreId, 'core1', (context, str, num) => {
expect(str).toEqual('passed string');
@@ -228,7 +242,10 @@ describe('ContextContainer', () => {
describe('createHandler', () => {
it('throws error if called with an unknown symbol', async () => {
- const contextContainer = new ContextContainer