mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Generate core API docs from TSDoc comments (#32148)
* Generate core API docs from TSDoc comments Uses api-extractor and api-documenter to generate documentation for the Kibana core API from TSDoc comments in the source code. Documentation can be generated using `npm run docs:api`. I used --no-verify to ignore the following pre-commit hook errors: 1. Filenames MUST use snake_case - api-extractor.json It's possible to specify a different config file, but I prefer to keep the "standard" config file name. 2. UNHANDLED ERROR: Unable to find tsconfig.json file selecting "common/core_api_review/kibana.api.ts". Ensure one exists and it is listed in "src/dev/typescript/projects.ts" This is not a source file, so safe to ignore. * Flesh out API docs a little bit * Ignore snake_case check for api-extractor.json * Ignore api-extractor's review file from pre-commit check * Try to fix build failing by using masters yarn.lock * I'm being stupid * Found a better home for ignoring common/core_api_review/kibana.api.ts * Node script for detecting core API changes I initially wanted to include this as a precommit hook, but it takes quite long to execute (~12s) so might be better suited as a test or as part of the release process. The script currently fails because api-extractor uses an older version of typescript. * Fix tslint precommit hook ignore condition * Write tsdoc-metadata.json into ./build * Add LogMeta and ElasticSearch to exported types & docs * Suppress logging when running api-extractor from script * Improve check_core_api_changes script and run as test * Inline api-extractor.json config * Fix check_core_api_changes --help flag * LogMeta TSDoc comments * check_core_api_changes: fail if api-extractor produces warnings or errors And print more useful messages to the console * Move ignored ts files list into dev/file * Add back build:types since api-exporter cannot operate on source files * Upgrade api-exporter/documenter * api-extractor: independantly analyze core/public and core/server Becasue of https://github.com/Microsoft/web-build-tools/issues/1029 api-extractor can't use core/index.ts as a single entry point for analyzing the public and server API's as isolated namespaces. Instead we analyze these projects separately. This introduces other problems like the api review files and documentation always being called "kibana." from the package.json filename. * Build types as part of build task * Include types in typescript browser compilation * Force inclusion of core/public for building types * Fix api review filename in api-exporter errors * Update docs and API review files * Fix api-extractor warnings * Remove ts file ignored list since it's no longer necessary * Rename exported api package name * Review comments * Export other missing types * Upgrade api-documenter to latest beta * Export more missing types * Fix warnings and add api-exporter to Jenkins tests * Correctly handle runBuildTypes() exceptions * Fix another swallowed exception * Fix api-extractor warnings after master merge
This commit is contained in:
parent
c7c9356c4f
commit
d2ba1d097d
126 changed files with 2452 additions and 84 deletions
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [BasePathSetup](./kibana-plugin-public.basepathsetup.md)
|
||||
|
||||
## BasePathSetup type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type BasePathSetup = ReturnType<BasePathService['setup']>;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBrand](./kibana-plugin-public.chromebrand.md) > [logo](./kibana-plugin-public.chromebrand.logo.md)
|
||||
|
||||
## ChromeBrand.logo property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
logo?: string;
|
||||
```
|
|
@ -0,0 +1,18 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBrand](./kibana-plugin-public.chromebrand.md)
|
||||
|
||||
## ChromeBrand interface
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface ChromeBrand
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [logo](./kibana-plugin-public.chromebrand.logo.md) | <code>string</code> | |
|
||||
| [smallLogo](./kibana-plugin-public.chromebrand.smalllogo.md) | <code>string</code> | |
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBrand](./kibana-plugin-public.chromebrand.md) > [smallLogo](./kibana-plugin-public.chromebrand.smalllogo.md)
|
||||
|
||||
## ChromeBrand.smallLogo property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
smallLogo?: string;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [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
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
'data-test-subj'?: string;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) > [href](./kibana-plugin-public.chromebreadcrumb.href.md)
|
||||
|
||||
## ChromeBreadcrumb.href property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
href?: string;
|
||||
```
|
|
@ -0,0 +1,19 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md)
|
||||
|
||||
## ChromeBreadcrumb interface
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface ChromeBreadcrumb
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [data-test-subj](./kibana-plugin-public.chromebreadcrumb.data-test-subj.md) | <code>string</code> | |
|
||||
| [href](./kibana-plugin-public.chromebreadcrumb.href.md) | <code>string</code> | |
|
||||
| [text](./kibana-plugin-public.chromebreadcrumb.text.md) | <code>string</code> | |
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) > [text](./kibana-plugin-public.chromebreadcrumb.text.md)
|
||||
|
||||
## ChromeBreadcrumb.text property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
text: string;
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md)
|
||||
|
||||
## ChromeHelpExtension type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type ChromeHelpExtension = (element: HTMLDivElement) => (() => void);
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ChromeSetup](./kibana-plugin-public.chromesetup.md)
|
||||
|
||||
## ChromeSetup type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type ChromeSetup = ReturnType<ChromeService['setup']>;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [basePath](./kibana-plugin-public.coresetup.basepath.md)
|
||||
|
||||
## CoreSetup.basePath property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
basePath: BasePathSetup;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [chrome](./kibana-plugin-public.coresetup.chrome.md)
|
||||
|
||||
## CoreSetup.chrome property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
chrome: ChromeSetup;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [fatalErrors](./kibana-plugin-public.coresetup.fatalerrors.md)
|
||||
|
||||
## CoreSetup.fatalErrors property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
fatalErrors: FatalErrorsSetup;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [http](./kibana-plugin-public.coresetup.http.md)
|
||||
|
||||
## CoreSetup.http property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
http: HttpSetup;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [i18n](./kibana-plugin-public.coresetup.i18n.md)
|
||||
|
||||
## CoreSetup.i18n property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
i18n: I18nSetup;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md)
|
||||
|
||||
## CoreSetup.injectedMetadata property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
injectedMetadata: InjectedMetadataSetup;
|
||||
```
|
|
@ -0,0 +1,25 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md)
|
||||
|
||||
## CoreSetup interface
|
||||
|
||||
Core services exposed to the start lifecycle
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface CoreSetup
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [basePath](./kibana-plugin-public.coresetup.basepath.md) | <code>BasePathSetup</code> | |
|
||||
| [chrome](./kibana-plugin-public.coresetup.chrome.md) | <code>ChromeSetup</code> | |
|
||||
| [fatalErrors](./kibana-plugin-public.coresetup.fatalerrors.md) | <code>FatalErrorsSetup</code> | |
|
||||
| [http](./kibana-plugin-public.coresetup.http.md) | <code>HttpSetup</code> | |
|
||||
| [i18n](./kibana-plugin-public.coresetup.i18n.md) | <code>I18nSetup</code> | |
|
||||
| [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md) | <code>InjectedMetadataSetup</code> | |
|
||||
| [notifications](./kibana-plugin-public.coresetup.notifications.md) | <code>NotificationsSetup</code> | |
|
||||
| [uiSettings](./kibana-plugin-public.coresetup.uisettings.md) | <code>UiSettingsSetup</code> | |
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [notifications](./kibana-plugin-public.coresetup.notifications.md)
|
||||
|
||||
## CoreSetup.notifications property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
notifications: NotificationsSetup;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [CoreSetup](./kibana-plugin-public.coresetup.md) > [uiSettings](./kibana-plugin-public.coresetup.uisettings.md)
|
||||
|
||||
## CoreSetup.uiSettings property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
uiSettings: UiSettingsSetup;
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md)
|
||||
|
||||
## FatalErrorsSetup type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type FatalErrorsSetup = ReturnType<FatalErrorsService['setup']>;
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [HttpSetup](./kibana-plugin-public.httpsetup.md)
|
||||
|
||||
## HttpSetup type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type HttpSetup = ReturnType<HttpService['setup']>;
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [I18nSetup](./kibana-plugin-public.i18nsetup.md)
|
||||
|
||||
## I18nSetup type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type I18nSetup = ReturnType<I18nService['setup']>;
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [InjectedMetadataSetup](./kibana-plugin-public.injectedmetadatasetup.md)
|
||||
|
||||
## InjectedMetadataSetup type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type InjectedMetadataSetup = ReturnType<InjectedMetadataService['setup']>;
|
||||
```
|
35
docs/development/core/public/kibana-plugin-public.md
Normal file
35
docs/development/core/public/kibana-plugin-public.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md)
|
||||
|
||||
## kibana-plugin-public package
|
||||
|
||||
## Classes
|
||||
|
||||
| Class | Description |
|
||||
| --- | --- |
|
||||
| [ToastsSetup](./kibana-plugin-public.toastssetup.md) | |
|
||||
| [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) | |
|
||||
|
||||
## Interfaces
|
||||
|
||||
| Interface | Description |
|
||||
| --- | --- |
|
||||
| [ChromeBrand](./kibana-plugin-public.chromebrand.md) | |
|
||||
| [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) | |
|
||||
| [CoreSetup](./kibana-plugin-public.coresetup.md) | Core services exposed to the start lifecycle |
|
||||
| [UiSettingsState](./kibana-plugin-public.uisettingsstate.md) | |
|
||||
|
||||
## Type Aliases
|
||||
|
||||
| Type Alias | Description |
|
||||
| --- | --- |
|
||||
| [BasePathSetup](./kibana-plugin-public.basepathsetup.md) | |
|
||||
| [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) | |
|
||||
| [ChromeSetup](./kibana-plugin-public.chromesetup.md) | |
|
||||
| [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md) | |
|
||||
| [HttpSetup](./kibana-plugin-public.httpsetup.md) | |
|
||||
| [I18nSetup](./kibana-plugin-public.i18nsetup.md) | |
|
||||
| [InjectedMetadataSetup](./kibana-plugin-public.injectedmetadatasetup.md) | |
|
||||
| [NotificationsSetup](./kibana-plugin-public.notificationssetup.md) | |
|
||||
| [ToastInput](./kibana-plugin-public.toastinput.md) | |
|
||||
| [UiSettingsSetup](./kibana-plugin-public.uisettingssetup.md) | |
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [NotificationsSetup](./kibana-plugin-public.notificationssetup.md)
|
||||
|
||||
## NotificationsSetup type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type NotificationsSetup = ReturnType<NotificationsService['setup']>;
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastInput](./kibana-plugin-public.toastinput.md)
|
||||
|
||||
## ToastInput type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type ToastInput = string | Pick<Toast, Exclude<keyof Toast, 'id'>>;
|
||||
```
|
|
@ -0,0 +1,20 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsSetup](./kibana-plugin-public.toastssetup.md) > [add](./kibana-plugin-public.toastssetup.add.md)
|
||||
|
||||
## ToastsSetup.add() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
add(toastOrTitle: ToastInput): Toast;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| toastOrTitle | <code>ToastInput</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Toast`
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsSetup](./kibana-plugin-public.toastssetup.md) > [addDanger](./kibana-plugin-public.toastssetup.adddanger.md)
|
||||
|
||||
## ToastsSetup.addDanger() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
addDanger(toastOrTitle: ToastInput): Toast;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| toastOrTitle | <code>ToastInput</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Toast`
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsSetup](./kibana-plugin-public.toastssetup.md) > [addSuccess](./kibana-plugin-public.toastssetup.addsuccess.md)
|
||||
|
||||
## ToastsSetup.addSuccess() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
addSuccess(toastOrTitle: ToastInput): Toast;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| toastOrTitle | <code>ToastInput</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Toast`
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsSetup](./kibana-plugin-public.toastssetup.md) > [addWarning](./kibana-plugin-public.toastssetup.addwarning.md)
|
||||
|
||||
## ToastsSetup.addWarning() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
addWarning(toastOrTitle: ToastInput): Toast;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| toastOrTitle | <code>ToastInput</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Toast`
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsSetup](./kibana-plugin-public.toastssetup.md) > [get$](./kibana-plugin-public.toastssetup.get$.md)
|
||||
|
||||
## ToastsSetup.get$() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
get$(): Rx.Observable<Toast[]>;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
`Rx.Observable<Toast[]>`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsSetup](./kibana-plugin-public.toastssetup.md)
|
||||
|
||||
## ToastsSetup class
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare class ToastsSetup
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [add(toastOrTitle)](./kibana-plugin-public.toastssetup.add.md) | | |
|
||||
| [addDanger(toastOrTitle)](./kibana-plugin-public.toastssetup.adddanger.md) | | |
|
||||
| [addSuccess(toastOrTitle)](./kibana-plugin-public.toastssetup.addsuccess.md) | | |
|
||||
| [addWarning(toastOrTitle)](./kibana-plugin-public.toastssetup.addwarning.md) | | |
|
||||
| [get$()](./kibana-plugin-public.toastssetup.get$.md) | | |
|
||||
| [remove(toast)](./kibana-plugin-public.toastssetup.remove.md) | | |
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [ToastsSetup](./kibana-plugin-public.toastssetup.md) > [remove](./kibana-plugin-public.toastssetup.remove.md)
|
||||
|
||||
## ToastsSetup.remove() method
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
remove(toast: Toast): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| toast | <code>Toast</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [get$](./kibana-plugin-public.uisettingsclient.get$.md)
|
||||
|
||||
## UiSettingsClient.get$() method
|
||||
|
||||
Gets an observable of the current value for a config key, and all updates to that config key in the future. Providing a `defaultOverride` argument behaves the same as it does in \#get()
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
get$(key: string, defaultOverride?: any): Rx.Observable<any>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
| defaultOverride | <code>any</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Rx.Observable<any>`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [get](./kibana-plugin-public.uisettingsclient.get.md)
|
||||
|
||||
## UiSettingsClient.get() method
|
||||
|
||||
Gets the value for a specific uiSetting. If this setting has no user-defined value then the `defaultOverride` parameter is returned (and parsed if setting is of type "json" or "number). If the parameter is not defined and the key is not defined by a uiSettingDefaults then an error is thrown, otherwise the default is read from the uiSettingDefaults.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
get(key: string, defaultOverride?: any): any;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
| defaultOverride | <code>any</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`any`
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [getAll](./kibana-plugin-public.uisettingsclient.getall.md)
|
||||
|
||||
## UiSettingsClient.getAll() method
|
||||
|
||||
Gets the metadata about all uiSettings, including the type, default value, and user value for each key.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
getAll(): UiSettingsState;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
`UiSettingsState`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [getSaved$](./kibana-plugin-public.uisettingsclient.getsaved$.md)
|
||||
|
||||
## UiSettingsClient.getSaved$() method
|
||||
|
||||
Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
getSaved$(): Rx.Observable<{
|
||||
key: string;
|
||||
newValue: any;
|
||||
oldValue: any;
|
||||
}>;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
`Rx.Observable<{
|
||||
key: string;
|
||||
newValue: any;
|
||||
oldValue: any;
|
||||
}>`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [getUpdate$](./kibana-plugin-public.uisettingsclient.getupdate$.md)
|
||||
|
||||
## UiSettingsClient.getUpdate$() method
|
||||
|
||||
Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
getUpdate$(): Rx.Observable<{
|
||||
key: string;
|
||||
newValue: any;
|
||||
oldValue: any;
|
||||
}>;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
`Rx.Observable<{
|
||||
key: string;
|
||||
newValue: any;
|
||||
oldValue: any;
|
||||
}>`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [isCustom](./kibana-plugin-public.uisettingsclient.iscustom.md)
|
||||
|
||||
## UiSettingsClient.isCustom() method
|
||||
|
||||
Returns true if the setting is not a part of the uiSettingDefaults, but was either added directly via `set()`<!-- -->, or is an unknown setting found in the uiSettings saved object
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isCustom(key: string): boolean;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`boolean`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [isDeclared](./kibana-plugin-public.uisettingsclient.isdeclared.md)
|
||||
|
||||
## UiSettingsClient.isDeclared() method
|
||||
|
||||
Returns true if the key is a "known" uiSetting, meaning it is either defined in the uiSettingDefaults or was previously added as a custom setting via the `set()` method.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isDeclared(key: string): boolean;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`boolean`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [isDefault](./kibana-plugin-public.uisettingsclient.isdefault.md)
|
||||
|
||||
## UiSettingsClient.isDefault() method
|
||||
|
||||
Returns true if the setting has no user-defined value or is unknown
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isDefault(key: string): boolean;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`boolean`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [isOverridden](./kibana-plugin-public.uisettingsclient.isoverridden.md)
|
||||
|
||||
## UiSettingsClient.isOverridden() method
|
||||
|
||||
Returns true if a settings value is overridden by the server. When a setting is overridden its value can not be changed via `set()` or `remove()`<!-- -->.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
isOverridden(key: string): boolean;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`boolean`
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md)
|
||||
|
||||
## UiSettingsClient class
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare class UiSettingsClient
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [params](./kibana-plugin-public.uisettingsclient.params.md) | | <code>UiSettingsClientParams</code> | |
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [get(key, defaultOverride)](./kibana-plugin-public.uisettingsclient.get.md) | | Gets the value for a specific uiSetting. If this setting has no user-defined value then the <code>defaultOverride</code> parameter is returned (and parsed if setting is of type "json" or "number). If the parameter is not defined and the key is not defined by a uiSettingDefaults then an error is thrown, otherwise the default is read from the uiSettingDefaults. |
|
||||
| [get$(key, defaultOverride)](./kibana-plugin-public.uisettingsclient.get$.md) | | Gets an observable of the current value for a config key, and all updates to that config key in the future. Providing a <code>defaultOverride</code> argument behaves the same as it does in \#get() |
|
||||
| [getAll()](./kibana-plugin-public.uisettingsclient.getall.md) | | Gets the metadata about all uiSettings, including the type, default value, and user value for each key. |
|
||||
| [getSaved$()](./kibana-plugin-public.uisettingsclient.getsaved$.md) | | Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed. |
|
||||
| [getUpdate$()](./kibana-plugin-public.uisettingsclient.getupdate$.md) | | Returns an Observable that notifies subscribers of each update to the uiSettings, including the key, newValue, and oldValue of the setting that changed. |
|
||||
| [isCustom(key)](./kibana-plugin-public.uisettingsclient.iscustom.md) | | Returns true if the setting is not a part of the uiSettingDefaults, but was either added directly via <code>set()</code>, or is an unknown setting found in the uiSettings saved object |
|
||||
| [isDeclared(key)](./kibana-plugin-public.uisettingsclient.isdeclared.md) | | Returns true if the key is a "known" uiSetting, meaning it is either defined in the uiSettingDefaults or was previously added as a custom setting via the <code>set()</code> method. |
|
||||
| [isDefault(key)](./kibana-plugin-public.uisettingsclient.isdefault.md) | | Returns true if the setting has no user-defined value or is unknown |
|
||||
| [isOverridden(key)](./kibana-plugin-public.uisettingsclient.isoverridden.md) | | Returns true if a settings value is overridden by the server. When a setting is overridden its value can not be changed via <code>set()</code> or <code>remove()</code>. |
|
||||
| [overrideLocalDefault(key, newDefault)](./kibana-plugin-public.uisettingsclient.overridelocaldefault.md) | | Overrides the default value for a setting in this specific browser tab. If the page is reloaded the default override is lost. |
|
||||
| [remove(key)](./kibana-plugin-public.uisettingsclient.remove.md) | | Removes the user-defined value for a setting, causing it to revert to the default. This method behaves the same as calling <code>set(key, null)</code>, including the synchronization, custom setting, and error behavior of that method. |
|
||||
| [set(key, val)](./kibana-plugin-public.uisettingsclient.set.md) | | Sets the value for a uiSetting. If the setting is not defined in the uiSettingDefaults it will be stored as a custom setting. The new value will be synchronously available via the <code>get()</code> method and sent to the server in the background. If the request to the server fails then a toast notification will be displayed and the setting will be reverted it its value before <code>set()</code> was called. |
|
||||
| [stop()](./kibana-plugin-public.uisettingsclient.stop.md) | | Prepares the uiSettingsClient to be discarded, completing any update$ observables that have been created. |
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [overrideLocalDefault](./kibana-plugin-public.uisettingsclient.overridelocaldefault.md)
|
||||
|
||||
## UiSettingsClient.overrideLocalDefault() method
|
||||
|
||||
Overrides the default value for a setting in this specific browser tab. If the page is reloaded the default override is lost.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
overrideLocalDefault(key: string, newDefault: any): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
| newDefault | <code>any</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [params](./kibana-plugin-public.uisettingsclient.params.md)
|
||||
|
||||
## UiSettingsClient.params property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
readonly params: UiSettingsClientParams;
|
||||
```
|
|
@ -0,0 +1,22 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [remove](./kibana-plugin-public.uisettingsclient.remove.md)
|
||||
|
||||
## UiSettingsClient.remove() method
|
||||
|
||||
Removes the user-defined value for a setting, causing it to revert to the default. This method behaves the same as calling `set(key, null)`<!-- -->, including the synchronization, custom setting, and error behavior of that method.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
remove(key: string): Promise<boolean>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<boolean>`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [set](./kibana-plugin-public.uisettingsclient.set.md)
|
||||
|
||||
## UiSettingsClient.set() method
|
||||
|
||||
Sets the value for a uiSetting. If the setting is not defined in the uiSettingDefaults it will be stored as a custom setting. The new value will be synchronously available via the `get()` method and sent to the server in the background. If the request to the server fails then a toast notification will be displayed and the setting will be reverted it its value before `set()` was called.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
set(key: string, val: any): Promise<boolean>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| key | <code>string</code> | |
|
||||
| val | <code>any</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<boolean>`
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) > [stop](./kibana-plugin-public.uisettingsclient.stop.md)
|
||||
|
||||
## UiSettingsClient.stop() method
|
||||
|
||||
Prepares the uiSettingsClient to be discarded, completing any update$ observables that have been created.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
stop(): void;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsSetup](./kibana-plugin-public.uisettingssetup.md)
|
||||
|
||||
## UiSettingsSetup type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type UiSettingsSetup = UiSettingsClient;
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-public](./kibana-plugin-public.md) > [UiSettingsState](./kibana-plugin-public.uisettingsstate.md)
|
||||
|
||||
## UiSettingsState interface
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface UiSettingsState
|
||||
```
|
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [APICaller](./kibana-plugin-server.apicaller.md)
|
||||
|
||||
## APICaller type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type APICaller = (endpoint: string, clientParams: Record<string, unknown>, options?: CallAPIOptions) => Promise<unknown>;
|
||||
```
|
|
@ -0,0 +1,18 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [CallAPIOptions](./kibana-plugin-server.callapioptions.md)
|
||||
|
||||
## CallAPIOptions interface
|
||||
|
||||
The set of options that defines how API call should be made and result be processed.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface CallAPIOptions
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [wrap401Errors](./kibana-plugin-server.callapioptions.wrap401errors.md) | <code>boolean</code> | Indicates whether <code>401 Unauthorized</code> errors returned from the Elasticsearch API should be wrapped into <code>Boom</code> error instances with properly set <code>WWW-Authenticate</code> header that could have been returned by the API itself. If API didn't specify that then <code>Basic realm="Authorization Required"</code> is used as <code>WWW-Authenticate</code>. |
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [CallAPIOptions](./kibana-plugin-server.callapioptions.md) > [wrap401Errors](./kibana-plugin-server.callapioptions.wrap401errors.md)
|
||||
|
||||
## CallAPIOptions.wrap401Errors property
|
||||
|
||||
Indicates whether `401 Unauthorized` errors returned from the Elasticsearch API should be wrapped into `Boom` error instances with properly set `WWW-Authenticate` header that could have been returned by the API itself. If API didn't specify that then `Basic realm="Authorization Required"` is used as `WWW-Authenticate`<!-- -->.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
wrap401Errors: boolean;
|
||||
```
|
|
@ -0,0 +1,24 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [ClusterClient](./kibana-plugin-server.clusterclient.md) > [asScoped](./kibana-plugin-server.clusterclient.asscoped.md)
|
||||
|
||||
## 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.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
asScoped(req?: {
|
||||
headers?: Headers;
|
||||
}): ScopedClusterClient;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| req | <code>{`<p/>` headers?: Headers;`<p/>` }</code> | Request the <code>ScopedClusterClient</code> instance will be scoped to. |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`ScopedClusterClient`
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [ClusterClient](./kibana-plugin-server.clusterclient.md) > [callAsInternalUser](./kibana-plugin-server.clusterclient.callasinternaluser.md)
|
||||
|
||||
## ClusterClient.callAsInternalUser property
|
||||
|
||||
Calls specified endpoint with provided clientParams on behalf of the Kibana internal user.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
callAsInternalUser: (endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions | undefined) => Promise<any>;
|
||||
```
|
|
@ -0,0 +1,15 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [ClusterClient](./kibana-plugin-server.clusterclient.md) > [close](./kibana-plugin-server.clusterclient.close.md)
|
||||
|
||||
## ClusterClient.close() method
|
||||
|
||||
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.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
close(): void;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [ClusterClient](./kibana-plugin-server.clusterclient.md)
|
||||
|
||||
## ClusterClient class
|
||||
|
||||
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(...)`<!-- -->).
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare class ClusterClient
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [callAsInternalUser](./kibana-plugin-server.clusterclient.callasinternaluser.md) | | <code>(endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions | undefined) => Promise<any></code> | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. |
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [asScoped(req)](./kibana-plugin-server.clusterclient.asscoped.md) | | Creates an instance of <code>ScopedClusterClient</code> based on the configuration the current cluster client that exposes additional <code>callAsCurrentUser</code> 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. |
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [CoreSetup](./kibana-plugin-server.coresetup.md) > [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md)
|
||||
|
||||
## CoreSetup.elasticsearch property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
elasticsearch: ElasticsearchServiceSetup;
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [CoreSetup](./kibana-plugin-server.coresetup.md) > [http](./kibana-plugin-server.coresetup.http.md)
|
||||
|
||||
## CoreSetup.http property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
http: HttpServiceSetup;
|
||||
```
|
|
@ -0,0 +1,19 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [CoreSetup](./kibana-plugin-server.coresetup.md)
|
||||
|
||||
## CoreSetup interface
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface CoreSetup
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [elasticsearch](./kibana-plugin-server.coresetup.elasticsearch.md) | <code>ElasticsearchServiceSetup</code> | |
|
||||
| [http](./kibana-plugin-server.coresetup.http.md) | <code>HttpServiceSetup</code> | |
|
||||
| [plugins](./kibana-plugin-server.coresetup.plugins.md) | <code>PluginsServiceSetup</code> | |
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [CoreSetup](./kibana-plugin-server.coresetup.md) > [plugins](./kibana-plugin-server.coresetup.plugins.md)
|
||||
|
||||
## CoreSetup.plugins property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
plugins: PluginsServiceSetup;
|
||||
```
|
|
@ -0,0 +1,14 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [ElasticsearchClientConfig](./kibana-plugin-server.elasticsearchclientconfig.md)
|
||||
|
||||
## ElasticsearchClientConfig type
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type ElasticsearchClientConfig = Pick<ConfigOptions, 'keepAlive' | 'log' | 'plugins'> & Pick<ElasticsearchConfig, 'apiVersion' | 'customHeaders' | 'logQueries' | 'requestHeadersWhitelist' | 'sniffOnStart' | 'sniffOnConnectionFault' | 'hosts' | 'username' | 'password'> & {
|
||||
pingTimeout?: ElasticsearchConfig['pingTimeout'] | ConfigOptions['pingTimeout'];
|
||||
requestTimeout?: ElasticsearchConfig['requestTimeout'] | ConfigOptions['requestTimeout'];
|
||||
sniffInterval?: ElasticsearchConfig['sniffInterval'] | ConfigOptions['sniffInterval'];
|
||||
ssl?: Partial<ElasticsearchConfig['ssl']>;
|
||||
};
|
||||
```
|
10
docs/development/core/server/kibana-plugin-server.headers.md
Normal file
10
docs/development/core/server/kibana-plugin-server.headers.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [Headers](./kibana-plugin-server.headers.md)
|
||||
|
||||
## Headers type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type Headers = Record<string, string | string[] | undefined>;
|
||||
```
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [Logger](./kibana-plugin-server.logger.md) > [debug](./kibana-plugin-server.logger.debug.md)
|
||||
|
||||
## Logger.debug() method
|
||||
|
||||
Log messages useful for debugging and interactive investigation
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
debug(message: string, meta?: LogMeta): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| message | <code>string</code> | The log message |
|
||||
| meta | <code>LogMeta</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [Logger](./kibana-plugin-server.logger.md) > [error](./kibana-plugin-server.logger.error.md)
|
||||
|
||||
## Logger.error() method
|
||||
|
||||
Logs abnormal or unexpected errors or messages that caused a failure in the application flow
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
error(errorOrMessage: string | Error, meta?: LogMeta): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| errorOrMessage | <code>string | Error</code> | An Error object or message string to log |
|
||||
| meta | <code>LogMeta</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [Logger](./kibana-plugin-server.logger.md) > [fatal](./kibana-plugin-server.logger.fatal.md)
|
||||
|
||||
## Logger.fatal() method
|
||||
|
||||
Logs abnormal or unexpected errors or messages that caused an unrecoverable failure
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
fatal(errorOrMessage: string | Error, meta?: LogMeta): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| errorOrMessage | <code>string | Error</code> | An Error object or message string to log |
|
||||
| meta | <code>LogMeta</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [Logger](./kibana-plugin-server.logger.md) > [info](./kibana-plugin-server.logger.info.md)
|
||||
|
||||
## Logger.info() method
|
||||
|
||||
Logs messages related to general application flow
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
info(message: string, meta?: LogMeta): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| message | <code>string</code> | The log message |
|
||||
| meta | <code>LogMeta</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
23
docs/development/core/server/kibana-plugin-server.logger.md
Normal file
23
docs/development/core/server/kibana-plugin-server.logger.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [Logger](./kibana-plugin-server.logger.md)
|
||||
|
||||
## Logger interface
|
||||
|
||||
Logger exposes all the necessary methods to log any type of information and this is the interface used by the logging consumers including plugins.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface Logger
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --- | --- |
|
||||
| [debug(message, meta)](./kibana-plugin-server.logger.debug.md) | Log messages useful for debugging and interactive investigation |
|
||||
| [error(errorOrMessage, meta)](./kibana-plugin-server.logger.error.md) | Logs abnormal or unexpected errors or messages that caused a failure in the application flow |
|
||||
| [fatal(errorOrMessage, meta)](./kibana-plugin-server.logger.fatal.md) | Logs abnormal or unexpected errors or messages that caused an unrecoverable failure |
|
||||
| [info(message, meta)](./kibana-plugin-server.logger.info.md) | Logs messages related to general application flow |
|
||||
| [trace(message, meta)](./kibana-plugin-server.logger.trace.md) | Log messages at the most detailed log level |
|
||||
| [warn(errorOrMessage, meta)](./kibana-plugin-server.logger.warn.md) | Logs abnormal or unexpected errors or messages |
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [Logger](./kibana-plugin-server.logger.md) > [trace](./kibana-plugin-server.logger.trace.md)
|
||||
|
||||
## Logger.trace() method
|
||||
|
||||
Log messages at the most detailed log level
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
trace(message: string, meta?: LogMeta): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| message | <code>string</code> | The log message |
|
||||
| meta | <code>LogMeta</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [Logger](./kibana-plugin-server.logger.md) > [warn](./kibana-plugin-server.logger.warn.md)
|
||||
|
||||
## Logger.warn() method
|
||||
|
||||
Logs abnormal or unexpected errors or messages
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
warn(errorOrMessage: string | Error, meta?: LogMeta): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| errorOrMessage | <code>string | Error</code> | An Error object or message string to log |
|
||||
| meta | <code>LogMeta</code> | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`void`
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [LoggerFactory](./kibana-plugin-server.loggerfactory.md) > [get](./kibana-plugin-server.loggerfactory.get.md)
|
||||
|
||||
## LoggerFactory.get() method
|
||||
|
||||
Returns a `Logger` instance for the specified context.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
get(...contextParts: string[]): Logger;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| contextParts | <code>string[]</code> | Parts of the context to return logger for. For example get('plugins', 'pid') will return a logger for the <code>plugins.pid</code> context. |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Logger`
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [LoggerFactory](./kibana-plugin-server.loggerfactory.md)
|
||||
|
||||
## LoggerFactory interface
|
||||
|
||||
The single purpose of `LoggerFactory` interface is to define a way to retrieve a context-based logger instance.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface LoggerFactory
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --- | --- |
|
||||
| [get(contextParts)](./kibana-plugin-server.loggerfactory.get.md) | Returns a <code>Logger</code> instance for the specified context. |
|
||||
|
11
docs/development/core/server/kibana-plugin-server.logmeta.md
Normal file
11
docs/development/core/server/kibana-plugin-server.logmeta.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [LogMeta](./kibana-plugin-server.logmeta.md)
|
||||
|
||||
## LogMeta interface
|
||||
|
||||
Contextual metadata
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface LogMeta
|
||||
```
|
32
docs/development/core/server/kibana-plugin-server.md
Normal file
32
docs/development/core/server/kibana-plugin-server.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md)
|
||||
|
||||
## kibana-plugin-server package
|
||||
|
||||
## Classes
|
||||
|
||||
| Class | Description |
|
||||
| --- | --- |
|
||||
| [ClusterClient](./kibana-plugin-server.clusterclient.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 <code>asScoped(...)</code>). |
|
||||
| [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md) | Serves the same purpose as "normal" <code>ClusterClient</code> but exposes additional <code>callAsCurrentUser</code> method that doesn't use credentials of the Kibana internal user (as <code>callAsInternalUser</code> does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API |
|
||||
|
||||
## Interfaces
|
||||
|
||||
| Interface | Description |
|
||||
| --- | --- |
|
||||
| [CallAPIOptions](./kibana-plugin-server.callapioptions.md) | The set of options that defines how API call should be made and result be processed. |
|
||||
| [CoreSetup](./kibana-plugin-server.coresetup.md) | |
|
||||
| [Logger](./kibana-plugin-server.logger.md) | Logger exposes all the necessary methods to log any type of information and this is the interface used by the logging consumers including plugins. |
|
||||
| [LoggerFactory](./kibana-plugin-server.loggerfactory.md) | The single purpose of <code>LoggerFactory</code> interface is to define a way to retrieve a context-based logger instance. |
|
||||
| [LogMeta](./kibana-plugin-server.logmeta.md) | Contextual metadata |
|
||||
| [PluginInitializerContext](./kibana-plugin-server.plugininitializercontext.md) | Context that's available to plugins during initialization stage. |
|
||||
| [PluginSetupContext](./kibana-plugin-server.pluginsetupcontext.md) | Context passed to the plugins <code>setup</code> method. |
|
||||
|
||||
## Type Aliases
|
||||
|
||||
| Type Alias | Description |
|
||||
| --- | --- |
|
||||
| [APICaller](./kibana-plugin-server.apicaller.md) | |
|
||||
| [ElasticsearchClientConfig](./kibana-plugin-server.elasticsearchclientconfig.md) | |
|
||||
| [Headers](./kibana-plugin-server.headers.md) | |
|
||||
| [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. |
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [PluginInitializerContext](./kibana-plugin-server.plugininitializercontext.md) > [config](./kibana-plugin-server.plugininitializercontext.config.md)
|
||||
|
||||
## PluginInitializerContext.config property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
config: {
|
||||
create: <Schema extends Type<any>, Config>(ConfigClass: ConfigWithSchema<Schema, Config>) => Observable<Config>;
|
||||
createIfExists: <Schema extends Type<any>, Config>(ConfigClass: ConfigWithSchema<Schema, Config>) => Observable<Config | undefined>;
|
||||
};
|
||||
```
|
|
@ -0,0 +1,11 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [PluginInitializerContext](./kibana-plugin-server.plugininitializercontext.md) > [env](./kibana-plugin-server.plugininitializercontext.env.md)
|
||||
|
||||
## PluginInitializerContext.env property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
env: {
|
||||
mode: EnvironmentMode;
|
||||
};
|
||||
```
|
|
@ -0,0 +1,9 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [PluginInitializerContext](./kibana-plugin-server.plugininitializercontext.md) > [logger](./kibana-plugin-server.plugininitializercontext.logger.md)
|
||||
|
||||
## PluginInitializerContext.logger property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
logger: LoggerFactory;
|
||||
```
|
|
@ -0,0 +1,20 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [PluginInitializerContext](./kibana-plugin-server.plugininitializercontext.md)
|
||||
|
||||
## PluginInitializerContext interface
|
||||
|
||||
Context that's available to plugins during initialization stage.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface PluginInitializerContext
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [config](./kibana-plugin-server.plugininitializercontext.config.md) | <code>{`<p/>` create: <Schema extends Type<any>, Config>(ConfigClass: ConfigWithSchema<Schema, Config>) => Observable<Config>;`<p/>` createIfExists: <Schema extends Type<any>, Config>(ConfigClass: ConfigWithSchema<Schema, Config>) => Observable<Config | undefined>;`<p/>` }</code> | |
|
||||
| [env](./kibana-plugin-server.plugininitializercontext.env.md) | <code>{`<p/>` mode: EnvironmentMode;`<p/>` }</code> | |
|
||||
| [logger](./kibana-plugin-server.plugininitializercontext.logger.md) | <code>LoggerFactory</code> | |
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [PluginName](./kibana-plugin-server.pluginname.md)
|
||||
|
||||
## PluginName type
|
||||
|
||||
Dedicated type for plugin name/id that is supposed to make Map/Set/Arrays that use it as a key or value more obvious.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type PluginName = string;
|
||||
```
|
|
@ -0,0 +1,12 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [PluginSetupContext](./kibana-plugin-server.pluginsetupcontext.md) > [elasticsearch](./kibana-plugin-server.pluginsetupcontext.elasticsearch.md)
|
||||
|
||||
## PluginSetupContext.elasticsearch property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
elasticsearch: {
|
||||
adminClient$: Observable<ClusterClient>;
|
||||
dataClient$: Observable<ClusterClient>;
|
||||
};
|
||||
```
|
|
@ -0,0 +1,18 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [PluginSetupContext](./kibana-plugin-server.pluginsetupcontext.md)
|
||||
|
||||
## PluginSetupContext interface
|
||||
|
||||
Context passed to the plugins `setup` method.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface PluginSetupContext
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [elasticsearch](./kibana-plugin-server.pluginsetupcontext.elasticsearch.md) | <code>{`<p/>` adminClient$: Observable<ClusterClient>;`<p/>` dataClient$: Observable<ClusterClient>;`<p/>` }</code> | |
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md) > [callAsCurrentUser](./kibana-plugin-server.scopedclusterclient.callascurrentuser.md)
|
||||
|
||||
## ScopedClusterClient.callAsCurrentUser() method
|
||||
|
||||
Calls specified `endpoint` with provided `clientParams` on behalf of the user initiated request to the Kibana server (via HTTP request headers).
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
callAsCurrentUser(endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions): Promise<unknown>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| endpoint | <code>string</code> | String descriptor of the endpoint e.g. <code>cluster.getSettings</code> or <code>ping</code>. |
|
||||
| clientParams | <code>Record<string, unknown></code> | A dictionary of parameters that will be passed directly to the Elasticsearch JS client. |
|
||||
| options | <code>CallAPIOptions</code> | Options that affect the way we call the API and process the result. |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<unknown>`
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md) > [callAsInternalUser](./kibana-plugin-server.scopedclusterclient.callasinternaluser.md)
|
||||
|
||||
## ScopedClusterClient.callAsInternalUser() method
|
||||
|
||||
Calls specified `endpoint` with provided `clientParams` on behalf of the Kibana internal user.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
callAsInternalUser(endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions): Promise<unknown>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| endpoint | <code>string</code> | String descriptor of the endpoint e.g. <code>cluster.getSettings</code> or <code>ping</code>. |
|
||||
| clientParams | <code>Record<string, unknown></code> | A dictionary of parameters that will be passed directly to the Elasticsearch JS client. |
|
||||
| options | <code>CallAPIOptions</code> | Options that affect the way we call the API and process the result. |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
`Promise<unknown>`
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
[Home](./index) > [kibana-plugin-server](./kibana-plugin-server.md) > [ScopedClusterClient](./kibana-plugin-server.scopedclusterclient.md)
|
||||
|
||||
## ScopedClusterClient class
|
||||
|
||||
Serves the same purpose as "normal" `ClusterClient` but exposes additional `callAsCurrentUser` method that doesn't use credentials of the Kibana internal user (as `callAsInternalUser` does) to request Elasticsearch API, but rather passes HTTP headers extracted from the current user request to the API
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare class ScopedClusterClient
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Modifiers | Description |
|
||||
| --- | --- | --- |
|
||||
| [callAsCurrentUser(endpoint, clientParams, options)](./kibana-plugin-server.scopedclusterclient.callascurrentuser.md) | | Calls specified <code>endpoint</code> with provided <code>clientParams</code> 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 <code>endpoint</code> with provided <code>clientParams</code> on behalf of the Kibana internal user. |
|
||||
|
5
kibana.d.ts
vendored
5
kibana.d.ts
vendored
|
@ -20,7 +20,10 @@
|
|||
/**
|
||||
* All exports from TS source files (where the implementation is actually done in TS).
|
||||
*/
|
||||
export { Public, Server } from 'src/core';
|
||||
import * as Public from 'target/types/public';
|
||||
import * as Server from 'target/types/server';
|
||||
|
||||
export { Public, Server };
|
||||
|
||||
/**
|
||||
* All exports from TS ambient definitions (where types are added for JS source in a .d.ts file).
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"version": "7.1.0",
|
||||
"branch": "7.x",
|
||||
"types": "./kibana.d.ts",
|
||||
"tsdocMetadata": "./build/tsdoc-metadata.json",
|
||||
"build": {
|
||||
"number": 8467,
|
||||
"sha": "6cb7fec4e154faa0a4a3fee4b33dfef91b9870d9"
|
||||
|
@ -67,7 +68,8 @@
|
|||
"uiFramework:createComponent": "cd packages/kbn-ui-framework && yarn createComponent",
|
||||
"uiFramework:documentComponent": "cd packages/kbn-ui-framework && yarn documentComponent",
|
||||
"kbn:watch": "node scripts/kibana --dev --logging.json=false",
|
||||
"kbn:bootstrap": "node scripts/register_git_hook"
|
||||
"build:types": "tsc --p tsconfig.types.json",
|
||||
"kbn:bootstrap": "yarn build:types && node scripts/register_git_hook"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -258,6 +260,8 @@
|
|||
"@kbn/expect": "1.0.0",
|
||||
"@kbn/plugin-generator": "1.0.0",
|
||||
"@kbn/test": "1.0.0",
|
||||
"@microsoft/api-documenter": "7.0.41",
|
||||
"@microsoft/api-extractor": "7.0.31",
|
||||
"@octokit/rest": "^15.10.0",
|
||||
"@types/angular": "1.6.50",
|
||||
"@types/angular-mocks": "^1.7.0",
|
||||
|
|
21
scripts/check_core_api_changes.js
Normal file
21
scripts/check_core_api_changes.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
require('../src/setup_node_env');
|
||||
require('../src/dev/run_check_core_api_changes');
|
|
@ -16,7 +16,6 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import * as Public from './public';
|
||||
import * as Server from './server';
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ interface Deps {
|
|||
injectedMetadata: InjectedMetadataSetup;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export class BasePathService {
|
||||
public setup({ injectedMetadata }: Deps) {
|
||||
const basePath = injectedMetadata.getBasePath() || '';
|
||||
|
@ -71,4 +72,5 @@ export class BasePathService {
|
|||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type BasePathSetup = ReturnType<BasePathService['setup']>;
|
||||
|
|
|
@ -32,17 +32,20 @@ function isEmbedParamInHash() {
|
|||
return Boolean(query.embed);
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export interface ChromeBrand {
|
||||
logo?: string;
|
||||
smallLogo?: string;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export interface ChromeBreadcrumb {
|
||||
text: string;
|
||||
href?: string;
|
||||
'data-test-subj'?: string;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type ChromeHelpExtension = (element: HTMLDivElement) => (() => void);
|
||||
|
||||
interface ConstructorParams {
|
||||
|
@ -54,6 +57,7 @@ interface SetupDeps {
|
|||
notifications: NotificationsSetup;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export class ChromeService {
|
||||
private readonly stop$ = new Rx.ReplaySubject(1);
|
||||
private readonly browserSupportsCsp: boolean;
|
||||
|
@ -202,4 +206,5 @@ export class ChromeService {
|
|||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type ChromeSetup = ReturnType<ChromeService['setup']>;
|
||||
|
|
|
@ -37,6 +37,7 @@ interface Deps {
|
|||
i18n: I18nSetup;
|
||||
}
|
||||
|
||||
/** @interal */
|
||||
export class FatalErrorsService {
|
||||
private readonly errorInfo$ = new Rx.ReplaySubject<ErrorInfo>();
|
||||
private i18n?: I18nSetup;
|
||||
|
@ -109,4 +110,5 @@ export class FatalErrorsService {
|
|||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type FatalErrorsSetup = ReturnType<FatalErrorsService['setup']>;
|
||||
|
|
|
@ -34,6 +34,7 @@ interface Deps {
|
|||
fatalErrors: FatalErrorsSetup;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export class HttpService {
|
||||
private readonly loadingCount$ = new Rx.BehaviorSubject(0);
|
||||
private readonly stop$ = new Rx.Subject();
|
||||
|
@ -83,4 +84,5 @@ export class HttpService {
|
|||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type HttpSetup = ReturnType<HttpService['setup']>;
|
||||
|
|
|
@ -25,6 +25,7 @@ import { I18nProvider } from '@kbn/i18n/react';
|
|||
|
||||
/**
|
||||
* Service that is responsible for i18n capabilities.
|
||||
* @internal
|
||||
*/
|
||||
export class I18nService {
|
||||
public setup() {
|
||||
|
@ -54,4 +55,5 @@ export class I18nService {
|
|||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type I18nSetup = ReturnType<I18nService['setup']>;
|
||||
|
|
|
@ -26,8 +26,14 @@ import { InjectedMetadataParams, InjectedMetadataSetup } from './injected_metada
|
|||
import { NotificationsSetup, Toast, ToastInput, ToastsSetup } from './notifications';
|
||||
import { UiSettingsClient, UiSettingsSetup, UiSettingsState } from './ui_settings';
|
||||
|
||||
/** @interal */
|
||||
export { CoreSystem } from './core_system';
|
||||
|
||||
/**
|
||||
* Core services exposed to the start lifecycle
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface CoreSetup {
|
||||
i18n: I18nSetup;
|
||||
injectedMetadata: InjectedMetadataSetup;
|
||||
|
|
|
@ -22,6 +22,7 @@ import { DiscoveredPlugin, PluginName } from '../../server';
|
|||
import { UiSettingsState } from '../ui_settings';
|
||||
import { deepFreeze } from './deep_freeze';
|
||||
|
||||
/** @internal */
|
||||
export interface InjectedMetadataParams {
|
||||
injectedMetadata: {
|
||||
version: string;
|
||||
|
@ -62,6 +63,8 @@ export interface InjectedMetadataParams {
|
|||
* server into the page. The metadata is actually defined
|
||||
* in the entry file for the bundle containing the new platform
|
||||
* and is read from the DOM in most cases.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export class InjectedMetadataService {
|
||||
private state = deepFreeze(
|
||||
|
@ -111,4 +114,5 @@ export class InjectedMetadataService {
|
|||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type InjectedMetadataSetup = ReturnType<InjectedMetadataService['setup']>;
|
||||
|
|
220
src/core/public/kibana.api.md
Normal file
220
src/core/public/kibana.api.md
Normal file
|
@ -0,0 +1,220 @@
|
|||
## API Review File for "kibana"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
|
||||
import { default } from 'react';
|
||||
import * as Rx from 'rxjs';
|
||||
import { Toast } from '@elastic/eui';
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "BasePathService" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type BasePathSetup = ReturnType<BasePathService['setup']>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ChromeBrand {
|
||||
// (undocumented)
|
||||
logo?: string;
|
||||
// (undocumented)
|
||||
smallLogo?: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ChromeBreadcrumb {
|
||||
// (undocumented)
|
||||
'data-test-subj'?: string;
|
||||
// (undocumented)
|
||||
href?: string;
|
||||
// (undocumented)
|
||||
text: string;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export type ChromeHelpExtension = (element: HTMLDivElement) => (() => void);
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "ChromeService" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type ChromeSetup = ReturnType<ChromeService['setup']>;
|
||||
|
||||
// @public
|
||||
export interface CoreSetup {
|
||||
// (undocumented)
|
||||
basePath: BasePathSetup;
|
||||
// (undocumented)
|
||||
chrome: ChromeSetup;
|
||||
// (undocumented)
|
||||
fatalErrors: FatalErrorsSetup;
|
||||
// (undocumented)
|
||||
http: HttpSetup;
|
||||
// (undocumented)
|
||||
i18n: I18nSetup;
|
||||
// (undocumented)
|
||||
injectedMetadata: InjectedMetadataSetup;
|
||||
// (undocumented)
|
||||
notifications: NotificationsSetup;
|
||||
// (undocumented)
|
||||
uiSettings: UiSettingsSetup;
|
||||
}
|
||||
|
||||
// Warning: (ae-internal-missing-underscore) The name CoreSystem should be prefixed with an underscore because the declaration is marked as "@internal"
|
||||
//
|
||||
// @internal
|
||||
export class CoreSystem {
|
||||
// Warning: (ae-forgotten-export) The symbol "Params" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
constructor(params: Params);
|
||||
// (undocumented)
|
||||
setup(): {
|
||||
fatalErrors: {
|
||||
add: (error: string | Error, source?: string | undefined) => never;
|
||||
get$: () => import("rxjs").Observable<{
|
||||
message: string;
|
||||
stack: string | undefined;
|
||||
}>;
|
||||
};
|
||||
} | undefined;
|
||||
// (undocumented)
|
||||
stop(): void;
|
||||
}
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "FatalErrorsService" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type FatalErrorsSetup = ReturnType<FatalErrorsService['setup']>;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "HttpService" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type HttpSetup = ReturnType<HttpService['setup']>;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "I18nService" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type I18nSetup = ReturnType<I18nService['setup']>;
|
||||
|
||||
// Warning: (ae-internal-missing-underscore) The name InjectedMetadataParams should be prefixed with an underscore because the declaration is marked as "@internal"
|
||||
//
|
||||
// @internal (undocumented)
|
||||
export interface InjectedMetadataParams {
|
||||
// (undocumented)
|
||||
injectedMetadata: {
|
||||
version: string;
|
||||
buildNumber: number;
|
||||
basePath: string;
|
||||
csp: {
|
||||
warnLegacyBrowsers: boolean;
|
||||
};
|
||||
vars: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
uiPlugins: Array<{
|
||||
id: PluginName;
|
||||
plugin: DiscoveredPlugin;
|
||||
}>;
|
||||
legacyMetadata: {
|
||||
app: unknown;
|
||||
translations: unknown;
|
||||
bundleId: string;
|
||||
nav: unknown;
|
||||
version: string;
|
||||
branch: string;
|
||||
buildNum: number;
|
||||
buildSha: string;
|
||||
basePath: string;
|
||||
serverName: string;
|
||||
devMode: boolean;
|
||||
uiSettings: {
|
||||
defaults: UiSettingsState;
|
||||
user?: UiSettingsState;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "InjectedMetadataService" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type InjectedMetadataSetup = ReturnType<InjectedMetadataService['setup']>;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "NotificationsService" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// @public (undocumented)
|
||||
export type NotificationsSetup = ReturnType<NotificationsService['setup']>;
|
||||
|
||||
export { Toast }
|
||||
|
||||
// @public (undocumented)
|
||||
export type ToastInput = string | Pick<Toast, Exclude<keyof Toast, 'id'>>;
|
||||
|
||||
// @public (undocumented)
|
||||
export class ToastsSetup {
|
||||
// (undocumented)
|
||||
add(toastOrTitle: ToastInput): Toast;
|
||||
// (undocumented)
|
||||
addDanger(toastOrTitle: ToastInput): Toast;
|
||||
// (undocumented)
|
||||
addSuccess(toastOrTitle: ToastInput): Toast;
|
||||
// (undocumented)
|
||||
addWarning(toastOrTitle: ToastInput): Toast;
|
||||
// (undocumented)
|
||||
get$(): Rx.Observable<Toast[]>;
|
||||
// (undocumented)
|
||||
remove(toast: Toast): void;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export class UiSettingsClient {
|
||||
// (undocumented)
|
||||
constructor(params: UiSettingsClientParams);
|
||||
get$(key: string, defaultOverride?: any): Rx.Observable<any>;
|
||||
get(key: string, defaultOverride?: any): any;
|
||||
getAll(): UiSettingsState;
|
||||
getSaved$(): Rx.Observable<{
|
||||
key: string;
|
||||
newValue: any;
|
||||
oldValue: any;
|
||||
}>;
|
||||
getUpdate$(): Rx.Observable<{
|
||||
key: string;
|
||||
newValue: any;
|
||||
oldValue: any;
|
||||
}>;
|
||||
isCustom(key: string): boolean;
|
||||
isDeclared(key: string): boolean;
|
||||
isDefault(key: string): boolean;
|
||||
isOverridden(key: string): boolean;
|
||||
overrideLocalDefault(key: string, newDefault: any): void;
|
||||
// Warning: (ae-forgotten-export) The symbol "UiSettingsClientParams" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
readonly params: UiSettingsClientParams;
|
||||
remove(key: string): Promise<boolean>;
|
||||
set(key: string, val: any): Promise<boolean>;
|
||||
stop(): void;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export type UiSettingsSetup = UiSettingsClient;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface UiSettingsState {
|
||||
// Warning: (ae-forgotten-export) The symbol "InjectedUiSettingsDefault" needs to be exported by the entry point index.d.ts
|
||||
// Warning: (ae-forgotten-export) The symbol "InjectedUiSettingsUser" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
[key: string]: InjectedUiSettingsDefault & InjectedUiSettingsUser;
|
||||
}
|
||||
|
||||
|
||||
// Warnings were encountered during analysis:
|
||||
//
|
||||
// src/core/public/injected_metadata/injected_metadata_service.ts:38:9 - (ae-forgotten-export) The symbol "PluginName" needs to be exported by the entry point index.d.ts
|
||||
// src/core/public/injected_metadata/injected_metadata_service.ts:39:9 - (ae-forgotten-export) The symbol "DiscoveredPlugin" needs to be exported by the entry point index.d.ts
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
|
||||
```
|
|
@ -20,27 +20,28 @@
|
|||
import { I18nSetup } from '../i18n';
|
||||
import { ToastsService } from './toasts';
|
||||
|
||||
interface Params {
|
||||
interface NotificationServiceParams {
|
||||
targetDomElement: HTMLElement;
|
||||
}
|
||||
|
||||
interface Deps {
|
||||
interface NotificationsServiceDeps {
|
||||
i18n: I18nSetup;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export class NotificationsService {
|
||||
private readonly toasts: ToastsService;
|
||||
|
||||
private readonly toastsContainer: HTMLElement;
|
||||
|
||||
constructor(private readonly params: Params) {
|
||||
constructor(private readonly params: NotificationServiceParams) {
|
||||
this.toastsContainer = document.createElement('div');
|
||||
this.toasts = new ToastsService({
|
||||
targetDomElement: this.toastsContainer,
|
||||
});
|
||||
}
|
||||
|
||||
public setup({ i18n }: Deps) {
|
||||
public setup({ i18n }: NotificationsServiceDeps) {
|
||||
this.params.targetDomElement.appendChild(this.toastsContainer);
|
||||
|
||||
return {
|
||||
|
@ -55,4 +56,5 @@ export class NotificationsService {
|
|||
}
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type NotificationsSetup = ReturnType<NotificationsService['setup']>;
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
import { Toast } from '@elastic/eui';
|
||||
import * as Rx from 'rxjs';
|
||||
|
||||
/** @public */
|
||||
export type ToastInput = string | Pick<Toast, Exclude<keyof Toast, 'id'>>;
|
||||
|
||||
const normalizeToast = (toastOrTitle: ToastInput) => {
|
||||
|
@ -32,6 +33,7 @@ const normalizeToast = (toastOrTitle: ToastInput) => {
|
|||
return toastOrTitle;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export class ToastsSetup {
|
||||
private toasts$ = new Rx.BehaviorSubject<Toast[]>([]);
|
||||
private idCounter = 0;
|
||||
|
|
|
@ -34,6 +34,7 @@ interface InjectedUiSettingsUser {
|
|||
isOverridden?: boolean;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export interface UiSettingsState {
|
||||
[key: string]: InjectedUiSettingsDefault & InjectedUiSettingsUser;
|
||||
}
|
||||
|
|
|
@ -24,13 +24,15 @@ import { filter, map } from 'rxjs/operators';
|
|||
import { UiSettingsState } from './types';
|
||||
import { UiSettingsApi } from './ui_settings_api';
|
||||
|
||||
interface Params {
|
||||
/** @public */
|
||||
interface UiSettingsClientParams {
|
||||
api: UiSettingsApi;
|
||||
onUpdateError: UiSettingsClient['onUpdateError'];
|
||||
defaults: UiSettingsState;
|
||||
initialSettings?: UiSettingsState;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export class UiSettingsClient {
|
||||
private readonly update$ = new Rx.Subject<{ key: string; newValue: any; oldValue: any }>();
|
||||
private readonly saved$ = new Rx.Subject<{ key: string; newValue: any; oldValue: any }>();
|
||||
|
@ -40,7 +42,7 @@ export class UiSettingsClient {
|
|||
private readonly defaults: UiSettingsState;
|
||||
private cache: UiSettingsState;
|
||||
|
||||
constructor(readonly params: Params) {
|
||||
constructor(readonly params: UiSettingsClientParams) {
|
||||
this.api = params.api;
|
||||
this.onUpdateError = params.onUpdateError;
|
||||
this.defaults = cloneDeep(params.defaults);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue