diff --git a/.eslintrc.js b/.eslintrc.js index ce4aea3c02309..56950a70970d4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -149,6 +149,7 @@ module.exports = { 'src/core/server/**/*', '!src/core/server/index.ts', '!src/core/server/mocks.ts', + '!src/core/server/types.ts', '!src/core/server/*.test.mocks.ts', 'src/plugins/**/public/**/*', diff --git a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb._data-test-subj_.md b/docs/development/core/public/kibana-plugin-public.chromebreadcrumb._data-test-subj_.md deleted file mode 100644 index 8cdfafb7c8d91..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb._data-test-subj_.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) > ["data-test-subj"](./kibana-plugin-public.chromebreadcrumb._data-test-subj_.md) - -## ChromeBreadcrumb."data-test-subj" property - -Signature: - -```typescript -'data-test-subj'?: string; -``` diff --git a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.href.md b/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.href.md deleted file mode 100644 index b40f19c99f668..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.href.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) > [href](./kibana-plugin-public.chromebreadcrumb.href.md) - -## ChromeBreadcrumb.href property - -Signature: - -```typescript -href?: string; -``` diff --git a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.md b/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.md index 883300f96753a..9350b56ce5f60 100644 --- a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.md +++ b/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.md @@ -2,21 +2,11 @@ [Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) -## ChromeBreadcrumb interface +## ChromeBreadcrumb type Signature: ```typescript -export interface ChromeBreadcrumb +export declare type ChromeBreadcrumb = EuiBreadcrumb; ``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| ["data-test-subj"](./kibana-plugin-public.chromebreadcrumb._data-test-subj_.md) | string | | -| [href](./kibana-plugin-public.chromebreadcrumb.href.md) | string | | -| [onClick](./kibana-plugin-public.chromebreadcrumb.onclick.md) | MouseEventHandler<HTMLButtonElement> | | -| [text](./kibana-plugin-public.chromebreadcrumb.text.md) | string | | - diff --git a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.onclick.md b/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.onclick.md deleted file mode 100644 index 1e0ae36e893a1..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.onclick.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) > [onClick](./kibana-plugin-public.chromebreadcrumb.onclick.md) - -## ChromeBreadcrumb.onClick property - -Signature: - -```typescript -onClick?: MouseEventHandler; -``` diff --git a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.text.md b/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.text.md deleted file mode 100644 index fa7e3804576e3..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.chromebreadcrumb.text.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) > [text](./kibana-plugin-public.chromebreadcrumb.text.md) - -## ChromeBreadcrumb.text property - -Signature: - -```typescript -text: string; -``` diff --git a/docs/development/core/public/kibana-plugin-public.contextsetup.md b/docs/development/core/public/kibana-plugin-public.contextsetup.md index d9c158fcaae05..2b67c7cdaf0e1 100644 --- a/docs/development/core/public/kibana-plugin-public.contextsetup.md +++ b/docs/development/core/public/kibana-plugin-public.contextsetup.md @@ -91,18 +91,17 @@ export interface VizRenderContext { } export type VizRenderer = (context: VizRenderContext, domElement: HTMLElement) => () => void; +// When a renderer is bound via `contextContainer.createHandler` this is the type that will be returned. +type BoundVizRenderer = (domElement: HTMLElement) => () => void; class VizRenderingPlugin { - private readonly vizRenderers = new Map () => void)>(); + private readonly contextContainer?: IContextContainer; + private readonly vizRenderers = new Map(); constructor(private readonly initContext: PluginInitializerContext) {} setup(core) { - this.contextContainer = core.context.createContextContainer< - VizRenderContext, - ReturnType, - [HTMLElement] - >(); + this.contextContainer = core.context.createContextContainer(); return { registerContext: this.contextContainer.registerContext, diff --git a/docs/development/core/public/kibana-plugin-public.environmentmode.dev.md b/docs/development/core/public/kibana-plugin-public.environmentmode.dev.md new file mode 100644 index 0000000000000..b82e851da2b66 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.environmentmode.dev.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [EnvironmentMode](./kibana-plugin-public.environmentmode.md) > [dev](./kibana-plugin-public.environmentmode.dev.md) + +## EnvironmentMode.dev property + +Signature: + +```typescript +dev: boolean; +``` diff --git a/docs/development/core/public/kibana-plugin-public.environmentmode.md b/docs/development/core/public/kibana-plugin-public.environmentmode.md new file mode 100644 index 0000000000000..14ab1316f5269 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.environmentmode.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [EnvironmentMode](./kibana-plugin-public.environmentmode.md) + +## EnvironmentMode interface + + +Signature: + +```typescript +export interface EnvironmentMode +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [dev](./kibana-plugin-public.environmentmode.dev.md) | boolean | | +| [name](./kibana-plugin-public.environmentmode.name.md) | 'development' | 'production' | | +| [prod](./kibana-plugin-public.environmentmode.prod.md) | boolean | | + diff --git a/docs/development/core/public/kibana-plugin-public.environmentmode.name.md b/docs/development/core/public/kibana-plugin-public.environmentmode.name.md new file mode 100644 index 0000000000000..5983fea856750 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.environmentmode.name.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [EnvironmentMode](./kibana-plugin-public.environmentmode.md) > [name](./kibana-plugin-public.environmentmode.name.md) + +## EnvironmentMode.name property + +Signature: + +```typescript +name: 'development' | 'production'; +``` diff --git a/docs/development/core/public/kibana-plugin-public.environmentmode.prod.md b/docs/development/core/public/kibana-plugin-public.environmentmode.prod.md new file mode 100644 index 0000000000000..4b46e8b9cc9f9 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.environmentmode.prod.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [EnvironmentMode](./kibana-plugin-public.environmentmode.md) > [prod](./kibana-plugin-public.environmentmode.prod.md) + +## EnvironmentMode.prod property + +Signature: + +```typescript +prod: boolean; +``` diff --git a/docs/development/core/public/kibana-plugin-public.errortoastoptions.md b/docs/development/core/public/kibana-plugin-public.errortoastoptions.md index 135418632ac98..1755e6cbde919 100644 --- a/docs/development/core/public/kibana-plugin-public.errortoastoptions.md +++ b/docs/development/core/public/kibana-plugin-public.errortoastoptions.md @@ -4,6 +4,8 @@ ## ErrorToastOptions interface +Options available for [IToasts](./kibana-plugin-public.itoasts.md) APIs. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httperrorresponse.error.md b/docs/development/core/public/kibana-plugin-public.httperrorresponse.error.md index cb82a1f37f84e..59eee87cb70ba 100644 --- a/docs/development/core/public/kibana-plugin-public.httperrorresponse.error.md +++ b/docs/development/core/public/kibana-plugin-public.httperrorresponse.error.md @@ -7,5 +7,5 @@ Signature: ```typescript -error: Error | HttpFetchError; +error: Error | IHttpFetchError; ``` diff --git a/docs/development/core/public/kibana-plugin-public.httperrorresponse.md b/docs/development/core/public/kibana-plugin-public.httperrorresponse.md index 0495195328fa2..1955bb57c50bf 100644 --- a/docs/development/core/public/kibana-plugin-public.httperrorresponse.md +++ b/docs/development/core/public/kibana-plugin-public.httperrorresponse.md @@ -16,7 +16,7 @@ export interface HttpErrorResponse | Property | Type | Description | | --- | --- | --- | | [body](./kibana-plugin-public.httperrorresponse.body.md) | HttpBody | | -| [error](./kibana-plugin-public.httperrorresponse.error.md) | Error | HttpFetchError | | +| [error](./kibana-plugin-public.httperrorresponse.error.md) | Error | IHttpFetchError | | | [request](./kibana-plugin-public.httperrorresponse.request.md) | Request | | | [response](./kibana-plugin-public.httperrorresponse.response.md) | Response | | diff --git a/docs/development/core/public/kibana-plugin-public.httpfetcherror._constructor_.md b/docs/development/core/public/kibana-plugin-public.httpfetcherror._constructor_.md deleted file mode 100644 index f7e057415715a..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.httpfetcherror._constructor_.md +++ /dev/null @@ -1,23 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpFetchError](./kibana-plugin-public.httpfetcherror.md) > [(constructor)](./kibana-plugin-public.httpfetcherror._constructor_.md) - -## HttpFetchError.(constructor) - -Constructs a new instance of the `HttpFetchError` class - -Signature: - -```typescript -constructor(message: string, request: Request, response?: Response | undefined, body?: any); -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| message | string | | -| request | Request | | -| response | Response | undefined | | -| body | any | | - diff --git a/docs/development/core/public/kibana-plugin-public.httpfetcherror.md b/docs/development/core/public/kibana-plugin-public.httpfetcherror.md deleted file mode 100644 index 70f2edfc7d201..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.httpfetcherror.md +++ /dev/null @@ -1,27 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpFetchError](./kibana-plugin-public.httpfetcherror.md) - -## HttpFetchError class - - -Signature: - -```typescript -export declare class HttpFetchError extends Error -``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(message, request, response, body)](./kibana-plugin-public.httpfetcherror._constructor_.md) | | Constructs a new instance of the HttpFetchError class | - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [body](./kibana-plugin-public.httpfetcherror.body.md) | | any | | -| [request](./kibana-plugin-public.httpfetcherror.request.md) | | Request | | -| [response](./kibana-plugin-public.httpfetcherror.response.md) | | Response | undefined | | - diff --git a/docs/development/core/public/kibana-plugin-public.httpfetcherror.response.md b/docs/development/core/public/kibana-plugin-public.httpfetcherror.response.md deleted file mode 100644 index 404d1b7c7abc0..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.httpfetcherror.response.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpFetchError](./kibana-plugin-public.httpfetcherror.md) > [response](./kibana-plugin-public.httpfetcherror.response.md) - -## HttpFetchError.response property - -Signature: - -```typescript -readonly response?: Response | undefined; -``` diff --git a/docs/development/core/public/kibana-plugin-public.httpfetchoptions.headers.md b/docs/development/core/public/kibana-plugin-public.httpfetchoptions.headers.md index 2fb4c448fe237..232b7d3da3af4 100644 --- a/docs/development/core/public/kibana-plugin-public.httpfetchoptions.headers.md +++ b/docs/development/core/public/kibana-plugin-public.httpfetchoptions.headers.md @@ -4,6 +4,8 @@ ## HttpFetchOptions.headers property +Headers to send with the request. See [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md). + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpfetchoptions.md b/docs/development/core/public/kibana-plugin-public.httpfetchoptions.md index 93fabb053871a..eca29b37425e9 100644 --- a/docs/development/core/public/kibana-plugin-public.httpfetchoptions.md +++ b/docs/development/core/public/kibana-plugin-public.httpfetchoptions.md @@ -4,6 +4,7 @@ ## HttpFetchOptions interface +All options that may be used with a [HttpHandler](./kibana-plugin-public.httphandler.md). Signature: @@ -15,7 +16,7 @@ export interface HttpFetchOptions extends HttpRequestInit | Property | Type | Description | | --- | --- | --- | -| [headers](./kibana-plugin-public.httpfetchoptions.headers.md) | HttpHeadersInit | | -| [prependBasePath](./kibana-plugin-public.httpfetchoptions.prependbasepath.md) | boolean | | -| [query](./kibana-plugin-public.httpfetchoptions.query.md) | HttpFetchQuery | | +| [headers](./kibana-plugin-public.httpfetchoptions.headers.md) | HttpHeadersInit | Headers to send with the request. See [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md). | +| [prependBasePath](./kibana-plugin-public.httpfetchoptions.prependbasepath.md) | boolean | Whether or not the request should automatically prepend the basePath. Defaults to true. | +| [query](./kibana-plugin-public.httpfetchoptions.query.md) | HttpFetchQuery | The query string for an HTTP request. See [HttpFetchQuery](./kibana-plugin-public.httpfetchquery.md). | diff --git a/docs/development/core/public/kibana-plugin-public.httpfetchoptions.prependbasepath.md b/docs/development/core/public/kibana-plugin-public.httpfetchoptions.prependbasepath.md index 5fff6c3518b56..0a6a8e195e565 100644 --- a/docs/development/core/public/kibana-plugin-public.httpfetchoptions.prependbasepath.md +++ b/docs/development/core/public/kibana-plugin-public.httpfetchoptions.prependbasepath.md @@ -4,6 +4,8 @@ ## HttpFetchOptions.prependBasePath property +Whether or not the request should automatically prepend the basePath. Defaults to `true`. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpfetchoptions.query.md b/docs/development/core/public/kibana-plugin-public.httpfetchoptions.query.md index 2c24a3a3a548d..0f8d6ba83e772 100644 --- a/docs/development/core/public/kibana-plugin-public.httpfetchoptions.query.md +++ b/docs/development/core/public/kibana-plugin-public.httpfetchoptions.query.md @@ -4,6 +4,8 @@ ## HttpFetchOptions.query property +The query string for an HTTP request. See [HttpFetchQuery](./kibana-plugin-public.httpfetchquery.md). + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httphandler.md b/docs/development/core/public/kibana-plugin-public.httphandler.md index 8bc9c3302252f..80fd1ea2e5761 100644 --- a/docs/development/core/public/kibana-plugin-public.httphandler.md +++ b/docs/development/core/public/kibana-plugin-public.httphandler.md @@ -4,6 +4,7 @@ ## HttpHandler type +A function for making an HTTP requests to Kibana's backend. See [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) for options and [HttpBody](./kibana-plugin-public.httpbody.md) for the response. Signature: diff --git a/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.halt.md b/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.halt.md deleted file mode 100644 index 36983d90cf8f4..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.halt.md +++ /dev/null @@ -1,15 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpInterceptController](./kibana-plugin-public.httpinterceptcontroller.md) > [halt](./kibana-plugin-public.httpinterceptcontroller.halt.md) - -## HttpInterceptController.halt() method - -Signature: - -```typescript -halt(): void; -``` -Returns: - -`void` - diff --git a/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.halted.md b/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.halted.md deleted file mode 100644 index 18e380c0786bf..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.halted.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpInterceptController](./kibana-plugin-public.httpinterceptcontroller.md) > [halted](./kibana-plugin-public.httpinterceptcontroller.halted.md) - -## HttpInterceptController.halted property - -Signature: - -```typescript -readonly halted: boolean; -``` diff --git a/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.md b/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.md deleted file mode 100644 index 03b91fde69cc3..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.httpinterceptcontroller.md +++ /dev/null @@ -1,24 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpInterceptController](./kibana-plugin-public.httpinterceptcontroller.md) - -## HttpInterceptController class - -Signature: - -```typescript -export declare class HttpInterceptController -``` - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [halted](./kibana-plugin-public.httpinterceptcontroller.halted.md) | | boolean | | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [halt()](./kibana-plugin-public.httpinterceptcontroller.halt.md) | | | - diff --git a/docs/development/core/public/kibana-plugin-public.httpinterceptor.md b/docs/development/core/public/kibana-plugin-public.httpinterceptor.md index c694151701ffb..cf7288a492ebb 100644 --- a/docs/development/core/public/kibana-plugin-public.httpinterceptor.md +++ b/docs/development/core/public/kibana-plugin-public.httpinterceptor.md @@ -4,6 +4,7 @@ ## HttpInterceptor interface +An object that may define global interceptor functions for different parts of the request and response lifecycle. See [IHttpInterceptController](./kibana-plugin-public.ihttpinterceptcontroller.md). Signature: @@ -15,8 +16,8 @@ export interface HttpInterceptor | Method | Description | | --- | --- | -| [request(request, controller)](./kibana-plugin-public.httpinterceptor.request.md) | | -| [requestError(httpErrorRequest, controller)](./kibana-plugin-public.httpinterceptor.requesterror.md) | | -| [response(httpResponse, controller)](./kibana-plugin-public.httpinterceptor.response.md) | | -| [responseError(httpErrorResponse, controller)](./kibana-plugin-public.httpinterceptor.responseerror.md) | | +| [request(request, controller)](./kibana-plugin-public.httpinterceptor.request.md) | Define an interceptor to be executed before a request is sent. | +| [requestError(httpErrorRequest, controller)](./kibana-plugin-public.httpinterceptor.requesterror.md) | Define an interceptor to be executed if a request interceptor throws an error or returns a rejected Promise. | +| [response(httpResponse, controller)](./kibana-plugin-public.httpinterceptor.response.md) | Define an interceptor to be executed after a response is received. | +| [responseError(httpErrorResponse, controller)](./kibana-plugin-public.httpinterceptor.responseerror.md) | Define an interceptor to be executed if a response interceptor throws an error or returns a rejected Promise. | diff --git a/docs/development/core/public/kibana-plugin-public.httpinterceptor.request.md b/docs/development/core/public/kibana-plugin-public.httpinterceptor.request.md index 0e57cf8dc51f9..4254e4aa8950c 100644 --- a/docs/development/core/public/kibana-plugin-public.httpinterceptor.request.md +++ b/docs/development/core/public/kibana-plugin-public.httpinterceptor.request.md @@ -4,10 +4,12 @@ ## HttpInterceptor.request() method +Define an interceptor to be executed before a request is sent. + Signature: ```typescript -request?(request: Request, controller: HttpInterceptController): Promise | Request | void; +request?(request: Request, controller: IHttpInterceptController): Promise | Request | void; ``` ## Parameters @@ -15,7 +17,7 @@ request?(request: Request, controller: HttpInterceptController): PromiseRequest | | -| controller | HttpInterceptController | | +| controller | IHttpInterceptController | | Returns: diff --git a/docs/development/core/public/kibana-plugin-public.httpinterceptor.requesterror.md b/docs/development/core/public/kibana-plugin-public.httpinterceptor.requesterror.md index 5c95e15697c35..af9b8641e7473 100644 --- a/docs/development/core/public/kibana-plugin-public.httpinterceptor.requesterror.md +++ b/docs/development/core/public/kibana-plugin-public.httpinterceptor.requesterror.md @@ -4,10 +4,12 @@ ## HttpInterceptor.requestError() method +Define an interceptor to be executed if a request interceptor throws an error or returns a rejected Promise. + Signature: ```typescript -requestError?(httpErrorRequest: HttpErrorRequest, controller: HttpInterceptController): Promise | Request | void; +requestError?(httpErrorRequest: HttpErrorRequest, controller: IHttpInterceptController): Promise | Request | void; ``` ## Parameters @@ -15,7 +17,7 @@ requestError?(httpErrorRequest: HttpErrorRequest, controller: HttpInterceptContr | Parameter | Type | Description | | --- | --- | --- | | httpErrorRequest | HttpErrorRequest | | -| controller | HttpInterceptController | | +| controller | IHttpInterceptController | | Returns: diff --git a/docs/development/core/public/kibana-plugin-public.httpinterceptor.response.md b/docs/development/core/public/kibana-plugin-public.httpinterceptor.response.md index 01609eb2bbac7..6f4205f3362fe 100644 --- a/docs/development/core/public/kibana-plugin-public.httpinterceptor.response.md +++ b/docs/development/core/public/kibana-plugin-public.httpinterceptor.response.md @@ -4,10 +4,12 @@ ## HttpInterceptor.response() method +Define an interceptor to be executed after a response is received. + Signature: ```typescript -response?(httpResponse: HttpResponse, controller: HttpInterceptController): Promise | HttpResponse | void; +response?(httpResponse: HttpResponse, controller: IHttpInterceptController): Promise | HttpResponse | void; ``` ## Parameters @@ -15,7 +17,7 @@ response?(httpResponse: HttpResponse, controller: HttpInterceptController): Prom | Parameter | Type | Description | | --- | --- | --- | | httpResponse | HttpResponse | | -| controller | HttpInterceptController | | +| controller | IHttpInterceptController | | Returns: diff --git a/docs/development/core/public/kibana-plugin-public.httpinterceptor.responseerror.md b/docs/development/core/public/kibana-plugin-public.httpinterceptor.responseerror.md index 71e0f11205d7b..1e7cd5e61186e 100644 --- a/docs/development/core/public/kibana-plugin-public.httpinterceptor.responseerror.md +++ b/docs/development/core/public/kibana-plugin-public.httpinterceptor.responseerror.md @@ -4,10 +4,12 @@ ## HttpInterceptor.responseError() method +Define an interceptor to be executed if a response interceptor throws an error or returns a rejected Promise. + Signature: ```typescript -responseError?(httpErrorResponse: HttpErrorResponse, controller: HttpInterceptController): Promise | HttpResponse | void; +responseError?(httpErrorResponse: HttpErrorResponse, controller: IHttpInterceptController): Promise | HttpResponse | void; ``` ## Parameters @@ -15,7 +17,7 @@ responseError?(httpErrorResponse: HttpErrorResponse, controller: HttpInterceptCo | Parameter | Type | Description | | --- | --- | --- | | httpErrorResponse | HttpErrorResponse | | -| controller | HttpInterceptController | | +| controller | IHttpInterceptController | | Returns: diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.body.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.body.md index ecf8343ab529c..44b33c9917543 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.body.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.body.md @@ -4,6 +4,8 @@ ## HttpRequestInit.body property +A BodyInit object or null to set request's body. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.cache.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.cache.md index 813639b51f814..0f9dff3887ccf 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.cache.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.cache.md @@ -4,6 +4,8 @@ ## HttpRequestInit.cache property +The cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.credentials.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.credentials.md index 26e86722a8219..93c624cd1980c 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.credentials.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.credentials.md @@ -4,6 +4,8 @@ ## HttpRequestInit.credentials property +The credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.headers.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.headers.md index 2e5f86ebe38ef..0f885ed0df1a3 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.headers.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.headers.md @@ -4,6 +4,8 @@ ## HttpRequestInit.headers property +[HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md) + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.integrity.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.integrity.md index 9d8b3644aa9d7..7bb1665fdfcbe 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.integrity.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.integrity.md @@ -4,6 +4,8 @@ ## HttpRequestInit.integrity property +Subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.keepalive.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.keepalive.md index bb1a50c280dce..ba256188ce338 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.keepalive.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.keepalive.md @@ -4,6 +4,8 @@ ## HttpRequestInit.keepalive property +Whether or not request can outlive the global in which it was created. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.md index 89fa6d5379581..1271e039b0713 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.md @@ -4,6 +4,7 @@ ## HttpRequestInit interface +Fetch API options available to [HttpHandler](./kibana-plugin-public.httphandler.md)s. Signature: @@ -15,17 +16,17 @@ export interface HttpRequestInit | Property | Type | Description | | --- | --- | --- | -| [body](./kibana-plugin-public.httprequestinit.body.md) | BodyInit | null | | -| [cache](./kibana-plugin-public.httprequestinit.cache.md) | RequestCache | | -| [credentials](./kibana-plugin-public.httprequestinit.credentials.md) | RequestCredentials | | -| [headers](./kibana-plugin-public.httprequestinit.headers.md) | HttpHeadersInit | | -| [integrity](./kibana-plugin-public.httprequestinit.integrity.md) | string | | -| [keepalive](./kibana-plugin-public.httprequestinit.keepalive.md) | boolean | | -| [method](./kibana-plugin-public.httprequestinit.method.md) | string | | -| [mode](./kibana-plugin-public.httprequestinit.mode.md) | RequestMode | | -| [redirect](./kibana-plugin-public.httprequestinit.redirect.md) | RequestRedirect | | -| [referrer](./kibana-plugin-public.httprequestinit.referrer.md) | string | | -| [referrerPolicy](./kibana-plugin-public.httprequestinit.referrerpolicy.md) | ReferrerPolicy | | -| [signal](./kibana-plugin-public.httprequestinit.signal.md) | AbortSignal | null | | -| [window](./kibana-plugin-public.httprequestinit.window.md) | any | | +| [body](./kibana-plugin-public.httprequestinit.body.md) | BodyInit | null | A BodyInit object or null to set request's body. | +| [cache](./kibana-plugin-public.httprequestinit.cache.md) | RequestCache | The cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. | +| [credentials](./kibana-plugin-public.httprequestinit.credentials.md) | RequestCredentials | The credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. | +| [headers](./kibana-plugin-public.httprequestinit.headers.md) | HttpHeadersInit | [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md) | +| [integrity](./kibana-plugin-public.httprequestinit.integrity.md) | string | Subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. | +| [keepalive](./kibana-plugin-public.httprequestinit.keepalive.md) | boolean | Whether or not request can outlive the global in which it was created. | +| [method](./kibana-plugin-public.httprequestinit.method.md) | string | HTTP method, which is "GET" by default. | +| [mode](./kibana-plugin-public.httprequestinit.mode.md) | RequestMode | The mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. | +| [redirect](./kibana-plugin-public.httprequestinit.redirect.md) | RequestRedirect | The redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. | +| [referrer](./kibana-plugin-public.httprequestinit.referrer.md) | string | The referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the Referer header of the request being made. | +| [referrerPolicy](./kibana-plugin-public.httprequestinit.referrerpolicy.md) | ReferrerPolicy | The referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. | +| [signal](./kibana-plugin-public.httprequestinit.signal.md) | AbortSignal | null | Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. | +| [window](./kibana-plugin-public.httprequestinit.window.md) | null | Can only be null. Used to disassociate request from any Window. | diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.method.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.method.md index 2aab899405576..c3465ae75521d 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.method.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.method.md @@ -4,6 +4,8 @@ ## HttpRequestInit.method property +HTTP method, which is "GET" by default. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.mode.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.mode.md index 611671331ee58..5ba625318eb27 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.mode.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.mode.md @@ -4,6 +4,8 @@ ## HttpRequestInit.mode property +The mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.redirect.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.redirect.md index 6795e99d370f3..b2554812fadf9 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.redirect.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.redirect.md @@ -4,6 +4,8 @@ ## HttpRequestInit.redirect property +The redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.referrer.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.referrer.md index 60e249cc9cf1d..56c9bcb4afaa9 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.referrer.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.referrer.md @@ -4,6 +4,8 @@ ## HttpRequestInit.referrer property +The referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and "about:client" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.referrerpolicy.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.referrerpolicy.md index 3f92ee021f9cc..07231203c0030 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.referrerpolicy.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.referrerpolicy.md @@ -4,6 +4,8 @@ ## HttpRequestInit.referrerPolicy property +The referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.signal.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.signal.md index 8657c6b7a1242..b0e863eaa804f 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.signal.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.signal.md @@ -4,6 +4,8 @@ ## HttpRequestInit.signal property +Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httprequestinit.window.md b/docs/development/core/public/kibana-plugin-public.httprequestinit.window.md index aec7fad7e3927..1a6d740065423 100644 --- a/docs/development/core/public/kibana-plugin-public.httprequestinit.window.md +++ b/docs/development/core/public/kibana-plugin-public.httprequestinit.window.md @@ -4,8 +4,10 @@ ## HttpRequestInit.window property +Can only be null. Used to disassociate request from any Window. + Signature: ```typescript -window?: any; +window?: null; ``` diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.addloadingcount.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.addloadingcount.md index 0dc64a3f75443..e984fea48625d 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.addloadingcount.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.addloadingcount.md @@ -4,17 +4,19 @@ ## HttpServiceBase.addLoadingCount() method +Adds a new source of loading counts. Used to show the global loading indicator when sum of all observed counts are more than 0. + Signature: ```typescript -addLoadingCount(count$: Observable): void; +addLoadingCount(countSource$: Observable): void; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| count$ | Observable<number> | | +| countSource$ | Observable<number> | | Returns: diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.basepath.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.basepath.md index 6794199dc9dbd..6c5f690a5c607 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.basepath.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.basepath.md @@ -4,12 +4,10 @@ ## HttpServiceBase.basePath property +APIs for manipulating the basePath on URL segments. + Signature: ```typescript -basePath: { - get: () => string; - prepend: (url: string) => string; - remove: (url: string) => string; - }; +basePath: IBasePath; ``` diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.delete.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.delete.md index 55e67a50b156f..73022ef4f2946 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.delete.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.delete.md @@ -4,6 +4,8 @@ ## HttpServiceBase.delete property +Makes an HTTP request with the DELETE method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.fetch.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.fetch.md index 92936230149b6..3a1ae4892a3dd 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.fetch.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.fetch.md @@ -4,6 +4,8 @@ ## HttpServiceBase.fetch property +Makes an HTTP request. Defaults to a GET request unless overriden. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.get.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.get.md index d4b9a3810a497..a61b3dd140e50 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.get.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.get.md @@ -4,6 +4,8 @@ ## HttpServiceBase.get property +Makes an HTTP request with the GET method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.getloadingcount_.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.getloadingcount_.md index 5b04c3327fd49..0b2129330cd01 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.getloadingcount_.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.getloadingcount_.md @@ -4,6 +4,8 @@ ## HttpServiceBase.getLoadingCount$() method +Get the sum of all loading count sources as a single Observable. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.head.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.head.md index 78546d0fbb4f3..4624d95f03bf3 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.head.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.head.md @@ -4,6 +4,8 @@ ## HttpServiceBase.head property +Makes an HTTP request with the HEAD method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.intercept.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.intercept.md index 805884a21d18f..8cf5bf813df09 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.intercept.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.intercept.md @@ -4,6 +4,8 @@ ## HttpServiceBase.intercept() method +Adds a new [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md) to the global HTTP client. + Signature: ```typescript @@ -20,3 +22,5 @@ intercept(interceptor: HttpInterceptor): () => void; `() => void` +a function for removing the attached interceptor. + diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.md index 71ddb6dee20a8..a1eef3db42b7d 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.md @@ -15,23 +15,22 @@ export interface HttpServiceBase | Property | Type | Description | | --- | --- | --- | -| [basePath](./kibana-plugin-public.httpservicebase.basepath.md) | {
get: () => string;
prepend: (url: string) => string;
remove: (url: string) => string;
} | | -| [delete](./kibana-plugin-public.httpservicebase.delete.md) | HttpHandler | | -| [fetch](./kibana-plugin-public.httpservicebase.fetch.md) | HttpHandler | | -| [get](./kibana-plugin-public.httpservicebase.get.md) | HttpHandler | | -| [head](./kibana-plugin-public.httpservicebase.head.md) | HttpHandler | | -| [options](./kibana-plugin-public.httpservicebase.options.md) | HttpHandler | | -| [patch](./kibana-plugin-public.httpservicebase.patch.md) | HttpHandler | | -| [post](./kibana-plugin-public.httpservicebase.post.md) | HttpHandler | | -| [put](./kibana-plugin-public.httpservicebase.put.md) | HttpHandler | | +| [basePath](./kibana-plugin-public.httpservicebase.basepath.md) | IBasePath | APIs for manipulating the basePath on URL segments. | +| [delete](./kibana-plugin-public.httpservicebase.delete.md) | HttpHandler | Makes an HTTP request with the DELETE method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. | +| [fetch](./kibana-plugin-public.httpservicebase.fetch.md) | HttpHandler | Makes an HTTP request. Defaults to a GET request unless overriden. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. | +| [get](./kibana-plugin-public.httpservicebase.get.md) | HttpHandler | Makes an HTTP request with the GET method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. | +| [head](./kibana-plugin-public.httpservicebase.head.md) | HttpHandler | Makes an HTTP request with the HEAD method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. | +| [options](./kibana-plugin-public.httpservicebase.options.md) | HttpHandler | Makes an HTTP request with the OPTIONS method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. | +| [patch](./kibana-plugin-public.httpservicebase.patch.md) | HttpHandler | Makes an HTTP request with the PATCH method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. | +| [post](./kibana-plugin-public.httpservicebase.post.md) | HttpHandler | Makes an HTTP request with the POST method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. | +| [put](./kibana-plugin-public.httpservicebase.put.md) | HttpHandler | Makes an HTTP request with the PUT method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. | ## Methods | Method | Description | | --- | --- | -| [addLoadingCount(count$)](./kibana-plugin-public.httpservicebase.addloadingcount.md) | | -| [getLoadingCount$()](./kibana-plugin-public.httpservicebase.getloadingcount_.md) | | -| [intercept(interceptor)](./kibana-plugin-public.httpservicebase.intercept.md) | | -| [removeAllInterceptors()](./kibana-plugin-public.httpservicebase.removeallinterceptors.md) | | -| [stop()](./kibana-plugin-public.httpservicebase.stop.md) | | +| [addLoadingCount(countSource$)](./kibana-plugin-public.httpservicebase.addloadingcount.md) | Adds a new source of loading counts. Used to show the global loading indicator when sum of all observed counts are more than 0. | +| [getLoadingCount$()](./kibana-plugin-public.httpservicebase.getloadingcount_.md) | Get the sum of all loading count sources as a single Observable. | +| [intercept(interceptor)](./kibana-plugin-public.httpservicebase.intercept.md) | Adds a new [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md) to the global HTTP client. | +| [removeAllInterceptors()](./kibana-plugin-public.httpservicebase.removeallinterceptors.md) | Removes all configured interceptors. | diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.options.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.options.md index 6579a92f695a4..0820beb2752f2 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.options.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.options.md @@ -4,6 +4,8 @@ ## HttpServiceBase.options property +Makes an HTTP request with the OPTIONS method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.patch.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.patch.md index 3b81f2f863376..00e1ffc0e16bf 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.patch.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.patch.md @@ -4,6 +4,8 @@ ## HttpServiceBase.patch property +Makes an HTTP request with the PATCH method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.post.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.post.md index b990fd1458c33..3771a7c910895 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.post.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.post.md @@ -4,6 +4,8 @@ ## HttpServiceBase.post property +Makes an HTTP request with the POST method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.put.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.put.md index 3f41c6c21fec6..6e43aafa916bc 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.put.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.put.md @@ -4,6 +4,8 @@ ## HttpServiceBase.put property +Makes an HTTP request with the PUT method. See [HttpHandler](./kibana-plugin-public.httphandler.md) for options. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.removeallinterceptors.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.removeallinterceptors.md index 405baf458e516..0432ec29a22b6 100644 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.removeallinterceptors.md +++ b/docs/development/core/public/kibana-plugin-public.httpservicebase.removeallinterceptors.md @@ -4,6 +4,8 @@ ## HttpServiceBase.removeAllInterceptors() method +Removes all configured interceptors. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.httpservicebase.stop.md b/docs/development/core/public/kibana-plugin-public.httpservicebase.stop.md deleted file mode 100644 index 2a2323dbdda16..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.httpservicebase.stop.md +++ /dev/null @@ -1,15 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) > [stop](./kibana-plugin-public.httpservicebase.stop.md) - -## HttpServiceBase.stop() method - -Signature: - -```typescript -stop(): void; -``` -Returns: - -`void` - diff --git a/docs/development/core/public/kibana-plugin-public.httpsetup.md b/docs/development/core/public/kibana-plugin-public.httpsetup.md index cc8ae6ab6aac1..7ef037ea7abd1 100644 --- a/docs/development/core/public/kibana-plugin-public.httpsetup.md +++ b/docs/development/core/public/kibana-plugin-public.httpsetup.md @@ -4,6 +4,7 @@ ## HttpSetup type +See [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) Signature: diff --git a/docs/development/core/public/kibana-plugin-public.httpstart.md b/docs/development/core/public/kibana-plugin-public.httpstart.md index f70c08a1bde50..bb9247c63897a 100644 --- a/docs/development/core/public/kibana-plugin-public.httpstart.md +++ b/docs/development/core/public/kibana-plugin-public.httpstart.md @@ -4,6 +4,7 @@ ## HttpStart type +See [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) Signature: diff --git a/docs/development/core/public/kibana-plugin-public.ibasepath.get.md b/docs/development/core/public/kibana-plugin-public.ibasepath.get.md new file mode 100644 index 0000000000000..08ca3afee11f7 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ibasepath.get.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IBasePath](./kibana-plugin-public.ibasepath.md) > [get](./kibana-plugin-public.ibasepath.get.md) + +## IBasePath.get property + +Gets the `basePath` string. + +Signature: + +```typescript +get: () => string; +``` diff --git a/docs/development/core/public/kibana-plugin-public.ibasepath.md b/docs/development/core/public/kibana-plugin-public.ibasepath.md new file mode 100644 index 0000000000000..de392d45c4493 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ibasepath.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IBasePath](./kibana-plugin-public.ibasepath.md) + +## IBasePath interface + +APIs for manipulating the basePath on URL segments. + +Signature: + +```typescript +export interface IBasePath +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [get](./kibana-plugin-public.ibasepath.get.md) | () => string | Gets the basePath string. | +| [prepend](./kibana-plugin-public.ibasepath.prepend.md) | (url: string) => string | Prepends path with the basePath. | +| [remove](./kibana-plugin-public.ibasepath.remove.md) | (url: string) => string | Removes the prepended basePath from the path. | + diff --git a/docs/development/core/public/kibana-plugin-public.ibasepath.prepend.md b/docs/development/core/public/kibana-plugin-public.ibasepath.prepend.md new file mode 100644 index 0000000000000..48b909aa2f7a8 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ibasepath.prepend.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IBasePath](./kibana-plugin-public.ibasepath.md) > [prepend](./kibana-plugin-public.ibasepath.prepend.md) + +## IBasePath.prepend property + +Prepends `path` with the basePath. + +Signature: + +```typescript +prepend: (url: string) => string; +``` diff --git a/docs/development/core/public/kibana-plugin-public.ibasepath.remove.md b/docs/development/core/public/kibana-plugin-public.ibasepath.remove.md new file mode 100644 index 0000000000000..6af8564420830 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ibasepath.remove.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IBasePath](./kibana-plugin-public.ibasepath.md) > [remove](./kibana-plugin-public.ibasepath.remove.md) + +## IBasePath.remove property + +Removes the prepended basePath from the `path`. + +Signature: + +```typescript +remove: (url: string) => string; +``` diff --git a/docs/development/core/public/kibana-plugin-public.httpfetcherror.body.md b/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.body.md similarity index 53% rename from docs/development/core/public/kibana-plugin-public.httpfetcherror.body.md rename to docs/development/core/public/kibana-plugin-public.ihttpfetcherror.body.md index c373603b03569..2a5f3a68635b8 100644 --- a/docs/development/core/public/kibana-plugin-public.httpfetcherror.body.md +++ b/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.body.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpFetchError](./kibana-plugin-public.httpfetcherror.md) > [body](./kibana-plugin-public.httpfetcherror.body.md) +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpFetchError](./kibana-plugin-public.ihttpfetcherror.md) > [body](./kibana-plugin-public.ihttpfetcherror.body.md) -## HttpFetchError.body property +## IHttpFetchError.body property Signature: diff --git a/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.md b/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.md new file mode 100644 index 0000000000000..f33688affe8d5 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpFetchError](./kibana-plugin-public.ihttpfetcherror.md) + +## IHttpFetchError interface + + +Signature: + +```typescript +export interface IHttpFetchError extends Error +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [body](./kibana-plugin-public.ihttpfetcherror.body.md) | any | | +| [request](./kibana-plugin-public.ihttpfetcherror.request.md) | Request | | +| [response](./kibana-plugin-public.ihttpfetcherror.response.md) | Response | | + diff --git a/docs/development/core/public/kibana-plugin-public.httpfetcherror.request.md b/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.request.md similarity index 52% rename from docs/development/core/public/kibana-plugin-public.httpfetcherror.request.md rename to docs/development/core/public/kibana-plugin-public.ihttpfetcherror.request.md index bd469952806a2..bbb1432f13bfb 100644 --- a/docs/development/core/public/kibana-plugin-public.httpfetcherror.request.md +++ b/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.request.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpFetchError](./kibana-plugin-public.httpfetcherror.md) > [request](./kibana-plugin-public.httpfetcherror.request.md) +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpFetchError](./kibana-plugin-public.ihttpfetcherror.md) > [request](./kibana-plugin-public.ihttpfetcherror.request.md) -## HttpFetchError.request property +## IHttpFetchError.request property Signature: diff --git a/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.response.md b/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.response.md new file mode 100644 index 0000000000000..c5efc1cc3858c --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ihttpfetcherror.response.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpFetchError](./kibana-plugin-public.ihttpfetcherror.md) > [response](./kibana-plugin-public.ihttpfetcherror.response.md) + +## IHttpFetchError.response property + +Signature: + +```typescript +readonly response?: Response; +``` diff --git a/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.halt.md b/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.halt.md new file mode 100644 index 0000000000000..6bd3e2e397b91 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.halt.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpInterceptController](./kibana-plugin-public.ihttpinterceptcontroller.md) > [halt](./kibana-plugin-public.ihttpinterceptcontroller.halt.md) + +## IHttpInterceptController.halt() method + +Halt the request Promise chain and do not process further interceptors or response handlers. + +Signature: + +```typescript +halt(): void; +``` +Returns: + +`void` + diff --git a/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.halted.md b/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.halted.md new file mode 100644 index 0000000000000..2e61e8da56e6f --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.halted.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpInterceptController](./kibana-plugin-public.ihttpinterceptcontroller.md) > [halted](./kibana-plugin-public.ihttpinterceptcontroller.halted.md) + +## IHttpInterceptController.halted property + +Whether or not this chain has been halted. + +Signature: + +```typescript +halted: boolean; +``` diff --git a/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.md b/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.md new file mode 100644 index 0000000000000..b07d9fceb91f0 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.ihttpinterceptcontroller.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IHttpInterceptController](./kibana-plugin-public.ihttpinterceptcontroller.md) + +## IHttpInterceptController interface + +Used to halt a request Promise chain in a [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md). + +Signature: + +```typescript +export interface IHttpInterceptController +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [halted](./kibana-plugin-public.ihttpinterceptcontroller.halted.md) | boolean | Whether or not this chain has been halted. | + +## Methods + +| Method | Description | +| --- | --- | +| [halt()](./kibana-plugin-public.ihttpinterceptcontroller.halt.md) | Halt the request Promise chain and do not process further interceptors or response handlers. | + diff --git a/docs/development/core/public/kibana-plugin-public.itoasts.md b/docs/development/core/public/kibana-plugin-public.itoasts.md new file mode 100644 index 0000000000000..2a6d454e2194a --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.itoasts.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [IToasts](./kibana-plugin-public.itoasts.md) + +## IToasts type + +Methods for adding and removing global toast messages. See [ToastsApi](./kibana-plugin-public.toastsapi.md). + +Signature: + +```typescript +export declare type IToasts = Pick; +``` diff --git a/docs/development/core/public/kibana-plugin-public.md b/docs/development/core/public/kibana-plugin-public.md index f55705fb2faef..3adf68ffb35a8 100644 --- a/docs/development/core/public/kibana-plugin-public.md +++ b/docs/development/core/public/kibana-plugin-public.md @@ -14,11 +14,9 @@ The plugin integrates with the core system via lifecycle events: `setup` | Class | Description | | --- | --- | -| [HttpFetchError](./kibana-plugin-public.httpfetcherror.md) | | -| [HttpInterceptController](./kibana-plugin-public.httpinterceptcontroller.md) | | | [SavedObjectsClient](./kibana-plugin-public.savedobjectsclient.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state. The client-side SavedObjectsClient is a thin convenience library around the SavedObjects HTTP API for interacting with Saved Objects. | | [SimpleSavedObject](./kibana-plugin-public.simplesavedobject.md) | This class is a very simple wrapper for SavedObjects loaded from the server with the [SavedObjectsClient](./kibana-plugin-public.savedobjectsclient.md).It provides basic functionality for creating/saving/deleting saved objects, but doesn't include any type-specific implementations. | -| [ToastsApi](./kibana-plugin-public.toastsapi.md) | | +| [ToastsApi](./kibana-plugin-public.toastsapi.md) | Methods for adding and removing global toast messages. | | [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) | | ## Interfaces @@ -34,7 +32,6 @@ The plugin integrates with the core system via lifecycle events: `setup` | [Capabilities](./kibana-plugin-public.capabilities.md) | The read-only set of capabilities available for the current UI session. Capabilities are simple key-value pairs of (string, boolean), where the string denotes the capability ID, and the boolean is a flag indicating if the capability is enabled or disabled. | | [ChromeBadge](./kibana-plugin-public.chromebadge.md) | | | [ChromeBrand](./kibana-plugin-public.chromebrand.md) | | -| [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) | | | [ChromeNavControl](./kibana-plugin-public.chromenavcontrol.md) | | | [ChromeNavControls](./kibana-plugin-public.chromenavcontrols.md) | [APIs](./kibana-plugin-public.chromenavcontrols.md) for registering new controls to be displayed in the navigation bar. | | [ChromeNavLink](./kibana-plugin-public.chromenavlink.md) | | @@ -46,28 +43,33 @@ The plugin integrates with the core system via lifecycle events: `setup` | [CoreSetup](./kibana-plugin-public.coresetup.md) | Core services exposed to the Plugin setup lifecycle | | [CoreStart](./kibana-plugin-public.corestart.md) | Core services exposed to the Plugin start lifecycle | | [DocLinksStart](./kibana-plugin-public.doclinksstart.md) | | -| [ErrorToastOptions](./kibana-plugin-public.errortoastoptions.md) | | +| [EnvironmentMode](./kibana-plugin-public.environmentmode.md) | | +| [ErrorToastOptions](./kibana-plugin-public.errortoastoptions.md) | Options available for [IToasts](./kibana-plugin-public.itoasts.md) APIs. | | [FatalErrorInfo](./kibana-plugin-public.fatalerrorinfo.md) | Represents the message and stack of a fatal Error | | [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md) | FatalErrors stop the Kibana Public Core and displays a fatal error screen with details about the Kibana build and the error. | | [HttpErrorRequest](./kibana-plugin-public.httperrorrequest.md) | | | [HttpErrorResponse](./kibana-plugin-public.httperrorresponse.md) | | -| [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) | | +| [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) | All options that may be used with a [HttpHandler](./kibana-plugin-public.httphandler.md). | | [HttpFetchQuery](./kibana-plugin-public.httpfetchquery.md) | | | [HttpHeadersInit](./kibana-plugin-public.httpheadersinit.md) | | -| [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md) | | -| [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) | | +| [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md) | An object that may define global interceptor functions for different parts of the request and response lifecycle. See [IHttpInterceptController](./kibana-plugin-public.ihttpinterceptcontroller.md). | +| [HttpRequestInit](./kibana-plugin-public.httprequestinit.md) | Fetch API options available to [HttpHandler](./kibana-plugin-public.httphandler.md)s. | | [HttpResponse](./kibana-plugin-public.httpresponse.md) | | | [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) | | | [I18nStart](./kibana-plugin-public.i18nstart.md) | I18nStart.Context is required by any localizable React component from @kbn/i18n and @elastic/eui packages and is supposed to be used as the topmost component for any i18n-compatible React tree. | +| [IBasePath](./kibana-plugin-public.ibasepath.md) | APIs for manipulating the basePath on URL segments. | | [IContextContainer](./kibana-plugin-public.icontextcontainer.md) | An object that handles registration of context providers and configuring handlers with context. | +| [IHttpFetchError](./kibana-plugin-public.ihttpfetcherror.md) | | +| [IHttpInterceptController](./kibana-plugin-public.ihttpinterceptcontroller.md) | Used to halt a request Promise chain in a [HttpInterceptor](./kibana-plugin-public.httpinterceptor.md). | | [LegacyCoreSetup](./kibana-plugin-public.legacycoresetup.md) | Setup interface exposed to the legacy platform via the ui/new_platform module. | | [LegacyCoreStart](./kibana-plugin-public.legacycorestart.md) | Start interface exposed to the legacy platform via the ui/new_platform module. | | [LegacyNavLink](./kibana-plugin-public.legacynavlink.md) | | | [NotificationsSetup](./kibana-plugin-public.notificationssetup.md) | | | [NotificationsStart](./kibana-plugin-public.notificationsstart.md) | | | [OverlayBannersStart](./kibana-plugin-public.overlaybannersstart.md) | | -| [OverlayRef](./kibana-plugin-public.overlayref.md) | | +| [OverlayRef](./kibana-plugin-public.overlayref.md) | Returned by [OverlayStart](./kibana-plugin-public.overlaystart.md) methods for closing a mounted overlay. | | [OverlayStart](./kibana-plugin-public.overlaystart.md) | | +| [PackageInfo](./kibana-plugin-public.packageinfo.md) | | | [Plugin](./kibana-plugin-public.plugin.md) | The interface that should be returned by a PluginInitializer. | | [PluginInitializerContext](./kibana-plugin-public.plugininitializercontext.md) | The available core services passed to a PluginInitializer | | [SavedObject](./kibana-plugin-public.savedobject.md) | | @@ -90,16 +92,18 @@ The plugin integrates with the core system via lifecycle events: `setup` | Type Alias | Description | | --- | --- | | [AppUnmount](./kibana-plugin-public.appunmount.md) | A function called when an application should be unmounted from the page. This function should be synchronous. | +| [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) | | | [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) | | +| [HttpHandler](./kibana-plugin-public.httphandler.md) | A function for making an HTTP requests to Kibana's backend. See [HttpFetchOptions](./kibana-plugin-public.httpfetchoptions.md) for options and [HttpBody](./kibana-plugin-public.httpbody.md) for the response. | +| [HttpSetup](./kibana-plugin-public.httpsetup.md) | See [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) | +| [HttpStart](./kibana-plugin-public.httpstart.md) | See [HttpServiceBase](./kibana-plugin-public.httpservicebase.md) | | [IContextProvider](./kibana-plugin-public.icontextprovider.md) | A function that returns a context value for a specific key of given context type. | +| [IToasts](./kibana-plugin-public.itoasts.md) | Methods for adding and removing global toast messages. See [ToastsApi](./kibana-plugin-public.toastsapi.md). | | [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. | | [PluginInitializer](./kibana-plugin-public.plugininitializer.md) | The plugin export at the root of a plugin's public directory should conform to this interface. | @@ -108,6 +112,9 @@ The plugin integrates with the core system via lifecycle events: `setup` | [SavedObjectAttribute](./kibana-plugin-public.savedobjectattribute.md) | Type definition for a Saved Object attribute value | | [SavedObjectAttributeSingle](./kibana-plugin-public.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-public.savedobjectattribute.md) | | [SavedObjectsClientContract](./kibana-plugin-public.savedobjectsclientcontract.md) | SavedObjectsClientContract as implemented by the [SavedObjectsClient](./kibana-plugin-public.savedobjectsclient.md) | -| [ToastInput](./kibana-plugin-public.toastinput.md) | | +| [ToastInput](./kibana-plugin-public.toastinput.md) | Inputs for [IToasts](./kibana-plugin-public.itoasts.md) APIs. | +| [ToastInputFields](./kibana-plugin-public.toastinputfields.md) | Allowed fields for [ToastInput](./kibana-plugin-public.toastinput.md). | +| [ToastsSetup](./kibana-plugin-public.toastssetup.md) | [IToasts](./kibana-plugin-public.itoasts.md) | +| [ToastsStart](./kibana-plugin-public.toastsstart.md) | [IToasts](./kibana-plugin-public.itoasts.md) | | [UiSettingsClientContract](./kibana-plugin-public.uisettingsclientcontract.md) | [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) | diff --git a/docs/development/core/public/kibana-plugin-public.notificationssetup.md b/docs/development/core/public/kibana-plugin-public.notificationssetup.md index 7d9dd2e89f851..c03abf9d01dca 100644 --- a/docs/development/core/public/kibana-plugin-public.notificationssetup.md +++ b/docs/development/core/public/kibana-plugin-public.notificationssetup.md @@ -15,5 +15,5 @@ export interface NotificationsSetup | Property | Type | Description | | --- | --- | --- | -| [toasts](./kibana-plugin-public.notificationssetup.toasts.md) | ToastsSetup | | +| [toasts](./kibana-plugin-public.notificationssetup.toasts.md) | ToastsSetup | [ToastsSetup](./kibana-plugin-public.toastssetup.md) | diff --git a/docs/development/core/public/kibana-plugin-public.notificationssetup.toasts.md b/docs/development/core/public/kibana-plugin-public.notificationssetup.toasts.md index c44ec9ca93e65..dd613a959061e 100644 --- a/docs/development/core/public/kibana-plugin-public.notificationssetup.toasts.md +++ b/docs/development/core/public/kibana-plugin-public.notificationssetup.toasts.md @@ -4,6 +4,8 @@ ## NotificationsSetup.toasts property +[ToastsSetup](./kibana-plugin-public.toastssetup.md) + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.notificationsstart.md b/docs/development/core/public/kibana-plugin-public.notificationsstart.md index acab2d6884418..56a1ce2095742 100644 --- a/docs/development/core/public/kibana-plugin-public.notificationsstart.md +++ b/docs/development/core/public/kibana-plugin-public.notificationsstart.md @@ -15,5 +15,5 @@ export interface NotificationsStart | Property | Type | Description | | --- | --- | --- | -| [toasts](./kibana-plugin-public.notificationsstart.toasts.md) | ToastsStart | | +| [toasts](./kibana-plugin-public.notificationsstart.toasts.md) | ToastsStart | [ToastsStart](./kibana-plugin-public.toastsstart.md) | diff --git a/docs/development/core/public/kibana-plugin-public.notificationsstart.toasts.md b/docs/development/core/public/kibana-plugin-public.notificationsstart.toasts.md index db2be3dad8351..9d2c685946fda 100644 --- a/docs/development/core/public/kibana-plugin-public.notificationsstart.toasts.md +++ b/docs/development/core/public/kibana-plugin-public.notificationsstart.toasts.md @@ -4,6 +4,8 @@ ## NotificationsStart.toasts property +[ToastsStart](./kibana-plugin-public.toastsstart.md) + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.overlayref.md b/docs/development/core/public/kibana-plugin-public.overlayref.md index ba573ccf10bbe..e71415280e4d2 100644 --- a/docs/development/core/public/kibana-plugin-public.overlayref.md +++ b/docs/development/core/public/kibana-plugin-public.overlayref.md @@ -4,6 +4,8 @@ ## OverlayRef interface +Returned by [OverlayStart](./kibana-plugin-public.overlaystart.md) methods for closing a mounted overlay. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.packageinfo.branch.md b/docs/development/core/public/kibana-plugin-public.packageinfo.branch.md new file mode 100644 index 0000000000000..774a290969938 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.packageinfo.branch.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [PackageInfo](./kibana-plugin-public.packageinfo.md) > [branch](./kibana-plugin-public.packageinfo.branch.md) + +## PackageInfo.branch property + +Signature: + +```typescript +branch: string; +``` diff --git a/docs/development/core/public/kibana-plugin-public.packageinfo.buildnum.md b/docs/development/core/public/kibana-plugin-public.packageinfo.buildnum.md new file mode 100644 index 0000000000000..0c1003f8d8aff --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.packageinfo.buildnum.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [PackageInfo](./kibana-plugin-public.packageinfo.md) > [buildNum](./kibana-plugin-public.packageinfo.buildnum.md) + +## PackageInfo.buildNum property + +Signature: + +```typescript +buildNum: number; +``` diff --git a/docs/development/core/public/kibana-plugin-public.packageinfo.buildsha.md b/docs/development/core/public/kibana-plugin-public.packageinfo.buildsha.md new file mode 100644 index 0000000000000..98a7916c142e9 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.packageinfo.buildsha.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [PackageInfo](./kibana-plugin-public.packageinfo.md) > [buildSha](./kibana-plugin-public.packageinfo.buildsha.md) + +## PackageInfo.buildSha property + +Signature: + +```typescript +buildSha: string; +``` diff --git a/docs/development/core/public/kibana-plugin-public.packageinfo.dist.md b/docs/development/core/public/kibana-plugin-public.packageinfo.dist.md new file mode 100644 index 0000000000000..c70299bbe6fcc --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.packageinfo.dist.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [PackageInfo](./kibana-plugin-public.packageinfo.md) > [dist](./kibana-plugin-public.packageinfo.dist.md) + +## PackageInfo.dist property + +Signature: + +```typescript +dist: boolean; +``` diff --git a/docs/development/core/public/kibana-plugin-public.packageinfo.md b/docs/development/core/public/kibana-plugin-public.packageinfo.md new file mode 100644 index 0000000000000..1dbd8cb85c56b --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.packageinfo.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [PackageInfo](./kibana-plugin-public.packageinfo.md) + +## PackageInfo interface + + +Signature: + +```typescript +export interface PackageInfo +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [branch](./kibana-plugin-public.packageinfo.branch.md) | string | | +| [buildNum](./kibana-plugin-public.packageinfo.buildnum.md) | number | | +| [buildSha](./kibana-plugin-public.packageinfo.buildsha.md) | string | | +| [dist](./kibana-plugin-public.packageinfo.dist.md) | boolean | | +| [version](./kibana-plugin-public.packageinfo.version.md) | string | | + diff --git a/docs/development/core/public/kibana-plugin-public.packageinfo.version.md b/docs/development/core/public/kibana-plugin-public.packageinfo.version.md new file mode 100644 index 0000000000000..26def753e424a --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.packageinfo.version.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [PackageInfo](./kibana-plugin-public.packageinfo.md) > [version](./kibana-plugin-public.packageinfo.version.md) + +## PackageInfo.version property + +Signature: + +```typescript +version: string; +``` diff --git a/docs/development/core/public/kibana-plugin-public.plugininitializercontext.env.md b/docs/development/core/public/kibana-plugin-public.plugininitializercontext.env.md new file mode 100644 index 0000000000000..92f36ab64a1d6 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.plugininitializercontext.env.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [PluginInitializerContext](./kibana-plugin-public.plugininitializercontext.md) > [env](./kibana-plugin-public.plugininitializercontext.env.md) + +## PluginInitializerContext.env property + +Signature: + +```typescript +readonly env: { + mode: Readonly; + packageInfo: Readonly; + }; +``` diff --git a/docs/development/core/public/kibana-plugin-public.plugininitializercontext.md b/docs/development/core/public/kibana-plugin-public.plugininitializercontext.md index 3ad220349c45c..87c39a502040d 100644 --- a/docs/development/core/public/kibana-plugin-public.plugininitializercontext.md +++ b/docs/development/core/public/kibana-plugin-public.plugininitializercontext.md @@ -16,5 +16,6 @@ export interface PluginInitializerContext | Property | Type | Description | | --- | --- | --- | +| [env](./kibana-plugin-public.plugininitializercontext.env.md) | {
mode: Readonly<EnvironmentMode>;
packageInfo: Readonly<PackageInfo>;
} | | | [opaqueId](./kibana-plugin-public.plugininitializercontext.opaqueid.md) | PluginOpaqueId | A symbol used to identify this plugin in the system. Needed when registering handlers or context providers. | diff --git a/docs/development/core/public/kibana-plugin-public.toastinput.md b/docs/development/core/public/kibana-plugin-public.toastinput.md index 8e798697fa6c0..75f12b3d94561 100644 --- a/docs/development/core/public/kibana-plugin-public.toastinput.md +++ b/docs/development/core/public/kibana-plugin-public.toastinput.md @@ -4,6 +4,7 @@ ## ToastInput type +Inputs for [IToasts](./kibana-plugin-public.itoasts.md) APIs. Signature: diff --git a/docs/development/core/public/kibana-plugin-public.toastinputfields.md b/docs/development/core/public/kibana-plugin-public.toastinputfields.md new file mode 100644 index 0000000000000..ffcf9e5c6dea2 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.toastinputfields.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastInputFields](./kibana-plugin-public.toastinputfields.md) + +## ToastInputFields type + +Allowed fields for [ToastInput](./kibana-plugin-public.toastinput.md). + +Signature: + +```typescript +export declare type ToastInputFields = Pick>; +``` + +## Remarks + +`id` cannot be specified. + diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.add.md b/docs/development/core/public/kibana-plugin-public.toastsapi.add.md index a59c11d0d5f53..8e9648031f0e2 100644 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.add.md +++ b/docs/development/core/public/kibana-plugin-public.toastsapi.add.md @@ -4,6 +4,8 @@ ## ToastsApi.add() method +Adds a new toast to current array of toast. + Signature: ```typescript @@ -14,9 +16,11 @@ add(toastOrTitle: ToastInput): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-public.toastinput.md) | Returns: `Toast` +a + diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.adddanger.md b/docs/development/core/public/kibana-plugin-public.toastsapi.adddanger.md index 3f9e6b1c389da..28e596f0c09e3 100644 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.adddanger.md +++ b/docs/development/core/public/kibana-plugin-public.toastsapi.adddanger.md @@ -4,6 +4,8 @@ ## ToastsApi.addDanger() method +Adds a new toast pre-configured with the danger color and alert icon. + Signature: ```typescript @@ -14,9 +16,11 @@ addDanger(toastOrTitle: ToastInput): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-public.toastinput.md) | Returns: `Toast` +a + diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.adderror.md b/docs/development/core/public/kibana-plugin-public.toastsapi.adderror.md index 10aaf50ebab4d..c8a48b3fa46c9 100644 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.adderror.md +++ b/docs/development/core/public/kibana-plugin-public.toastsapi.adderror.md @@ -4,6 +4,8 @@ ## ToastsApi.addError() method +Adds a new toast that displays an exception message with a button to open the full stacktrace in a modal. + Signature: ```typescript @@ -14,10 +16,12 @@ addError(error: Error, options: ErrorToastOptions): Toast; | Parameter | Type | Description | | --- | --- | --- | -| error | Error | | -| options | ErrorToastOptions | | +| error | Error | an Error instance. | +| options | ErrorToastOptions | [ErrorToastOptions](./kibana-plugin-public.errortoastoptions.md) | Returns: `Toast` +a + diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.addsuccess.md b/docs/development/core/public/kibana-plugin-public.toastsapi.addsuccess.md index 5aff3229b3c81..0e01dc1364d07 100644 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.addsuccess.md +++ b/docs/development/core/public/kibana-plugin-public.toastsapi.addsuccess.md @@ -4,6 +4,8 @@ ## ToastsApi.addSuccess() method +Adds a new toast pre-configured with the success color and check icon. + Signature: ```typescript @@ -14,9 +16,11 @@ addSuccess(toastOrTitle: ToastInput): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-public.toastinput.md) | Returns: `Toast` +a + diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.addwarning.md b/docs/development/core/public/kibana-plugin-public.toastsapi.addwarning.md index 3b68f0b7fe22a..0e236f2737b12 100644 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.addwarning.md +++ b/docs/development/core/public/kibana-plugin-public.toastsapi.addwarning.md @@ -4,6 +4,8 @@ ## ToastsApi.addWarning() method +Adds a new toast pre-configured with the warning color and help icon. + Signature: ```typescript @@ -14,9 +16,11 @@ addWarning(toastOrTitle: ToastInput): Toast; | Parameter | Type | Description | | --- | --- | --- | -| toastOrTitle | ToastInput | | +| toastOrTitle | ToastInput | a [ToastInput](./kibana-plugin-public.toastinput.md) | Returns: `Toast` +a + diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.get_.md b/docs/development/core/public/kibana-plugin-public.toastsapi.get_.md index 1761fa21b70e8..48e4fdc7a2ec0 100644 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.get_.md +++ b/docs/development/core/public/kibana-plugin-public.toastsapi.get_.md @@ -4,6 +4,8 @@ ## ToastsApi.get$() method +Observable of the toast messages to show to the user. + Signature: ```typescript diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.md b/docs/development/core/public/kibana-plugin-public.toastsapi.md index 1d5e0382d9465..e47f6d5c8ac59 100644 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.md +++ b/docs/development/core/public/kibana-plugin-public.toastsapi.md @@ -4,11 +4,12 @@ ## ToastsApi class +Methods for adding and removing global toast messages. Signature: ```typescript -export declare class ToastsApi +export declare class ToastsApi implements IToasts ``` ## Constructors @@ -21,12 +22,11 @@ export declare class ToastsApi | Method | Modifiers | Description | | --- | --- | --- | -| [add(toastOrTitle)](./kibana-plugin-public.toastsapi.add.md) | | | -| [addDanger(toastOrTitle)](./kibana-plugin-public.toastsapi.adddanger.md) | | | -| [addError(error, options)](./kibana-plugin-public.toastsapi.adderror.md) | | | -| [addSuccess(toastOrTitle)](./kibana-plugin-public.toastsapi.addsuccess.md) | | | -| [addWarning(toastOrTitle)](./kibana-plugin-public.toastsapi.addwarning.md) | | | -| [get$()](./kibana-plugin-public.toastsapi.get_.md) | | | -| [registerOverlays(overlays)](./kibana-plugin-public.toastsapi.registeroverlays.md) | | | -| [remove(toast)](./kibana-plugin-public.toastsapi.remove.md) | | | +| [add(toastOrTitle)](./kibana-plugin-public.toastsapi.add.md) | | Adds a new toast to current array of toast. | +| [addDanger(toastOrTitle)](./kibana-plugin-public.toastsapi.adddanger.md) | | Adds a new toast pre-configured with the danger color and alert icon. | +| [addError(error, options)](./kibana-plugin-public.toastsapi.adderror.md) | | Adds a new toast that displays an exception message with a button to open the full stacktrace in a modal. | +| [addSuccess(toastOrTitle)](./kibana-plugin-public.toastsapi.addsuccess.md) | | Adds a new toast pre-configured with the success color and check icon. | +| [addWarning(toastOrTitle)](./kibana-plugin-public.toastsapi.addwarning.md) | | Adds a new toast pre-configured with the warning color and help icon. | +| [get$()](./kibana-plugin-public.toastsapi.get_.md) | | Observable of the toast messages to show to the user. | +| [remove(toast)](./kibana-plugin-public.toastsapi.remove.md) | | Removes a toast from the current array of toasts if present. | diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.registeroverlays.md b/docs/development/core/public/kibana-plugin-public.toastsapi.registeroverlays.md deleted file mode 100644 index 31601e9b215bc..0000000000000 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.registeroverlays.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsApi](./kibana-plugin-public.toastsapi.md) > [registerOverlays](./kibana-plugin-public.toastsapi.registeroverlays.md) - -## ToastsApi.registerOverlays() method - -Signature: - -```typescript -registerOverlays(overlays: OverlayStart): void; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| overlays | OverlayStart | | - -Returns: - -`void` - diff --git a/docs/development/core/public/kibana-plugin-public.toastsapi.remove.md b/docs/development/core/public/kibana-plugin-public.toastsapi.remove.md index 822677a42b630..5025c83a666c8 100644 --- a/docs/development/core/public/kibana-plugin-public.toastsapi.remove.md +++ b/docs/development/core/public/kibana-plugin-public.toastsapi.remove.md @@ -4,6 +4,8 @@ ## ToastsApi.remove() method +Removes a toast from the current array of toasts if present. + Signature: ```typescript @@ -14,7 +16,7 @@ remove(toast: Toast): void; | Parameter | Type | Description | | --- | --- | --- | -| toast | Toast | | +| toast | Toast | a returned by | Returns: diff --git a/docs/development/core/public/kibana-plugin-public.toastssetup.md b/docs/development/core/public/kibana-plugin-public.toastssetup.md new file mode 100644 index 0000000000000..e06dd7f7093bb --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.toastssetup.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsSetup](./kibana-plugin-public.toastssetup.md) + +## ToastsSetup type + +[IToasts](./kibana-plugin-public.itoasts.md) + +Signature: + +```typescript +export declare type ToastsSetup = IToasts; +``` diff --git a/docs/development/core/public/kibana-plugin-public.toastsstart.md b/docs/development/core/public/kibana-plugin-public.toastsstart.md new file mode 100644 index 0000000000000..6e090dcdc64fb --- /dev/null +++ b/docs/development/core/public/kibana-plugin-public.toastsstart.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsStart](./kibana-plugin-public.toastsstart.md) + +## ToastsStart type + +[IToasts](./kibana-plugin-public.itoasts.md) + +Signature: + +```typescript +export declare type ToastsStart = IToasts; +``` diff --git a/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.md b/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.md index 8e8dfb07ca08a..398fe62ce2479 100644 --- a/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.md +++ b/docs/development/core/server/kibana-plugin-server.assistanceapiresponse.md @@ -4,6 +4,7 @@ ## AssistanceAPIResponse interface + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.md b/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.md index eb03b943a30ef..cf7ca56c8a75e 100644 --- a/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.md +++ b/docs/development/core/server/kibana-plugin-server.assistantapiclientparams.md @@ -4,6 +4,7 @@ ## AssistantAPIClientParams interface + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.authenticated.md b/docs/development/core/server/kibana-plugin-server.authenticated.md new file mode 100644 index 0000000000000..d955f1f32f1f7 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authenticated.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [Authenticated](./kibana-plugin-server.authenticated.md) + +## Authenticated interface + + +Signature: + +```typescript +export interface Authenticated extends AuthResultParams +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [type](./kibana-plugin-server.authenticated.type.md) | AuthResultType.authenticated | | + diff --git a/docs/development/core/server/kibana-plugin-server.authenticated.type.md b/docs/development/core/server/kibana-plugin-server.authenticated.type.md new file mode 100644 index 0000000000000..08a73e812d157 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authenticated.type.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [Authenticated](./kibana-plugin-server.authenticated.md) > [type](./kibana-plugin-server.authenticated.type.md) + +## Authenticated.type property + +Signature: + +```typescript +type: AuthResultType.authenticated; +``` diff --git a/docs/development/core/server/kibana-plugin-server.authenticationhandler.md b/docs/development/core/server/kibana-plugin-server.authenticationhandler.md index ced5cfd9413ec..ff60e6e811ed6 100644 --- a/docs/development/core/server/kibana-plugin-server.authenticationhandler.md +++ b/docs/development/core/server/kibana-plugin-server.authenticationhandler.md @@ -4,9 +4,10 @@ ## AuthenticationHandler type +See [AuthToolkit](./kibana-plugin-server.authtoolkit.md). Signature: ```typescript -export declare type AuthenticationHandler = (request: KibanaRequest, response: LifecycleResponseFactory, toolkit: AuthToolkit) => AuthResult | KibanaResponse | Promise; +export declare type AuthenticationHandler = (request: KibanaRequest, response: LifecycleResponseFactory, toolkit: AuthToolkit) => AuthResult | IKibanaResponse | Promise; ``` diff --git a/docs/development/core/server/kibana-plugin-server.authresult.md b/docs/development/core/server/kibana-plugin-server.authresult.md new file mode 100644 index 0000000000000..5d1bdbc8e7118 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authresult.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthResult](./kibana-plugin-server.authresult.md) + +## AuthResult type + + +Signature: + +```typescript +export declare type AuthResult = Authenticated; +``` diff --git a/docs/development/core/server/kibana-plugin-server.authresulttype.md b/docs/development/core/server/kibana-plugin-server.authresulttype.md new file mode 100644 index 0000000000000..e8962cb14d198 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.authresulttype.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [AuthResultType](./kibana-plugin-server.authresulttype.md) + +## AuthResultType enum + + +Signature: + +```typescript +export declare enum AuthResultType +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| authenticated | "authenticated" | | + diff --git a/docs/development/core/server/kibana-plugin-server.basepath.md b/docs/development/core/server/kibana-plugin-server.basepath.md index bfa1ea02aec17..da833c71bf93b 100644 --- a/docs/development/core/server/kibana-plugin-server.basepath.md +++ b/docs/development/core/server/kibana-plugin-server.basepath.md @@ -17,8 +17,8 @@ export declare class BasePath | Property | Modifiers | Type | Description | | --- | --- | --- | --- | | [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. | +| [prepend](./kibana-plugin-server.basepath.prepend.md) | | (path: string) => string | Prepends path with the basePath. | +| [remove](./kibana-plugin-server.basepath.remove.md) | | (path: string) => string | Removes the prepended basePath from the path. | | [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: LegacyRequest | KibanaRequest<unknown, unknown, unknown>, requestSpecificBasePath: string) => void | sets basePath value, specific for an incoming request. | diff --git a/docs/development/core/server/kibana-plugin-server.basepath.prepend.md b/docs/development/core/server/kibana-plugin-server.basepath.prepend.md index 113e8d9bf4880..9a615dfe80f32 100644 --- a/docs/development/core/server/kibana-plugin-server.basepath.prepend.md +++ b/docs/development/core/server/kibana-plugin-server.basepath.prepend.md @@ -4,7 +4,7 @@ ## BasePath.prepend property -returns a new `basePath` value, prefixed with passed `url`. +Prepends `path` with the basePath. Signature: diff --git a/docs/development/core/server/kibana-plugin-server.basepath.remove.md b/docs/development/core/server/kibana-plugin-server.basepath.remove.md index c5f1092d2969d..8fcfbc2b921d3 100644 --- a/docs/development/core/server/kibana-plugin-server.basepath.remove.md +++ b/docs/development/core/server/kibana-plugin-server.basepath.remove.md @@ -4,7 +4,7 @@ ## BasePath.remove property -returns a new `basePath` value, cleaned up from passed `url`. +Removes the prepended basePath from the `path`. Signature: diff --git a/docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md b/docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md index f87fc34bdc45f..ed7d028a1ec8a 100644 --- a/docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md +++ b/docs/development/core/server/kibana-plugin-server.clusterclient.asscoped.md @@ -4,7 +4,7 @@ ## ClusterClient.asScoped() method -Creates an instance of `ScopedClusterClient` based on the configuration the current cluster client that exposes additional `callAsCurrentUser` method scoped to the provided req. Consumers shouldn't worry about closing scoped client instances, these will be automatically closed as soon as the original cluster client isn't needed anymore and closed. +Creates an instance of [IScopedClusterClient](./kibana-plugin-server.iscopedclusterclient.md) based on the configuration the current cluster client that exposes additional `callAsCurrentUser` method scoped to the provided req. Consumers shouldn't worry about closing scoped client instances, these will be automatically closed as soon as the original cluster client isn't needed anymore and closed. Signature: @@ -16,7 +16,7 @@ asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): IScopedClusterC | Parameter | Type | Description | | --- | --- | --- | -| request | KibanaRequest | LegacyRequest | FakeRequest | Request the ScopedClusterClient instance will be scoped to. Supports request optionality, Legacy.Request & FakeRequest for BWC with LegacyPlatform | +| request | KibanaRequest | LegacyRequest | FakeRequest | Request the IScopedClusterClient instance will be scoped to. Supports request optionality, Legacy.Request & FakeRequest for BWC with LegacyPlatform | Returns: diff --git a/docs/development/core/server/kibana-plugin-server.clusterclient.callasinternaluser.md b/docs/development/core/server/kibana-plugin-server.clusterclient.callasinternaluser.md index 74003189c765d..7afb6afa4bc3b 100644 --- a/docs/development/core/server/kibana-plugin-server.clusterclient.callasinternaluser.md +++ b/docs/development/core/server/kibana-plugin-server.clusterclient.callasinternaluser.md @@ -4,7 +4,7 @@ ## ClusterClient.callAsInternalUser property -Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. +Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. See [APICaller](./kibana-plugin-server.apicaller.md). Signature: diff --git a/docs/development/core/server/kibana-plugin-server.clusterclient.md b/docs/development/core/server/kibana-plugin-server.clusterclient.md index 6288bc0a07c11..5fdda7ef3e499 100644 --- a/docs/development/core/server/kibana-plugin-server.clusterclient.md +++ b/docs/development/core/server/kibana-plugin-server.clusterclient.md @@ -24,12 +24,12 @@ export declare class ClusterClient implements IClusterClient | Property | Modifiers | Type | Description | | --- | --- | --- | --- | -| [callAsInternalUser](./kibana-plugin-server.clusterclient.callasinternaluser.md) | | APICaller | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. | +| [callAsInternalUser](./kibana-plugin-server.clusterclient.callasinternaluser.md) | | APICaller | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. See [APICaller](./kibana-plugin-server.apicaller.md). | ## Methods | Method | Modifiers | Description | | --- | --- | --- | -| [asScoped(request)](./kibana-plugin-server.clusterclient.asscoped.md) | | Creates an instance of ScopedClusterClient based on the configuration the current cluster client that exposes additional callAsCurrentUser method scoped to the provided req. Consumers shouldn't worry about closing scoped client instances, these will be automatically closed as soon as the original cluster client isn't needed anymore and closed. | +| [asScoped(request)](./kibana-plugin-server.clusterclient.asscoped.md) | | Creates an instance of [IScopedClusterClient](./kibana-plugin-server.iscopedclusterclient.md) based on the configuration the current cluster client that exposes additional callAsCurrentUser method scoped to the provided req. Consumers shouldn't worry about closing scoped client instances, these will be automatically closed as soon as the original cluster client isn't needed anymore and closed. | | [close()](./kibana-plugin-server.clusterclient.close.md) | | Closes the cluster client. After that client cannot be used and one should create a new client instance to be able to interact with Elasticsearch API. | diff --git a/docs/development/core/server/kibana-plugin-server.contextsetup.md b/docs/development/core/server/kibana-plugin-server.contextsetup.md index 0b4f5aa5d403b..67504faf0534a 100644 --- a/docs/development/core/server/kibana-plugin-server.contextsetup.md +++ b/docs/development/core/server/kibana-plugin-server.contextsetup.md @@ -91,18 +91,17 @@ export interface VizRenderContext { } export type VizRenderer = (context: VizRenderContext, domElement: HTMLElement) => () => void; +// When a renderer is bound via `contextContainer.createHandler` this is the type that will be returned. +type BoundVizRenderer = (domElement: HTMLElement) => () => void; class VizRenderingPlugin { - private readonly vizRenderers = new Map () => void)>(); + private readonly contextContainer?: IContextContainer; + private readonly vizRenderers = new Map(); constructor(private readonly initContext: PluginInitializerContext) {} setup(core) { - this.contextContainer = core.context.createContextContainer< - VizRenderContext, - ReturnType, - [HTMLElement] - >(); + this.contextContainer = core.context.createContextContainer(); return { registerContext: this.contextContainer.registerContext, diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.context.md b/docs/development/core/server/kibana-plugin-server.coresetup.context.md index e98cd6a0d04e1..63c37eec70b05 100644 --- a/docs/development/core/server/kibana-plugin-server.coresetup.context.md +++ b/docs/development/core/server/kibana-plugin-server.coresetup.context.md @@ -4,10 +4,10 @@ ## CoreSetup.context property +[ContextSetup](./kibana-plugin-server.contextsetup.md) + Signature: ```typescript -context: { - createContextContainer: ContextSetup['createContextContainer']; - }; +context: ContextSetup; ``` diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.elasticsearch.md b/docs/development/core/server/kibana-plugin-server.coresetup.elasticsearch.md index dfe1839babdad..9498e0223350d 100644 --- a/docs/development/core/server/kibana-plugin-server.coresetup.elasticsearch.md +++ b/docs/development/core/server/kibana-plugin-server.coresetup.elasticsearch.md @@ -4,12 +4,10 @@ ## CoreSetup.elasticsearch property +[ElasticsearchServiceSetup](./kibana-plugin-server.elasticsearchservicesetup.md) + Signature: ```typescript -elasticsearch: { - adminClient$: Observable; - dataClient$: Observable; - createClient: (type: string, clientConfig?: Partial) => IClusterClient; - }; +elasticsearch: ElasticsearchServiceSetup; ``` 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 8474f4ef940dc..09b12bca7b275 100644 --- a/docs/development/core/server/kibana-plugin-server.coresetup.http.md +++ b/docs/development/core/server/kibana-plugin-server.coresetup.http.md @@ -4,17 +4,10 @@ ## CoreSetup.http property +[HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) + Signature: ```typescript -http: { - createCookieSessionStorageFactory: HttpServiceSetup['createCookieSessionStorageFactory']; - registerOnPreAuth: HttpServiceSetup['registerOnPreAuth']; - registerAuth: HttpServiceSetup['registerAuth']; - registerOnPostAuth: HttpServiceSetup['registerOnPostAuth']; - basePath: HttpServiceSetup['basePath']; - isTlsEnabled: HttpServiceSetup['isTlsEnabled']; - registerRouteHandlerContext: (name: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer; - createRouter: () => IRouter; - }; +http: HttpServiceSetup; ``` diff --git a/docs/development/core/server/kibana-plugin-server.coresetup.md b/docs/development/core/server/kibana-plugin-server.coresetup.md index a53f807d001bd..a6dda69fd154e 100644 --- a/docs/development/core/server/kibana-plugin-server.coresetup.md +++ b/docs/development/core/server/kibana-plugin-server.coresetup.md @@ -16,7 +16,7 @@ export interface CoreSetup | Property | Type | Description | | --- | --- | --- | -| [context](./kibana-plugin-server.coresetup.context.md) | {
createContextContainer: ContextSetup['createContextContainer'];
} | | -| [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md) | {
adminClient$: Observable<IClusterClient>;
dataClient$: Observable<IClusterClient>;
createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => IClusterClient;
} | | -| [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;
} | | +| [context](./kibana-plugin-server.coresetup.context.md) | ContextSetup | [ContextSetup](./kibana-plugin-server.contextsetup.md) | +| [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md) | ElasticsearchServiceSetup | [ElasticsearchServiceSetup](./kibana-plugin-server.elasticsearchservicesetup.md) | +| [http](./kibana-plugin-server.coresetup.http.md) | HttpServiceSetup | [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) | diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.md b/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.md index 3dfe6b181a3d3..47af79ae464b2 100644 --- a/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.md +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiclientparams.md @@ -4,6 +4,7 @@ ## DeprecationAPIClientParams interface + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.md b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.md index 8ebe61f4efaa5..5a2954d10c161 100644 --- a/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.md +++ b/docs/development/core/server/kibana-plugin-server.deprecationapiresponse.md @@ -4,6 +4,7 @@ ## DeprecationAPIResponse interface + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.deprecationinfo.md b/docs/development/core/server/kibana-plugin-server.deprecationinfo.md index 21c10bde26378..c27f5d3404c22 100644 --- a/docs/development/core/server/kibana-plugin-server.deprecationinfo.md +++ b/docs/development/core/server/kibana-plugin-server.deprecationinfo.md @@ -4,6 +4,7 @@ ## DeprecationInfo interface + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearcherror.md b/docs/development/core/server/kibana-plugin-server.elasticsearcherror.md index a1d15704d5e1c..9d9e21c44760c 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearcherror.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearcherror.md @@ -4,6 +4,7 @@ ## ElasticsearchError interface + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.adminclient_.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.adminclient_.md index 31cf07ac66a46..b5bfc68d3ca0c 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.adminclient_.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.adminclient_.md @@ -4,6 +4,14 @@ ## ElasticsearchServiceSetup.adminClient$ property +Observable of clients for the `admin` cluster. Observable emits when Elasticsearch config changes on the Kibana server. See [IClusterClient](./kibana-plugin-server.iclusterclient.md). + + +```js +const client = await elasticsearch.adminClient$.pipe(take(1)).toPromise(); + +``` + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md index 34d04d26e9654..3d26f2d4cec88 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md @@ -4,7 +4,7 @@ ## ElasticsearchServiceSetup.createClient property -Create application specific Elasticsearch cluster API client with customized config. +Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-server.iclusterclient.md). Signature: diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.dataclient_.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.dataclient_.md index 240dff2e53635..9411f2f6b8694 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.dataclient_.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.dataclient_.md @@ -4,6 +4,14 @@ ## ElasticsearchServiceSetup.dataClient$ property +Observable of clients for the `data` cluster. Observable emits when Elasticsearch config changes on the Kibana server. See [IClusterClient](./kibana-plugin-server.iclusterclient.md). + + +```js +const client = await elasticsearch.dataClient$.pipe(take(1)).toPromise(); + +``` + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.legacy.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.legacy.md deleted file mode 100644 index 6040b407dd415..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.legacy.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchServiceSetup](./kibana-plugin-server.elasticsearchservicesetup.md) > [legacy](./kibana-plugin-server.elasticsearchservicesetup.legacy.md) - -## ElasticsearchServiceSetup.legacy property - -Signature: - -```typescript -readonly legacy: { - readonly config$: Observable; - }; -``` diff --git a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.md b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.md index 9c3b92a88fe07..e3d151cdc0d8b 100644 --- a/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.md +++ b/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.md @@ -15,8 +15,17 @@ export interface ElasticsearchServiceSetup | Property | Type | Description | | --- | --- | --- | -| [adminClient$](./kibana-plugin-server.elasticsearchservicesetup.adminclient_.md) | Observable<IClusterClient> | | -| [createClient](./kibana-plugin-server.elasticsearchservicesetup.createclient.md) | (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => IClusterClient | Create application specific Elasticsearch cluster API client with customized config. | -| [dataClient$](./kibana-plugin-server.elasticsearchservicesetup.dataclient_.md) | Observable<IClusterClient> | | -| [legacy](./kibana-plugin-server.elasticsearchservicesetup.legacy.md) | {
readonly config$: Observable<ElasticsearchConfig>;
} | | +| [adminClient$](./kibana-plugin-server.elasticsearchservicesetup.adminclient_.md) | Observable<IClusterClient> | Observable of clients for the admin cluster. Observable emits when Elasticsearch config changes on the Kibana server. See [IClusterClient](./kibana-plugin-server.iclusterclient.md). +```js +const client = await elasticsearch.adminClient$.pipe(take(1)).toPromise(); + +``` + | +| [createClient](./kibana-plugin-server.elasticsearchservicesetup.createclient.md) | (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => IClusterClient | Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-server.iclusterclient.md). | +| [dataClient$](./kibana-plugin-server.elasticsearchservicesetup.dataclient_.md) | Observable<IClusterClient> | Observable of clients for the data cluster. Observable emits when Elasticsearch config changes on the Kibana server. See [IClusterClient](./kibana-plugin-server.iclusterclient.md). +```js +const client = await elasticsearch.dataClient$.pipe(take(1)).toPromise(); + +``` + | diff --git a/docs/development/core/server/kibana-plugin-server.environmentmode.dev.md b/docs/development/core/server/kibana-plugin-server.environmentmode.dev.md new file mode 100644 index 0000000000000..d60fcc58d1b60 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.environmentmode.dev.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [EnvironmentMode](./kibana-plugin-server.environmentmode.md) > [dev](./kibana-plugin-server.environmentmode.dev.md) + +## EnvironmentMode.dev property + +Signature: + +```typescript +dev: boolean; +``` diff --git a/docs/development/core/server/kibana-plugin-server.environmentmode.md b/docs/development/core/server/kibana-plugin-server.environmentmode.md new file mode 100644 index 0000000000000..b325f74a0a44f --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.environmentmode.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [EnvironmentMode](./kibana-plugin-server.environmentmode.md) + +## EnvironmentMode interface + + +Signature: + +```typescript +export interface EnvironmentMode +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [dev](./kibana-plugin-server.environmentmode.dev.md) | boolean | | +| [name](./kibana-plugin-server.environmentmode.name.md) | 'development' | 'production' | | +| [prod](./kibana-plugin-server.environmentmode.prod.md) | boolean | | + diff --git a/docs/development/core/server/kibana-plugin-server.environmentmode.name.md b/docs/development/core/server/kibana-plugin-server.environmentmode.name.md new file mode 100644 index 0000000000000..c3243075866f2 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.environmentmode.name.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [EnvironmentMode](./kibana-plugin-server.environmentmode.md) > [name](./kibana-plugin-server.environmentmode.name.md) + +## EnvironmentMode.name property + +Signature: + +```typescript +name: 'development' | 'production'; +``` diff --git a/docs/development/core/server/kibana-plugin-server.environmentmode.prod.md b/docs/development/core/server/kibana-plugin-server.environmentmode.prod.md new file mode 100644 index 0000000000000..86a94775358e9 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.environmentmode.prod.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [EnvironmentMode](./kibana-plugin-server.environmentmode.md) > [prod](./kibana-plugin-server.environmentmode.prod.md) + +## EnvironmentMode.prod property + +Signature: + +```typescript +prod: boolean; +``` diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.auth.md b/docs/development/core/server/kibana-plugin-server.httpserversetup.auth.md deleted file mode 100644 index e39c3c6316768..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.auth.md +++ /dev/null @@ -1,15 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [auth](./kibana-plugin-server.httpserversetup.auth.md) - -## HttpServerSetup.auth property - -Signature: - -```typescript -auth: { - get: GetAuthState; - isAuthenticated: IsAuthenticated; - getAuthHeaders: GetAuthHeaders; - }; -``` diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.basepath.md b/docs/development/core/server/kibana-plugin-server.httpserversetup.basepath.md deleted file mode 100644 index 173262de10494..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.basepath.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [basePath](./kibana-plugin-server.httpserversetup.basepath.md) - -## HttpServerSetup.basePath property - -[BasePath](./kibana-plugin-server.basepath.md) - -Signature: - -```typescript -basePath: IBasePath; -``` diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.md b/docs/development/core/server/kibana-plugin-server.httpserversetup.md deleted file mode 100644 index 7a126383116e7..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.md +++ /dev/null @@ -1,93 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) - -## HttpServerSetup interface - -Kibana HTTP Service provides own abstraction for work with HTTP stack. Plugins don't have direct access to `hapi` server and its primitives anymore. Moreover, plugins shouldn't rely on the fact that HTTP Service uses one or another library under the hood. This gives the platform flexibility to upgrade or changing our internal HTTP stack without breaking plugins. If the HTTP Service lacks functionality you need, we are happy to discuss and support your needs. - -Signature: - -```typescript -export interface HttpServerSetup -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [auth](./kibana-plugin-server.httpserversetup.auth.md) | {
get: GetAuthState;
isAuthenticated: IsAuthenticated;
getAuthHeaders: GetAuthHeaders;
} | | -| [basePath](./kibana-plugin-server.httpserversetup.basepath.md) | IBasePath | [BasePath](./kibana-plugin-server.basepath.md) | -| [createCookieSessionStorageFactory](./kibana-plugin-server.httpserversetup.createcookiesessionstoragefactory.md) | <T>(cookieOptions: SessionStorageCookieOptions<T>) => Promise<SessionStorageFactory<T>> | Creates cookie based session storage factory [SessionStorageFactory](./kibana-plugin-server.sessionstoragefactory.md) | -| [isTlsEnabled](./kibana-plugin-server.httpserversetup.istlsenabled.md) | boolean | Flag showing whether a server was configured to use TLS connection. | -| [registerAuth](./kibana-plugin-server.httpserversetup.registerauth.md) | (handler: AuthenticationHandler) => void | To define custom authentication and/or authorization mechanism for incoming requests. A handler should return a state to associate with the incoming request. The state can be retrieved later via http.auth.get(..) Only one AuthenticationHandler can be registered. | -| [registerOnPostAuth](./kibana-plugin-server.httpserversetup.registeronpostauth.md) | (handler: OnPostAuthHandler) => void | To define custom logic to perform for incoming requests. Runs the handler after Auth interceptor did make sure a user has access to the requested resource. The auth state is available at stage via http.auth.get(..) Can register any number of registerOnPreAuth, which are called in sequence (from the first registered to the last). | -| [registerOnPreAuth](./kibana-plugin-server.httpserversetup.registeronpreauth.md) | (handler: OnPreAuthHandler) => void | To define custom logic to perform for incoming requests. Runs the handler before Auth interceptor performs a check that user has access to requested resources, so it's the only place when you can forward a request to another URL right on the server. Can register any number of registerOnPostAuth, which are called in sequence (from the first registered to the last). | -| [registerRouter](./kibana-plugin-server.httpserversetup.registerrouter.md) | (router: IRouter) => void | Add all the routes registered with router to HTTP server request listeners. | -| [server](./kibana-plugin-server.httpserversetup.server.md) | Server | | - -## Example - -To handle an incoming request in your plugin you should: - Create a `Router` instance. Router is already configured to use `plugin-id` to prefix path segment for your routes. - -```ts -const router = httpSetup.createRouter(); - -``` -- Use `@kbn/config-schema` package to create a schema to validate the request `params`, `query`, and `body`. Every incoming request will be validated against the created schema. If validation failed, the request is rejected with `400` status and `Bad request` error without calling the route's handler. To opt out of validating the request, specify `false`. - -```ts -import { schema, TypeOf } from '@kbn/config-schema'; -const validate = { - params: schema.object({ - id: schema.string(), - }), -}; - -``` -- Declare a function to respond to incoming request. The function will receive `request` object containing request details: url, headers, matched route, as well as validated `params`, `query`, `body`. And `response` object instructing HTTP server to create HTTP response with information sent back to the client as the response body, headers, and HTTP status. Unlike, `hapi` route handler in the Legacy platform, any exception raised during the handler call will generate `500 Server error` response and log error details for further investigation. See below for returning custom error responses. - -```ts -const handler = async (context: RequestHandlerContext, request: KibanaRequest, response: ResponseFactory) => { - const data = await findObject(request.params.id); - // creates a command to respond with 'not found' error - if (!data) return response.notFound(); - // creates a command to send found data to the client and set response headers - return response.ok({ - body: data, - headers: { - 'content-type': 'application/json' - } - }); -} - -``` -- Register route handler for GET request to 'my-app/path/{id}' path - -```ts -import { schema, TypeOf } from '@kbn/config-schema'; -const router = httpSetup.createRouter(); - -const validate = { - params: schema.object({ - id: schema.string(), - }), -}; - -router.get({ - path: 'path/{id}', - validate -}, -async (context, request, response) => { - const data = await findObject(request.params.id); - if (!data) return response.notFound(); - return response.ok({ - body: data, - headers: { - 'content-type': 'application/json' - } - }); -}); - -``` - diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.registerauth.md b/docs/development/core/server/kibana-plugin-server.httpserversetup.registerauth.md deleted file mode 100644 index 6e63e0996a63a..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.registerauth.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [registerAuth](./kibana-plugin-server.httpserversetup.registerauth.md) - -## HttpServerSetup.registerAuth property - -To define custom authentication and/or authorization mechanism for incoming requests. A handler should return a state to associate with the incoming request. The state can be retrieved later via http.auth.get(..) Only one AuthenticationHandler can be registered. - -Signature: - -```typescript -registerAuth: (handler: AuthenticationHandler) => void; -``` diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.registeronpostauth.md b/docs/development/core/server/kibana-plugin-server.httpserversetup.registeronpostauth.md deleted file mode 100644 index c74a67da350ec..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.registeronpostauth.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [registerOnPostAuth](./kibana-plugin-server.httpserversetup.registeronpostauth.md) - -## HttpServerSetup.registerOnPostAuth property - -To define custom logic to perform for incoming requests. Runs the handler after Auth interceptor did make sure a user has access to the requested resource. The auth state is available at stage via http.auth.get(..) Can register any number of registerOnPreAuth, which are called in sequence (from the first registered to the last). - -Signature: - -```typescript -registerOnPostAuth: (handler: OnPostAuthHandler) => void; -``` diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.registeronpreauth.md b/docs/development/core/server/kibana-plugin-server.httpserversetup.registeronpreauth.md deleted file mode 100644 index f6efa1c1dd73c..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.registeronpreauth.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [registerOnPreAuth](./kibana-plugin-server.httpserversetup.registeronpreauth.md) - -## HttpServerSetup.registerOnPreAuth property - -To define custom logic to perform for incoming requests. Runs the handler before Auth interceptor performs a check that user has access to requested resources, so it's the only place when you can forward a request to another URL right on the server. Can register any number of registerOnPostAuth, which are called in sequence (from the first registered to the last). - -Signature: - -```typescript -registerOnPreAuth: (handler: OnPreAuthHandler) => void; -``` diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.registerrouter.md b/docs/development/core/server/kibana-plugin-server.httpserversetup.registerrouter.md deleted file mode 100644 index 32daa650f8d5d..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.registerrouter.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [registerRouter](./kibana-plugin-server.httpserversetup.registerrouter.md) - -## HttpServerSetup.registerRouter property - -Add all the routes registered with `router` to HTTP server request listeners. - -Signature: - -```typescript -registerRouter: (router: IRouter) => void; -``` diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.server.md b/docs/development/core/server/kibana-plugin-server.httpserversetup.server.md deleted file mode 100644 index a137eba7c8a5a..0000000000000 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.server.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [server](./kibana-plugin-server.httpserversetup.server.md) - -## HttpServerSetup.server property - -Signature: - -```typescript -server: Server; -``` diff --git a/docs/development/core/server/kibana-plugin-server.httpservicesetup.basepath.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.basepath.md new file mode 100644 index 0000000000000..61390773bd726 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.basepath.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [basePath](./kibana-plugin-server.httpservicesetup.basepath.md) + +## HttpServiceSetup.basePath property + +Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-server.ibasepath.md). + +Signature: + +```typescript +basePath: IBasePath; +``` diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.createcookiesessionstoragefactory.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.createcookiesessionstoragefactory.md similarity index 61% rename from docs/development/core/server/kibana-plugin-server.httpserversetup.createcookiesessionstoragefactory.md rename to docs/development/core/server/kibana-plugin-server.httpservicesetup.createcookiesessionstoragefactory.md index 3dc01a52a2f58..4771836bea477 100644 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.createcookiesessionstoragefactory.md +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.createcookiesessionstoragefactory.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [createCookieSessionStorageFactory](./kibana-plugin-server.httpserversetup.createcookiesessionstoragefactory.md) +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [createCookieSessionStorageFactory](./kibana-plugin-server.httpservicesetup.createcookiesessionstoragefactory.md) -## HttpServerSetup.createCookieSessionStorageFactory property +## HttpServiceSetup.createCookieSessionStorageFactory property Creates cookie based session storage factory [SessionStorageFactory](./kibana-plugin-server.sessionstoragefactory.md) diff --git a/docs/development/core/server/kibana-plugin-server.httpservicesetup.createrouter.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.createrouter.md new file mode 100644 index 0000000000000..6431589c55bd1 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.createrouter.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [createRouter](./kibana-plugin-server.httpservicesetup.createrouter.md) + +## HttpServiceSetup.createRouter property + +Provides ability to declare a handler function for a particular path and HTTP request method. + +Signature: + +```typescript +createRouter: () => IRouter; +``` + +## Remarks + +Each route can have only one handler function, which is executed when the route is matched. See the [IRouter](./kibana-plugin-server.irouter.md) documentation for more information. + +## Example + + +```ts +const router = createRouter(); +// handler is called when '${my-plugin-id}/path' resource is requested with `GET` method +router.get({ path: '/path', validate: false }, (context, req, res) => res.ok({ content: 'ok' })); + +``` + diff --git a/docs/development/core/server/kibana-plugin-server.httpserversetup.istlsenabled.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.istlsenabled.md similarity index 56% rename from docs/development/core/server/kibana-plugin-server.httpserversetup.istlsenabled.md rename to docs/development/core/server/kibana-plugin-server.httpservicesetup.istlsenabled.md index 6961d4feeb7c7..06a99e8bf3013 100644 --- a/docs/development/core/server/kibana-plugin-server.httpserversetup.istlsenabled.md +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.istlsenabled.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) > [isTlsEnabled](./kibana-plugin-server.httpserversetup.istlsenabled.md) +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [isTlsEnabled](./kibana-plugin-server.httpservicesetup.istlsenabled.md) -## HttpServerSetup.isTlsEnabled property +## HttpServiceSetup.isTlsEnabled property Flag showing whether a server was configured to use TLS connection. diff --git a/docs/development/core/server/kibana-plugin-server.httpservicesetup.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.md index eec63cf5c8093..d943ad53af843 100644 --- a/docs/development/core/server/kibana-plugin-server.httpservicesetup.md +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.md @@ -2,14 +2,91 @@ [Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) -## HttpServiceSetup type +## HttpServiceSetup interface +Kibana HTTP Service provides own abstraction for work with HTTP stack. Plugins don't have direct access to `hapi` server and its primitives anymore. Moreover, plugins shouldn't rely on the fact that HTTP Service uses one or another library under the hood. This gives the platform flexibility to upgrade or changing our internal HTTP stack without breaking plugins. If the HTTP Service lacks functionality you need, we are happy to discuss and support your needs. Signature: ```typescript -export declare type HttpServiceSetup = Omit & { - createRouter: (path: string, plugin?: PluginOpaqueId) => IRouter; - registerRouteHandlerContext: (pluginOpaqueId: PluginOpaqueId, contextName: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer; +export interface HttpServiceSetup +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [basePath](./kibana-plugin-server.httpservicesetup.basepath.md) | IBasePath | Access or manipulate the Kibana base path See [IBasePath](./kibana-plugin-server.ibasepath.md). | +| [createCookieSessionStorageFactory](./kibana-plugin-server.httpservicesetup.createcookiesessionstoragefactory.md) | <T>(cookieOptions: SessionStorageCookieOptions<T>) => Promise<SessionStorageFactory<T>> | Creates cookie based session storage factory [SessionStorageFactory](./kibana-plugin-server.sessionstoragefactory.md) | +| [createRouter](./kibana-plugin-server.httpservicesetup.createrouter.md) | () => IRouter | Provides ability to declare a handler function for a particular path and HTTP request method. | +| [isTlsEnabled](./kibana-plugin-server.httpservicesetup.istlsenabled.md) | boolean | Flag showing whether a server was configured to use TLS connection. | +| [registerAuth](./kibana-plugin-server.httpservicesetup.registerauth.md) | (handler: AuthenticationHandler) => void | To define custom authentication and/or authorization mechanism for incoming requests. | +| [registerOnPostAuth](./kibana-plugin-server.httpservicesetup.registeronpostauth.md) | (handler: OnPostAuthHandler) => void | To define custom logic to perform for incoming requests. | +| [registerOnPreAuth](./kibana-plugin-server.httpservicesetup.registeronpreauth.md) | (handler: OnPreAuthHandler) => void | To define custom logic to perform for incoming requests. | +| [registerRouteHandlerContext](./kibana-plugin-server.httpservicesetup.registerroutehandlercontext.md) | <T extends keyof RequestHandlerContext>(contextName: T, provider: RequestHandlerContextProvider<T>) => RequestHandlerContextContainer | Register a context provider for a route handler. | + +## Example + +To handle an incoming request in your plugin you should: - Create a `Router` instance. Router is already configured to use `plugin-id` to prefix path segment for your routes. + +```ts +const router = httpSetup.createRouter(); + +``` +- Use `@kbn/config-schema` package to create a schema to validate the request `params`, `query`, and `body`. Every incoming request will be validated against the created schema. If validation failed, the request is rejected with `400` status and `Bad request` error without calling the route's handler. To opt out of validating the request, specify `false`. + +```ts +import { schema, TypeOf } from '@kbn/config-schema'; +const validate = { + params: schema.object({ + id: schema.string(), + }), +}; + +``` +- Declare a function to respond to incoming request. The function will receive `request` object containing request details: url, headers, matched route, as well as validated `params`, `query`, `body`. And `response` object instructing HTTP server to create HTTP response with information sent back to the client as the response body, headers, and HTTP status. Unlike, `hapi` route handler in the Legacy platform, any exception raised during the handler call will generate `500 Server error` response and log error details for further investigation. See below for returning custom error responses. + +```ts +const handler = async (context: RequestHandlerContext, request: KibanaRequest, response: ResponseFactory) => { + const data = await findObject(request.params.id); + // creates a command to respond with 'not found' error + if (!data) return response.notFound(); + // creates a command to send found data to the client and set response headers + return response.ok({ + body: data, + headers: { + 'content-type': 'application/json' + } + }); +} + +``` +- Register route handler for GET request to 'my-app/path/{id}' path + +```ts +import { schema, TypeOf } from '@kbn/config-schema'; +const router = httpSetup.createRouter(); + +const validate = { + params: schema.object({ + id: schema.string(), + }), }; + +router.get({ + path: 'path/{id}', + validate +}, +async (context, request, response) => { + const data = await findObject(request.params.id); + if (!data) return response.notFound(); + return response.ok({ + body: data, + headers: { + 'content-type': 'application/json' + } + }); +}); + ``` + diff --git a/docs/development/core/server/kibana-plugin-server.httpservicesetup.registerauth.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.registerauth.md new file mode 100644 index 0000000000000..be3da1ca1131f --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.registerauth.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [registerAuth](./kibana-plugin-server.httpservicesetup.registerauth.md) + +## HttpServiceSetup.registerAuth property + +To define custom authentication and/or authorization mechanism for incoming requests. + +Signature: + +```typescript +registerAuth: (handler: AuthenticationHandler) => void; +``` + +## Remarks + +A handler should return a state to associate with the incoming request. The state can be retrieved later via http.auth.get(..) Only one AuthenticationHandler can be registered. See [AuthenticationHandler](./kibana-plugin-server.authenticationhandler.md). + diff --git a/docs/development/core/server/kibana-plugin-server.httpservicesetup.registeronpostauth.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.registeronpostauth.md new file mode 100644 index 0000000000000..a3f875c999af1 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.registeronpostauth.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [registerOnPostAuth](./kibana-plugin-server.httpservicesetup.registeronpostauth.md) + +## HttpServiceSetup.registerOnPostAuth property + +To define custom logic to perform for incoming requests. + +Signature: + +```typescript +registerOnPostAuth: (handler: OnPostAuthHandler) => void; +``` + +## Remarks + +Runs the handler after Auth interceptor did make sure a user has access to the requested resource. The auth state is available at stage via http.auth.get(..) Can register any number of registerOnPreAuth, which are called in sequence (from the first registered to the last). See [OnPostAuthHandler](./kibana-plugin-server.onpostauthhandler.md). + diff --git a/docs/development/core/server/kibana-plugin-server.httpservicesetup.registeronpreauth.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.registeronpreauth.md new file mode 100644 index 0000000000000..4c7b688619319 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.registeronpreauth.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [registerOnPreAuth](./kibana-plugin-server.httpservicesetup.registeronpreauth.md) + +## HttpServiceSetup.registerOnPreAuth property + +To define custom logic to perform for incoming requests. + +Signature: + +```typescript +registerOnPreAuth: (handler: OnPreAuthHandler) => void; +``` + +## Remarks + +Runs the handler before Auth interceptor performs a check that user has access to requested resources, so it's the only place when you can forward a request to another URL right on the server. Can register any number of registerOnPostAuth, which are called in sequence (from the first registered to the last). See [OnPreAuthHandler](./kibana-plugin-server.onpreauthhandler.md). + diff --git a/docs/development/core/server/kibana-plugin-server.httpservicesetup.registerroutehandlercontext.md b/docs/development/core/server/kibana-plugin-server.httpservicesetup.registerroutehandlercontext.md new file mode 100644 index 0000000000000..339f2eb329c7b --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.httpservicesetup.registerroutehandlercontext.md @@ -0,0 +1,37 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) > [registerRouteHandlerContext](./kibana-plugin-server.httpservicesetup.registerroutehandlercontext.md) + +## HttpServiceSetup.registerRouteHandlerContext property + +Register a context provider for a route handler. + +Signature: + +```typescript +registerRouteHandlerContext: (contextName: T, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer; +``` + +## Example + + +```ts + // my-plugin.ts + deps.http.registerRouteHandlerContext( + 'myApp', + (context, req) => { + async function search (id: string) { + return await context.elasticsearch.adminClient.callAsInternalUser('endpoint', id); + } + return { search }; + } + ); + +// my-route-handler.ts + router.get({ path: '/', validate: false }, async (context, req, res) => { + const response = await context.myApp.search(...); + return res.ok(response); + }); + +``` + diff --git a/docs/development/core/server/kibana-plugin-server.ikibanaresponse.md b/docs/development/core/server/kibana-plugin-server.ikibanaresponse.md new file mode 100644 index 0000000000000..4971d6eb97a28 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.ikibanaresponse.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [IKibanaResponse](./kibana-plugin-server.ikibanaresponse.md) + +## IKibanaResponse interface + +A response data object, expected to returned as a result of [RequestHandler](./kibana-plugin-server.requesthandler.md) execution + +Signature: + +```typescript +export interface IKibanaResponse +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [options](./kibana-plugin-server.ikibanaresponse.options.md) | HttpResponseOptions | | +| [payload](./kibana-plugin-server.ikibanaresponse.payload.md) | T | | +| [status](./kibana-plugin-server.ikibanaresponse.status.md) | number | | + diff --git a/docs/development/core/server/kibana-plugin-server.ikibanaresponse.options.md b/docs/development/core/server/kibana-plugin-server.ikibanaresponse.options.md new file mode 100644 index 0000000000000..988d873c088fe --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.ikibanaresponse.options.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [IKibanaResponse](./kibana-plugin-server.ikibanaresponse.md) > [options](./kibana-plugin-server.ikibanaresponse.options.md) + +## IKibanaResponse.options property + +Signature: + +```typescript +readonly options: HttpResponseOptions; +``` diff --git a/docs/development/core/server/kibana-plugin-server.ikibanaresponse.payload.md b/docs/development/core/server/kibana-plugin-server.ikibanaresponse.payload.md new file mode 100644 index 0000000000000..f1d10c5d22a42 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.ikibanaresponse.payload.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [IKibanaResponse](./kibana-plugin-server.ikibanaresponse.md) > [payload](./kibana-plugin-server.ikibanaresponse.payload.md) + +## IKibanaResponse.payload property + +Signature: + +```typescript +readonly payload?: T; +``` diff --git a/docs/development/core/server/kibana-plugin-server.ikibanaresponse.status.md b/docs/development/core/server/kibana-plugin-server.ikibanaresponse.status.md new file mode 100644 index 0000000000000..b766ff66c357f --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.ikibanaresponse.status.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [IKibanaResponse](./kibana-plugin-server.ikibanaresponse.md) > [status](./kibana-plugin-server.ikibanaresponse.status.md) + +## IKibanaResponse.status property + +Signature: + +```typescript +readonly status: number; +``` diff --git a/docs/development/core/server/kibana-plugin-server.indexsettingsdeprecationinfo.md b/docs/development/core/server/kibana-plugin-server.indexsettingsdeprecationinfo.md index 8fd0c6bb9f997..66b15e532e2ad 100644 --- a/docs/development/core/server/kibana-plugin-server.indexsettingsdeprecationinfo.md +++ b/docs/development/core/server/kibana-plugin-server.indexsettingsdeprecationinfo.md @@ -4,6 +4,7 @@ ## IndexSettingsDeprecationInfo interface + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.irouter.md b/docs/development/core/server/kibana-plugin-server.irouter.md index 2fb2d30eb31d7..bbffe1e42f229 100644 --- a/docs/development/core/server/kibana-plugin-server.irouter.md +++ b/docs/development/core/server/kibana-plugin-server.irouter.md @@ -4,7 +4,7 @@ ## IRouter interface -Registers route handlers for specified resource path and method. +Registers route handlers for specified resource path and method. See [RouteConfig](./kibana-plugin-server.routeconfig.md) and [RequestHandler](./kibana-plugin-server.requesthandler.md) for more information about arguments to route registrations. Signature: diff --git a/docs/development/core/server/kibana-plugin-server.md b/docs/development/core/server/kibana-plugin-server.md index 02bbd028ac419..8a259f6870628 100644 --- a/docs/development/core/server/kibana-plugin-server.md +++ b/docs/development/core/server/kibana-plugin-server.md @@ -27,6 +27,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | Enumeration | Description | | --- | --- | +| [AuthResultType](./kibana-plugin-server.authresulttype.md) | | | [AuthStatus](./kibana-plugin-server.authstatus.md) | Status indicating an outcome of the authentication. | ## Interfaces @@ -36,6 +37,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [APICaller](./kibana-plugin-server.apicaller.md) | | | [AssistanceAPIResponse](./kibana-plugin-server.assistanceapiresponse.md) | | | [AssistantAPIClientParams](./kibana-plugin-server.assistantapiclientparams.md) | | +| [Authenticated](./kibana-plugin-server.authenticated.md) | | | [AuthResultParams](./kibana-plugin-server.authresultparams.md) | Result of an incoming request authentication. | | [AuthToolkit](./kibana-plugin-server.authtoolkit.md) | A tool set defining an outcome of Auth interceptor for incoming request. | | [CallAPIOptions](./kibana-plugin-server.callapioptions.md) | The set of options that defines how API call should be made and result be processed. | @@ -49,15 +51,17 @@ The plugin integrates with the core system via lifecycle events: `setup` | [DiscoveredPlugin](./kibana-plugin-server.discoveredplugin.md) | Small container object used to expose information about discovered plugins that may or may not have been started. | | [ElasticsearchError](./kibana-plugin-server.elasticsearcherror.md) | | | [ElasticsearchServiceSetup](./kibana-plugin-server.elasticsearchservicesetup.md) | | +| [EnvironmentMode](./kibana-plugin-server.environmentmode.md) | | | [ErrorHttpResponseOptions](./kibana-plugin-server.errorhttpresponseoptions.md) | HTTP response parameters | | [FakeRequest](./kibana-plugin-server.fakerequest.md) | Fake request object created manually by Kibana plugins. | | [HttpResponseOptions](./kibana-plugin-server.httpresponseoptions.md) | HTTP response parameters | -| [HttpServerSetup](./kibana-plugin-server.httpserversetup.md) | Kibana HTTP Service provides own abstraction for work with HTTP stack. Plugins don't have direct access to hapi server and its primitives anymore. Moreover, plugins shouldn't rely on the fact that HTTP Service uses one or another library under the hood. This gives the platform flexibility to upgrade or changing our internal HTTP stack without breaking plugins. If the HTTP Service lacks functionality you need, we are happy to discuss and support your needs. | +| [HttpServiceSetup](./kibana-plugin-server.httpservicesetup.md) | Kibana HTTP Service provides own abstraction for work with HTTP stack. Plugins don't have direct access to hapi server and its primitives anymore. Moreover, plugins shouldn't rely on the fact that HTTP Service uses one or another library under the hood. This gives the platform flexibility to upgrade or changing our internal HTTP stack without breaking plugins. If the HTTP Service lacks functionality you need, we are happy to discuss and support your needs. | | [HttpServiceStart](./kibana-plugin-server.httpservicestart.md) | | | [IContextContainer](./kibana-plugin-server.icontextcontainer.md) | An object that handles registration of context providers and configuring handlers with context. | +| [IKibanaResponse](./kibana-plugin-server.ikibanaresponse.md) | A response data object, expected to returned as a result of [RequestHandler](./kibana-plugin-server.requesthandler.md) execution | | [IKibanaSocket](./kibana-plugin-server.ikibanasocket.md) | A tiny abstraction for TCP socket. | | [IndexSettingsDeprecationInfo](./kibana-plugin-server.indexsettingsdeprecationinfo.md) | | -| [IRouter](./kibana-plugin-server.irouter.md) | Registers route handlers for specified resource path and method. | +| [IRouter](./kibana-plugin-server.irouter.md) | Registers route handlers for specified resource path and method. See [RouteConfig](./kibana-plugin-server.routeconfig.md) and [RequestHandler](./kibana-plugin-server.requesthandler.md) for more information about arguments to route registrations. | | [KibanaRequestRoute](./kibana-plugin-server.kibanarequestroute.md) | Request specific route information exposed to a handler. | | [LegacyRequest](./kibana-plugin-server.legacyrequest.md) | | | [LegacyServiceSetupDeps](./kibana-plugin-server.legacyservicesetupdeps.md) | | @@ -67,6 +71,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [LogMeta](./kibana-plugin-server.logmeta.md) | Contextual metadata | | [OnPostAuthToolkit](./kibana-plugin-server.onpostauthtoolkit.md) | A tool set defining an outcome of OnPostAuth interceptor for incoming request. | | [OnPreAuthToolkit](./kibana-plugin-server.onpreauthtoolkit.md) | A tool set defining an outcome of OnPreAuth interceptor for incoming request. | +| [PackageInfo](./kibana-plugin-server.packageinfo.md) | | | [Plugin](./kibana-plugin-server.plugin.md) | The interface that should be returned by a PluginInitializer. | | [PluginInitializerContext](./kibana-plugin-server.plugininitializercontext.md) | Context that's available to plugins during initialization stage. | | [PluginManifest](./kibana-plugin-server.pluginmanifest.md) | Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file. | @@ -116,8 +121,9 @@ The plugin integrates with the core system via lifecycle events: `setup` | Type Alias | Description | | --- | --- | -| [AuthenticationHandler](./kibana-plugin-server.authenticationhandler.md) | | +| [AuthenticationHandler](./kibana-plugin-server.authenticationhandler.md) | See [AuthToolkit](./kibana-plugin-server.authtoolkit.md). | | [AuthHeaders](./kibana-plugin-server.authheaders.md) | Auth Headers map | +| [AuthResult](./kibana-plugin-server.authresult.md) | | | [ConfigPath](./kibana-plugin-server.configpath.md) | | | [ElasticsearchClientConfig](./kibana-plugin-server.elasticsearchclientconfig.md) | | | [GetAuthHeaders](./kibana-plugin-server.getauthheaders.md) | Get headers to authenticate a user against Elasticsearch. | @@ -127,7 +133,6 @@ The plugin integrates with the core system via lifecycle events: `setup` | [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) | | [IClusterClient](./kibana-plugin-server.iclusterclient.md) | Represents an Elasticsearch cluster API client and allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via asScoped(...)).See [ClusterClient](./kibana-plugin-server.clusterclient.md). | | [IContextProvider](./kibana-plugin-server.icontextprovider.md) | A function that returns a context value for a specific key of given context type. | @@ -138,8 +143,8 @@ The plugin integrates with the core system via lifecycle events: `setup` | [LifecycleResponseFactory](./kibana-plugin-server.lifecycleresponsefactory.md) | Creates an object containing redirection or error response with error details, HTTP headers, and other data transmitted to the client. | | [MIGRATION\_ASSISTANCE\_INDEX\_ACTION](./kibana-plugin-server.migration_assistance_index_action.md) | | | [MIGRATION\_DEPRECATION\_LEVEL](./kibana-plugin-server.migration_deprecation_level.md) | | -| [OnPostAuthHandler](./kibana-plugin-server.onpostauthhandler.md) | | -| [OnPreAuthHandler](./kibana-plugin-server.onpreauthhandler.md) | | +| [OnPostAuthHandler](./kibana-plugin-server.onpostauthhandler.md) | See [OnPostAuthToolkit](./kibana-plugin-server.onpostauthtoolkit.md). | +| [OnPreAuthHandler](./kibana-plugin-server.onpreauthhandler.md) | See [OnPreAuthToolkit](./kibana-plugin-server.onpreauthtoolkit.md). | | [PluginInitializer](./kibana-plugin-server.plugininitializer.md) | The plugin export at the root of a plugin's server directory should conform to this interface. | | [PluginName](./kibana-plugin-server.pluginname.md) | Dedicated type for plugin name/id that is supposed to make Map/Set/Arrays that use it as a key or value more obvious. | | [PluginOpaqueId](./kibana-plugin-server.pluginopaqueid.md) | | diff --git a/docs/development/core/server/kibana-plugin-server.migration_assistance_index_action.md b/docs/development/core/server/kibana-plugin-server.migration_assistance_index_action.md index 4753bd0db71f6..e5ecc6779b282 100644 --- a/docs/development/core/server/kibana-plugin-server.migration_assistance_index_action.md +++ b/docs/development/core/server/kibana-plugin-server.migration_assistance_index_action.md @@ -4,6 +4,7 @@ ## MIGRATION\_ASSISTANCE\_INDEX\_ACTION type + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.migration_deprecation_level.md b/docs/development/core/server/kibana-plugin-server.migration_deprecation_level.md index 2751faf6a1cd9..33e02a1b2bce0 100644 --- a/docs/development/core/server/kibana-plugin-server.migration_deprecation_level.md +++ b/docs/development/core/server/kibana-plugin-server.migration_deprecation_level.md @@ -4,6 +4,7 @@ ## MIGRATION\_DEPRECATION\_LEVEL type + Signature: ```typescript diff --git a/docs/development/core/server/kibana-plugin-server.onpostauthhandler.md b/docs/development/core/server/kibana-plugin-server.onpostauthhandler.md index 884eb3e6346bd..a887dea26e3bc 100644 --- a/docs/development/core/server/kibana-plugin-server.onpostauthhandler.md +++ b/docs/development/core/server/kibana-plugin-server.onpostauthhandler.md @@ -4,6 +4,7 @@ ## OnPostAuthHandler type +See [OnPostAuthToolkit](./kibana-plugin-server.onpostauthtoolkit.md). Signature: diff --git a/docs/development/core/server/kibana-plugin-server.onpreauthhandler.md b/docs/development/core/server/kibana-plugin-server.onpreauthhandler.md index 5eca904227bb9..003bd4b19eadf 100644 --- a/docs/development/core/server/kibana-plugin-server.onpreauthhandler.md +++ b/docs/development/core/server/kibana-plugin-server.onpreauthhandler.md @@ -4,6 +4,7 @@ ## OnPreAuthHandler type +See [OnPreAuthToolkit](./kibana-plugin-server.onpreauthtoolkit.md). Signature: diff --git a/docs/development/core/server/kibana-plugin-server.packageinfo.branch.md b/docs/development/core/server/kibana-plugin-server.packageinfo.branch.md new file mode 100644 index 0000000000000..36f187180d31b --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.packageinfo.branch.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [PackageInfo](./kibana-plugin-server.packageinfo.md) > [branch](./kibana-plugin-server.packageinfo.branch.md) + +## PackageInfo.branch property + +Signature: + +```typescript +branch: string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.packageinfo.buildnum.md b/docs/development/core/server/kibana-plugin-server.packageinfo.buildnum.md new file mode 100644 index 0000000000000..c0a231ee27ab0 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.packageinfo.buildnum.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [PackageInfo](./kibana-plugin-server.packageinfo.md) > [buildNum](./kibana-plugin-server.packageinfo.buildnum.md) + +## PackageInfo.buildNum property + +Signature: + +```typescript +buildNum: number; +``` diff --git a/docs/development/core/server/kibana-plugin-server.packageinfo.buildsha.md b/docs/development/core/server/kibana-plugin-server.packageinfo.buildsha.md new file mode 100644 index 0000000000000..5e8de48067dd0 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.packageinfo.buildsha.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [PackageInfo](./kibana-plugin-server.packageinfo.md) > [buildSha](./kibana-plugin-server.packageinfo.buildsha.md) + +## PackageInfo.buildSha property + +Signature: + +```typescript +buildSha: string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.packageinfo.dist.md b/docs/development/core/server/kibana-plugin-server.packageinfo.dist.md new file mode 100644 index 0000000000000..e45970780d522 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.packageinfo.dist.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [PackageInfo](./kibana-plugin-server.packageinfo.md) > [dist](./kibana-plugin-server.packageinfo.dist.md) + +## PackageInfo.dist property + +Signature: + +```typescript +dist: boolean; +``` diff --git a/docs/development/core/server/kibana-plugin-server.packageinfo.md b/docs/development/core/server/kibana-plugin-server.packageinfo.md new file mode 100644 index 0000000000000..3ff02c9cda85d --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.packageinfo.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [PackageInfo](./kibana-plugin-server.packageinfo.md) + +## PackageInfo interface + + +Signature: + +```typescript +export interface PackageInfo +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [branch](./kibana-plugin-server.packageinfo.branch.md) | string | | +| [buildNum](./kibana-plugin-server.packageinfo.buildnum.md) | number | | +| [buildSha](./kibana-plugin-server.packageinfo.buildsha.md) | string | | +| [dist](./kibana-plugin-server.packageinfo.dist.md) | boolean | | +| [version](./kibana-plugin-server.packageinfo.version.md) | string | | + diff --git a/docs/development/core/server/kibana-plugin-server.packageinfo.version.md b/docs/development/core/server/kibana-plugin-server.packageinfo.version.md new file mode 100644 index 0000000000000..e99e3c48d7041 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-server.packageinfo.version.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [kibana-plugin-server](./kibana-plugin-server.md) > [PackageInfo](./kibana-plugin-server.packageinfo.md) > [version](./kibana-plugin-server.packageinfo.version.md) + +## PackageInfo.version property + +Signature: + +```typescript +version: string; +``` diff --git a/docs/development/core/server/kibana-plugin-server.plugininitializercontext.env.md b/docs/development/core/server/kibana-plugin-server.plugininitializercontext.env.md index fde398faf132e..fd4caa605c0e5 100644 --- a/docs/development/core/server/kibana-plugin-server.plugininitializercontext.env.md +++ b/docs/development/core/server/kibana-plugin-server.plugininitializercontext.env.md @@ -9,5 +9,6 @@ ```typescript env: { mode: EnvironmentMode; + packageInfo: Readonly; }; ``` diff --git a/docs/development/core/server/kibana-plugin-server.plugininitializercontext.md b/docs/development/core/server/kibana-plugin-server.plugininitializercontext.md index 2bba3d408f68e..e7aa32edaa293 100644 --- a/docs/development/core/server/kibana-plugin-server.plugininitializercontext.md +++ b/docs/development/core/server/kibana-plugin-server.plugininitializercontext.md @@ -17,7 +17,7 @@ export interface PluginInitializerContext | Property | Type | Description | | --- | --- | --- | | [config](./kibana-plugin-server.plugininitializercontext.config.md) | {
create: <T = ConfigSchema>() => Observable<T>;
createIfExists: <T = ConfigSchema>() => Observable<T | undefined>;
} | | -| [env](./kibana-plugin-server.plugininitializercontext.env.md) | {
mode: EnvironmentMode;
} | | +| [env](./kibana-plugin-server.plugininitializercontext.env.md) | {
mode: EnvironmentMode;
packageInfo: Readonly<PackageInfo>;
} | | | [logger](./kibana-plugin-server.plugininitializercontext.logger.md) | LoggerFactory | | | [opaqueId](./kibana-plugin-server.plugininitializercontext.opaqueid.md) | PluginOpaqueId | | diff --git a/docs/development/core/server/kibana-plugin-server.requesthandler.md b/docs/development/core/server/kibana-plugin-server.requesthandler.md index 0b6a127119d8e..035d16c9fca3c 100644 --- a/docs/development/core/server/kibana-plugin-server.requesthandler.md +++ b/docs/development/core/server/kibana-plugin-server.requesthandler.md @@ -9,7 +9,7 @@ A function executed when route path matched requested resource path. Request han Signature: ```typescript -export declare type RequestHandler

= (context: RequestHandlerContext, request: KibanaRequest, TypeOf, TypeOf>, response: KibanaResponseFactory) => KibanaResponse | Promise>; +export declare type RequestHandler

= (context: RequestHandlerContext, request: KibanaRequest, TypeOf, TypeOf>, response: KibanaResponseFactory) => IKibanaResponse | Promise>; ``` ## Example diff --git a/docs/development/core/server/kibana-plugin-server.routeconfig.md b/docs/development/core/server/kibana-plugin-server.routeconfig.md index 87ec365dc2510..769d0dda42644 100644 --- a/docs/development/core/server/kibana-plugin-server.routeconfig.md +++ b/docs/development/core/server/kibana-plugin-server.routeconfig.md @@ -17,6 +17,6 @@ export interface RouteConfig

RouteConfigOptions | Additional route options [RouteConfigOptions](./kibana-plugin-server.routeconfigoptions.md). | -| [path](./kibana-plugin-server.routeconfig.path.md) | string | The endpoint \_within\_ the router path to register the route. E.g. if the router is registered at /elasticsearch and the route path is /search, the full path for the route is /elasticsearch/search. Supports: - named path segments path/{name}. - optional path segments path/{position?}. - multi-segments path/{coordinates*2}. Segments are accessible within a handler function as params property of [KibanaRequest](./kibana-plugin-server.kibanarequest.md) object. To have read access to params you \*must\* specify validation schema with [RouteConfig.validate](./kibana-plugin-server.routeconfig.validate.md). | -| [validate](./kibana-plugin-server.routeconfig.validate.md) | RouteSchemas<P, Q, B> | false | A schema created with @kbn/config-schema that every request will be validated against. You \*must\* specify a validation schema to be able to read: - url path segments - request query - request body To opt out of validating the request, specify false. | +| [path](./kibana-plugin-server.routeconfig.path.md) | string | The endpoint \_within\_ the router path to register the route. | +| [validate](./kibana-plugin-server.routeconfig.validate.md) | RouteSchemas<P, Q, B> | false | A schema created with @kbn/config-schema that every request will be validated against. | diff --git a/docs/development/core/server/kibana-plugin-server.routeconfig.path.md b/docs/development/core/server/kibana-plugin-server.routeconfig.path.md index 3437f0e0fe064..0e6fa19f98ace 100644 --- a/docs/development/core/server/kibana-plugin-server.routeconfig.path.md +++ b/docs/development/core/server/kibana-plugin-server.routeconfig.path.md @@ -4,10 +4,15 @@ ## RouteConfig.path property -The endpoint \_within\_ the router path to register the route. E.g. if the router is registered at `/elasticsearch` and the route path is `/search`, the full path for the route is `/elasticsearch/search`. Supports: - named path segments `path/{name}`. - optional path segments `path/{position?}`. - multi-segments `path/{coordinates*2}`. Segments are accessible within a handler function as `params` property of [KibanaRequest](./kibana-plugin-server.kibanarequest.md) object. To have read access to `params` you \*must\* specify validation schema with [RouteConfig.validate](./kibana-plugin-server.routeconfig.validate.md). +The endpoint \_within\_ the router path to register the route. Signature: ```typescript path: string; ``` + +## Remarks + +E.g. if the router is registered at `/elasticsearch` and the route path is `/search`, the full path for the route is `/elasticsearch/search`. Supports: - named path segments `path/{name}`. - optional path segments `path/{position?}`. - multi-segments `path/{coordinates*2}`. Segments are accessible within a handler function as `params` property of [KibanaRequest](./kibana-plugin-server.kibanarequest.md) object. To have read access to `params` you \*must\* specify validation schema with [RouteConfig.validate](./kibana-plugin-server.routeconfig.validate.md). + diff --git a/docs/development/core/server/kibana-plugin-server.routeconfig.validate.md b/docs/development/core/server/kibana-plugin-server.routeconfig.validate.md index f7177485f5fb6..e1ec743ae71cc 100644 --- a/docs/development/core/server/kibana-plugin-server.routeconfig.validate.md +++ b/docs/development/core/server/kibana-plugin-server.routeconfig.validate.md @@ -4,7 +4,7 @@ ## RouteConfig.validate property -A schema created with `@kbn/config-schema` that every request will be validated against. You \*must\* specify a validation schema to be able to read: - url path segments - request query - request body To opt out of validating the request, specify `false`. +A schema created with `@kbn/config-schema` that every request will be validated against. Signature: @@ -12,13 +12,17 @@ A schema created with `@kbn/config-schema` that every request will be validated validate: RouteSchemas | false; ``` +## Remarks + +You \*must\* specify a validation schema to be able to read: - url path segments - request query - request body To opt out of validating the request, specify `validate: false`. In this case request params, query, and body will be \*\*empty\*\* objects and have no access to raw values. In some cases you may want to use another validation library. To do this, you need to instruct the `@kbn/config-schema` library to output \*\*non-validated values\*\* with setting schema as `schema.object({}, { allowUnknowns: true })`; + ## Example ```ts import { schema } from '@kbn/config-schema'; router.get({ - path: 'path/{id}' + path: 'path/{id}', validate: { params: schema.object({ id: schema.string(), @@ -26,7 +30,33 @@ validate: RouteSchemas | false; query: schema.object({...}), body: schema.object({...}), }, - }) +}, +(context, req, res,) { + req.params; // type Readonly<{id: string}> + console.log(req.params.id); // value +}); + +router.get({ + path: 'path/{id}', + validate: false, // handler has no access to params, query, body values. +}, +(context, req, res,) { + req.params; // type Readonly<{}>; + console.log(req.params.id); // undefined +}); + +router.get({ + path: 'path/{id}', + validate: { + // handler has access to raw non-validated params in runtime + params: schema.object({}, { allowUnknowns: true }) + }, +}, +(context, req, res,) { + req.params; // type Readonly<{}>; + console.log(req.params.id); // value + myValidationLibrary.validate({ params: req.params }); +}); ``` diff --git a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callascurrentuser.md b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callascurrentuser.md index ce0c51be08698..1f53270042185 100644 --- a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callascurrentuser.md +++ b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callascurrentuser.md @@ -4,7 +4,7 @@ ## ScopedClusterClient.callAsCurrentUser() method -Calls specified `endpoint` with provided `clientParams` on behalf of the user initiated request to the Kibana server (via HTTP request headers). +Calls specified `endpoint` with provided `clientParams` on behalf of the user initiated request to the Kibana server (via HTTP request headers). See [APICaller](./kibana-plugin-server.apicaller.md). Signature: diff --git a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callasinternaluser.md b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callasinternaluser.md index 59811de18d926..7249af7b429e4 100644 --- a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callasinternaluser.md +++ b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.callasinternaluser.md @@ -4,7 +4,7 @@ ## ScopedClusterClient.callAsInternalUser() method -Calls specified `endpoint` with provided `clientParams` on behalf of the Kibana internal user. +Calls specified `endpoint` with provided `clientParams` on behalf of the Kibana internal user. See [APICaller](./kibana-plugin-server.apicaller.md). Signature: diff --git a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.md b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.md index 7833f698d486d..dcbf869bc9360 100644 --- a/docs/development/core/server/kibana-plugin-server.scopedclusterclient.md +++ b/docs/development/core/server/kibana-plugin-server.scopedclusterclient.md @@ -24,6 +24,6 @@ export declare class ScopedClusterClient implements IScopedClusterClient | Method | Modifiers | Description | | --- | --- | --- | -| [callAsCurrentUser(endpoint, clientParams, options)](./kibana-plugin-server.scopedclusterclient.callascurrentuser.md) | | Calls specified endpoint with provided clientParams on behalf of the user initiated request to the Kibana server (via HTTP request headers). | -| [callAsInternalUser(endpoint, clientParams, options)](./kibana-plugin-server.scopedclusterclient.callasinternaluser.md) | | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. | +| [callAsCurrentUser(endpoint, clientParams, options)](./kibana-plugin-server.scopedclusterclient.callascurrentuser.md) | | Calls specified endpoint with provided clientParams on behalf of the user initiated request to the Kibana server (via HTTP request headers). See [APICaller](./kibana-plugin-server.apicaller.md). | +| [callAsInternalUser(endpoint, clientParams, options)](./kibana-plugin-server.scopedclusterclient.callasinternaluser.md) | | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. See [APICaller](./kibana-plugin-server.apicaller.md). | diff --git a/docs/infrastructure/infra-ui.asciidoc b/docs/infrastructure/infra-ui.asciidoc index e92f6b3f64205..5c8c50a978d63 100644 --- a/docs/infrastructure/infra-ui.asciidoc +++ b/docs/infrastructure/infra-ui.asciidoc @@ -62,29 +62,30 @@ Select *Auto-refresh* to keep up-to-date metrics information coming in, or *Stop [[infra-configure-source]] === Configure the data to use for your metrics +If your metrics have custom index patterns, or use non-default field settings, you can override the default configuration settings. + The default source configuration for metrics is specified in the {kibana-ref}/infrastructure-ui-settings-kb.html[Metrics app settings] in the {kibana-ref}/settings.html[Kibana configuration file]. The default configuration uses the `metricbeat-*` index pattern to query the data. The default configuration also defines field settings for things like timestamps and container names. -If your metrics have custom index patterns, or use non-default field settings, you can override the default settings. -Click *Configuration* to change the settings. -This opens the *Configure source* fly-out dialog. +To change the configuration settings, click the *Settings* tab. NOTE: These settings are shared with logs. Changes you make here may also affect the settings used by the *Logs* app. -In the *Configure source* dialog, you can change the following values: +In the *Settings* tab, you can change the values in these sections: * *Name*: the name of the source configuration -* *Indices*: the index pattern or patterns in the Elasticsearch indices to read metrics data and log data - from +* *Indices*: the index pattern or patterns in the Elasticsearch indices to read metrics data and log data from * *Fields*: the names of specific fields in the indices that are used to query and interpret the data correctly -TIP: If <> are enabled in your Kibana instance, any configuration changes you make here are specific to the current space. -You can make different subsets of data available by creating multiple spaces with different data source configurations. +When you have completed your changes, click *Apply*. -TIP: If you don't see the *Configuration* option, you may not have sufficient privileges to change the source configuration. +If the fields are greyed out and cannot be edited, you may not have sufficient privileges to change the source configuration. For more information see <>. +TIP: If <> are enabled in your Kibana instance, any configuration changes you make here are specific to the current space. +You can make different subsets of data available by creating multiple spaces with different data source configurations. + [float] [[infra-metrics-explorer]] === Visualize multiple metrics in Metrics Explorer diff --git a/docs/logs/configuring.asciidoc b/docs/logs/configuring.asciidoc index f2aa1e5e17b8f..6b54721f92e89 100644 --- a/docs/logs/configuring.asciidoc +++ b/docs/logs/configuring.asciidoc @@ -1,50 +1,46 @@ [role="xpack"] [[xpack-logs-configuring]] -:ecs-link: {ecs-ref}[Elastic Common Schema (ECS)] +:ecs-base-link: {ecs-ref}/ecs-base.html[base] == Configuring the Logs data The default source configuration for logs is specified in the {kibana-ref}/logs-ui-settings-kb.html[Logs app settings] in the {kibana-ref}/settings.html[Kibana configuration file]. The default configuration uses the `filebeat-*` index pattern to query the data. -The default configuration also defines field settings for things like timestamps and container names, and the default columns to show in the logs pane. +The default configuration also defines field settings for things like timestamps and container names, and the default columns to show in the logs stream. -If your logs have custom index patterns, or use non-default field settings, or contain parsed fields which you want to expose as individual columns, you can override the default settings. -Click *Configuration* to change the settings. -This opens the *Configure source* fly-out dialog. +If your logs have custom index patterns, use non-default field settings, or contain parsed fields which you want to expose as individual columns, you can override the default configuration settings. -NOTE: These settings are shared with metrics. Changes you make here may also affect the settings used by the *Metrics* app. - -TIP: If <> are enabled in your Kibana instance, any configuration changes you make here are specific to the current space. -You can make different subsets of data available by creating multiple spaces with different data source configurations. +To change the configuration settings, click the *Settings* tab. -TIP: If you don't see the *Configuration* option, you may not have sufficient privileges to change the source configuration. -For more information see <>. - -[float] -=== Indices and fields tab +NOTE: These settings are shared with metrics. Changes you make here may also affect the settings used by the *Metrics* app. -In the *Indices and fields* tab, you can change the following values: +In the *Settings* tab, you can change the values in these sections: * *Name*: the name of the source configuration * *Indices*: the index pattern or patterns in the Elasticsearch indices to read metrics data and log data from * *Fields*: the names of specific fields in the indices that are used to query and interpret the data correctly +* *Log columns*: the columns that are shown in the logs stream -[float] -==== Log columns configuration - -In the *Log columns* tab you can change the columns that are displayed in the Logs app. -By default the following columns are shown: +By default the logs stream shows following columns: * *Timestamp*: The timestamp of the log entry from the `timestamp` field. * *Message*: The message extracted from the document. The content of this field depends on the type of log message. -If no special log message type is detected, the {ecs-link} field `message` is used. -// ++ add a better link. The actual page location is ecs-base +If no special log message type is detected, the Elastic Common Schema (ECS) {ecs-base-link} field, `message`, is used. -To add a new column, click *Add column*. +To add a new column to the logs stream, in the *Settings* tab, click *Add column*. In the list of available fields, select the field you want to add. You can start typing a field name in the search box to filter the field list by that name. To remove an existing column, click the *Remove this column* icon -image:logs/images/logs-configure-source-dialog-remove-column-button.png[Remove column]. \ No newline at end of file +image:logs/images/logs-configure-source-dialog-remove-column-button.png[Remove column]. + +When you have completed your changes, click *Apply*. + +If the fields are greyed out and cannot be edited, you may not have sufficient privileges to change the source configuration. +For more information see <>. + +TIP: If <> are enabled in your Kibana instance, any configuration changes you make here are specific to the current space. +You can make different subsets of data available by creating multiple spaces with different data source configurations. + diff --git a/docs/logs/using.asciidoc b/docs/logs/using.asciidoc index bebc225feb0e6..65693f4399e53 100644 --- a/docs/logs/using.asciidoc +++ b/docs/logs/using.asciidoc @@ -43,6 +43,11 @@ To quickly jump to a nearby point in time, click the minimap timeline to the rig Click *Customize* to customize the view. Here, you can set the scale to use for the minimap timeline, choose whether to wrap long lines, and choose your preferred text size. +[float] +=== Configuring the data to use for your logs + +If your logs have custom index patterns, use non-default field settings, or contain parsed fields which you want to expose as individual columns, you can <>. + [float] [[logs-stream]] === Stream or pause logs @@ -70,10 +75,10 @@ To highlight a word or phrase in the logs stream, click *Highlights* and enter y To inspect a log event, hover over it, then click the *View details* icon image:logs/images/logs-view-event.png[View event icon] beside the event. This opens the *Log event document details* fly-out that shows the fields associated with the log event. -To quickly filter the logs stream by one of the field values, click the *View event with filter* icon image:logs/images/logs-view-event-with-filter.png[View event icon] beside the field. +To quickly filter the logs stream by one of the field values, in the log event details, click the *View event with filter* icon image:logs/images/logs-view-event-with-filter.png[View event icon] beside the field. This automatically adds a search filter to the logs stream to filter the entries by this field and value. -In the log event details, click *Actions* to see the other actions related to the event. +To see other actions related to the event, in the log event details, click *Actions*. Depending on the event and the features you have installed and configured, you may also be able to: * Select *View status in Uptime* to <> in the *Uptime* app. diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index 2e9118fef46fa..caff7f5b1fdc6 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -94,7 +94,7 @@ refresh the page to apply the setting. the time filter. This should be an array of objects, with each object containing `from`, `to` (see {ref}/common-options.html#date-math[accepted formats]), and `display` (the title to be displayed). -`timepicker:refreshIntervalDefaults`:: The default refresh interval for the time filter. +`timepicker:refreshIntervalDefaults`:: The default refresh interval for the time filter. Example: `{ "display": "15 seconds", "pause": true, "value": 15000 }`. `timepicker:timeDefaults`:: The default selection in the time filter. `truncate:maxHeight`:: The maximum height that a cell occupies in a table. Set to 0 to disable truncation. @@ -268,6 +268,3 @@ If disabled, only visualizations that are considered production-ready are availa Helps improve the Elastic Stack by providing usage statistics for basic features. This data will not be shared outside of Elastic. - - - diff --git a/docs/setup/upgrade.asciidoc b/docs/setup/upgrade.asciidoc index 05294f8694461..ce0259c690b82 100644 --- a/docs/setup/upgrade.asciidoc +++ b/docs/setup/upgrade.asciidoc @@ -1,58 +1,62 @@ [[upgrade]] == Upgrading {kib} +Depending on the {kib} version you're upgrading from, the upgrade process to 7.0 +varies. -[IMPORTANT] -=========================================== -Before upgrading {kib}: +[float] +[[upgrade-before-you-begin]] +=== Before you begin -* Consult the <> docs. -* Test upgrades in a dev environment before upgrading your production servers. -* Backup your data using the {es} {ref}/modules-snapshots.html[snapshots] feature. - You **cannot roll back** to an earlier version unless you have a backup of - your data. -* If you are using custom plugins, check that a compatible version is - available. -=========================================== +Before you upgrade {kib}: -Depending on which version of {kib} you're upgrading from, the upgrade process to 7.0 -will vary. +* Consult the <>. +* Before you upgrade production servers, test the upgrades in a dev environment. +* Backup your data with {es} {ref}/modules-snapshots.html[snapshots]. + To roll back to an earlier version, you **must** have a backup of your data. +* If you are using custom plugins, check that a compatible version is + available. +* Shut down all {kib} nodes. Running more than one {kib} version against the + same Elasticseach index is unsupported. If you upgrade while older {kib} nodes are + running, the upgrade can fail. -The recommended path is to upgrade to 6.7 before upgrading to 7.0. -This makes it easier to identify the changes you need to make to upgrade and enables -you to perform a rolling upgrade with no downtime. +To identify the changes you need to make to upgrade, and to enable you to +perform an Elasticsearch rolling upgrade with no downtime, you must upgrade to +6.7 before you upgrade to 7.0. -Please see -*{stack-ref}/upgrading-elastic-stack.html[Upgrading the Elastic Stack]* for a -comprehensive overview of the upgrade process. +For a comprehensive overview of the upgrade process, refer to +*{stack-ref}/upgrading-elastic-stack.html[Upgrading the Elastic Stack]*. [float] -==== Upgrading from 5.x or earlier -{es} can read indices created in the previous major version. If you have indices -created in 5.x or before, you must reindex or delete them before upgrading to 7.0.0. -See {stack-ref}/upgrading-elastic-stack.html#oss-stack-upgrade[Upgrading the Elastic Stack] -for more information. - -Once your reindex is complete, you can follow the <> +[[upgrade-5x-earlier]] +=== Upgrading from 5.x or earlier +{es} can read indices created in the previous major version. Before you upgrade +to 7.0.0, you must reindex or delete any indices created in 5.x or earlier. +For more information, refer to +{stack-ref}/upgrading-elastic-stack.html#oss-stack-upgrade[Upgrading the Elastic Stack]. + +When your reindex is complete, follow the <> instructions. [float] -==== Upgrading from 6.x +[[upgrade-6x]] +=== Upgrading from 6.x The recommended path is to upgrade to 6.7 before upgrading to 7.0. This makes it -easier to identify the required changes, and enables you to use the Upgrade Assistant -to prepare for your upgrade to 7.0 (see below). +easier to identify the required changes, and enables you to use the Upgrade +Assistant to prepare for your upgrade to 7.0. -*Note:* Saved searches, visualizations, and dashboards created in {kib} 6.x -can be generally imported into 7.x. +TIP: The ability to import {kib} 6.x saved searches, visualizations, and +dashboards is supported. [float] -==== Upgrading from 6.7 -6.7 includes an https://www.elastic.co/guide/en/kibana/6.7/upgrade-assistant.html[Upgrade Assistant] -to help you prepare for your upgrade to 7.0. To access the assistant, go to *Management > 7.0 Upgrade Assistant*. +[[upgrade-67]] +=== Upgrading from 6.7 +To help you prepare for your upgrade to 7.0, 6.7 includes an https://www.elastic.co/guide/en/kibana/6.7/upgrade-assistant.html[Upgrade Assistant] +To access the assistant, go to *Management > 7.0 Upgrade Assistant*. -After you have addressed any issues that were identified by the Upgrade Assistant, -<>. +After you have addressed any issues that were identified by the Upgrade +Assistant, <>. include::upgrade/upgrade-standard.asciidoc[] diff --git a/package.json b/package.json index 29410042a865d..b1ba573ffaf5a 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "@elastic/charts": "^13.5.1", "@elastic/datemath": "5.0.2", "@elastic/ems-client": "^1.0.2", - "@elastic/eui": "14.4.0", + "@elastic/eui": "14.5.0", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.3.3", diff --git a/packages/kbn-es-query/src/filters/lib/meta_filter.ts b/packages/kbn-es-query/src/filters/lib/meta_filter.ts index 7740dfa644353..8f6aef782cea2 100644 --- a/packages/kbn-es-query/src/filters/lib/meta_filter.ts +++ b/packages/kbn-es-query/src/filters/lib/meta_filter.ts @@ -26,6 +26,12 @@ export interface FilterState { store: FilterStateStore; } +type FilterFormatterFunction = (value: any) => string; +export interface FilterValueFormatter { + convert: FilterFormatterFunction; + getConverterFor: (type: string) => FilterFormatterFunction; +} + export interface FilterMeta { // index and type are optional only because when you create a new filter, there are no defaults index?: string; @@ -34,7 +40,7 @@ export interface FilterMeta { negate: boolean; alias: string | null; key?: string; - value?: string; + value?: string | ((formatter?: FilterValueFormatter) => string); params?: any; } diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 02195c794d280..71279ad6fed03 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -17,13 +17,13 @@ * under the License. */ -import React, { MouseEventHandler } from 'react'; +import React from 'react'; import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs'; import { map, takeUntil } from 'rxjs/operators'; import * as Url from 'url'; import { i18n } from '@kbn/i18n'; -import { IconType } from '@elastic/eui'; +import { IconType, Breadcrumb as EuiBreadcrumb } from '@elastic/eui'; import { InjectedMetadataStart } from '../injected_metadata'; import { NotificationsStart } from '../notifications'; @@ -59,12 +59,7 @@ export interface ChromeBrand { } /** @public */ -export interface ChromeBreadcrumb { - text: string; - href?: string; - 'data-test-subj'?: string; - onClick?: MouseEventHandler; -} +export type ChromeBreadcrumb = EuiBreadcrumb; /** @public */ export type ChromeHelpExtension = (element: HTMLDivElement) => () => void; diff --git a/src/core/public/chrome/ui/header/__snapshots__/header_breadcrumbs.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header_breadcrumbs.test.tsx.snap index 2df1c616b04b3..d089019915686 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/header_breadcrumbs.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/header_breadcrumbs.test.tsx.snap @@ -5,7 +5,6 @@ exports[`HeaderBreadcrumbs renders updates to the breadcrumbs$ observable 1`] = aria-current="page" className="euiBreadcrumb euiBreadcrumb--last" data-test-subj="breadcrumb first last" - title="First" > First @@ -18,7 +17,6 @@ Array [ color="subdued" data-test-subj="breadcrumb first" title="First" - type="button" >