Skip to content

Commit

Permalink
regen docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Oct 28, 2019
1 parent da536b9 commit 48d632c
Show file tree
Hide file tree
Showing 30 changed files with 147 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## IAnonymousPaths.isAnonymous() method

Determines whether the provided path doesn't require authentication
Determines whether the provided path doesn't require authentication. `path` should include the current basePath.

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export interface IAnonymousPaths

| Method | Description |
| --- | --- |
| [isAnonymous(path)](./kibana-plugin-public.ianonymouspaths.isanonymous.md) | Determines whether the provided path doesn't require authentication |
| [register(path)](./kibana-plugin-public.ianonymouspaths.register.md) | Register <code>path</code> as not requiring authentication |
| [isAnonymous(path)](./kibana-plugin-public.ianonymouspaths.isanonymous.md) | Determines whether the provided path doesn't require authentication. <code>path</code> should include the current basePath. |
| [register(path)](./kibana-plugin-public.ianonymouspaths.register.md) | Register <code>path</code> as not requiring authentication. <code>path</code> should not include the current basePath. |

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## IAnonymousPaths.register() method

Register `path` as not requiring authentication
Register `path` as not requiring authentication. `path` should not include the current basePath.

<b>Signature:</b>

Expand Down
2 changes: 1 addition & 1 deletion docs/development/core/public/kibana-plugin-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,5 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [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) |
| [UiSettingsClientContract](./kibana-plugin-public.uisettingsclientcontract.md) | Client-side client that provides access to the advanced settings stored in elasticsearch. The settings provide control over the behavior of the Kibana application. For example, a user can specify how to display numeric or date fields. Users can adjust the settings via Management UI. [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) |

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Gets the metadata about all uiSettings, including the type, default value, and u
<b>Signature:</b>

```typescript
getAll(): UiSettingsState;
getAll(): Record<string, UiSettingsParams & UserProvidedValues<any>>;
```
<b>Returns:</b>

`UiSettingsState`
`Record<string, UiSettingsParams & UserProvidedValues<any>>`

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## UiSettingsClientContract type

[UiSettingsClient](./kibana-plugin-public.uisettingsclient.md)
Client-side client that provides access to the advanced settings stored in elasticsearch. The settings provide control over the behavior of the Kibana application. For example, a user can specify how to display numeric or date fields. Users can adjust the settings via Management UI. [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md)

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ Retrieves a set of all uiSettings values set by the user.
<b>Signature:</b>

```typescript
getUserProvided: <T extends SavedObjectAttribute = any>() => Promise<Record<string, {
userValue?: T;
isOverridden?: boolean;
}>>;
getUserProvided: <T extends SavedObjectAttribute = any>() => Promise<Record<string, UserProvidedValues<T>>>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## IUiSettingsClient interface

Client that provides access to the UiSettings stored in elasticsearch.
Server-side client that provides access to the advanced settings stored in elasticsearch. The settings provide control over the behavior of the Kibana application. For example, a user can specify how to display numeric or date fields. Users can adjust the settings via Management UI.

<b>Signature:</b>

Expand All @@ -19,7 +19,7 @@ export interface IUiSettingsClient
| [get](./kibana-plugin-server.iuisettingsclient.get.md) | <code>&lt;T extends SavedObjectAttribute = any&gt;(key: string) =&gt; Promise&lt;T&gt;</code> | Retrieves uiSettings values set by the user with fallbacks to default values if not specified. |
| [getAll](./kibana-plugin-server.iuisettingsclient.getall.md) | <code>&lt;T extends SavedObjectAttribute = any&gt;() =&gt; Promise&lt;Record&lt;string, T&gt;&gt;</code> | Retrieves a set of all uiSettings values set by the user with fallbacks to default values if not specified. |
| [getRegistered](./kibana-plugin-server.iuisettingsclient.getregistered.md) | <code>() =&gt; Readonly&lt;Record&lt;string, UiSettingsParams&gt;&gt;</code> | Returns registered uiSettings values [UiSettingsParams](./kibana-plugin-server.uisettingsparams.md) |
| [getUserProvided](./kibana-plugin-server.iuisettingsclient.getuserprovided.md) | <code>&lt;T extends SavedObjectAttribute = any&gt;() =&gt; Promise&lt;Record&lt;string, {</code><br/><code> userValue?: T;</code><br/><code> isOverridden?: boolean;</code><br/><code> }&gt;&gt;</code> | Retrieves a set of all uiSettings values set by the user. |
| [getUserProvided](./kibana-plugin-server.iuisettingsclient.getuserprovided.md) | <code>&lt;T extends SavedObjectAttribute = any&gt;() =&gt; Promise&lt;Record&lt;string, UserProvidedValues&lt;T&gt;&gt;&gt;</code> | Retrieves a set of all uiSettings values set by the user. |
| [isOverridden](./kibana-plugin-server.iuisettingsclient.isoverridden.md) | <code>(key: string) =&gt; boolean</code> | Shows whether the uiSettings value set by the user. |
| [remove](./kibana-plugin-server.iuisettingsclient.remove.md) | <code>(key: string) =&gt; Promise&lt;void&gt;</code> | Removes uiSettings value by key. |
| [removeMany](./kibana-plugin-server.iuisettingsclient.removemany.md) | <code>(keys: string[]) =&gt; Promise&lt;void&gt;</code> | Removes multiple uiSettings values by keys. |
Expand Down
3 changes: 2 additions & 1 deletion docs/development/core/server/kibana-plugin-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [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. See [RouteConfig](./kibana-plugin-server.routeconfig.md) and [RequestHandler](./kibana-plugin-server.requesthandler.md) for more information about arguments to route registrations. |
| [IUiSettingsClient](./kibana-plugin-server.iuisettingsclient.md) | Client that provides access to the UiSettings stored in elasticsearch. |
| [IUiSettingsClient](./kibana-plugin-server.iuisettingsclient.md) | Server-side client that provides access to the advanced settings stored in elasticsearch. The settings provide control over the behavior of the Kibana application. For example, a user can specify how to display numeric or date fields. Users can adjust the settings via Management UI. |
| [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) | |
Expand Down Expand Up @@ -119,6 +119,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SessionStorageFactory](./kibana-plugin-server.sessionstoragefactory.md) | SessionStorage factory to bind one to an incoming request |
| [UiSettingsParams](./kibana-plugin-server.uisettingsparams.md) | UiSettings parameters defined by the plugins. |
| [UiSettingsServiceSetup](./kibana-plugin-server.uisettingsservicesetup.md) | |
| [UserProvidedValues](./kibana-plugin-server.userprovidedvalues.md) | Describes the values explicitly set by user. |

## Variables

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ used to group the configured setting in the UI
<b>Signature:</b>

```typescript
category: string[];
category?: string[];
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ description provided to a user in UI
<b>Signature:</b>

```typescript
description: string;
description?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface UiSettingsParams
| [description](./kibana-plugin-server.uisettingsparams.description.md) | <code>string</code> | description provided to a user in UI |
| [name](./kibana-plugin-server.uisettingsparams.name.md) | <code>string</code> | title in the UI |
| [optionLabels](./kibana-plugin-server.uisettingsparams.optionlabels.md) | <code>Record&lt;string, string&gt;</code> | text labels for 'select' type UI element |
| [options](./kibana-plugin-server.uisettingsparams.options.md) | <code>string[]</code> | a range of valid values |
| [options](./kibana-plugin-server.uisettingsparams.options.md) | <code>string[]</code> | array of permitted values for this setting |
| [readonly](./kibana-plugin-server.uisettingsparams.readonly.md) | <code>boolean</code> | a flag indicating that value cannot be changed |
| [requiresPageReload](./kibana-plugin-server.uisettingsparams.requirespagereload.md) | <code>boolean</code> | a flag indicating whether new value applying requires page reloading |
| [type](./kibana-plugin-server.uisettingsparams.type.md) | <code>UiSettingsType</code> | defines a type of UI element [UiSettingsType](./kibana-plugin-server.uisettingstype.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ title in the UI
<b>Signature:</b>

```typescript
name: string;
name?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## UiSettingsParams.options property

a range of valid values
array of permitted values for this setting

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ default value to fall back to if a user doesn't provide any
<b>Signature:</b>

```typescript
value: SavedObjectAttribute;
value?: SavedObjectAttribute;
```
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ register(settings: Record<string, UiSettingsParams>): void;

`void`

## Example

setup(core: CoreSetup)<!-- -->{ core.uiSettings.register(\[{ foo: { name: i18n.translate('my foo settings'), value: true, description: 'add some awesomeness', }<!-- -->, }<!-- -->\]); }

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [UserProvidedValues](./kibana-plugin-server.userprovidedvalues.md) &gt; [isOverridden](./kibana-plugin-server.userprovidedvalues.isoverridden.md)

## UserProvidedValues.isOverridden property

<b>Signature:</b>

```typescript
isOverridden?: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [UserProvidedValues](./kibana-plugin-server.userprovidedvalues.md)

## UserProvidedValues interface

Describes the values explicitly set by user.

<b>Signature:</b>

```typescript
export interface UserProvidedValues<T extends SavedObjectAttribute = any>
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [isOverridden](./kibana-plugin-server.userprovidedvalues.isoverridden.md) | <code>boolean</code> | |
| [userValue](./kibana-plugin-server.userprovidedvalues.uservalue.md) | <code>T</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [UserProvidedValues](./kibana-plugin-server.userprovidedvalues.md) &gt; [userValue](./kibana-plugin-server.userprovidedvalues.uservalue.md)

## UserProvidedValues.userValue property

<b>Signature:</b>

```typescript
userValue?: T;
```
2 changes: 1 addition & 1 deletion src/core/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ This table shows where these uiExports have moved to in the New Platform. In mos
| `styleSheetPaths` | | |
| `taskDefinitions` | | Should be an API on the taskManager plugin. |
| `uiCapabilities` | [`core.application.register`](/docs/development/core/public/kibana-plugin-public.applicationsetup.register.md) | |
| `uiSettingDefaults` | | Most likely part of server-side UiSettingsService. |
| `uiSettingDefaults` | [`core.uiSettings.register`](docs/development/core/server/kibana-plugin-server.uisettingsservicesetup.md) | |
| `validations` | | Part of SavedObjects, see [#33587](https://github.com/elastic/kibana/issues/33587) |
| `visEditorTypes` | | |
| `visTypeEnhancers` | | |
Expand Down
16 changes: 10 additions & 6 deletions src/core/public/injected_metadata/injected_metadata_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@

import { get } from 'lodash';
import { DiscoveredPlugin, PluginName } from '../../server';
import { EnvironmentMode, PackageInfo } from '../../server/types';
import { UiSettingsState } from '../ui_settings';
import {
EnvironmentMode,
PackageInfo,
UiSettingsParams,
UserProvidedValues,
} from '../../server/types';
import { deepFreeze } from '../../utils/';
import { Capabilities } from '..';

Expand Down Expand Up @@ -69,8 +73,8 @@ export interface InjectedMetadataParams {
serverName: string;
devMode: boolean;
uiSettings: {
defaults: UiSettingsState;
user?: UiSettingsState;
defaults: Record<string, UiSettingsParams>;
user?: Record<string, UserProvidedValues>;
};
};
};
Expand Down Expand Up @@ -179,8 +183,8 @@ export interface InjectedMetadataSetup {
serverName: string;
devMode: boolean;
uiSettings: {
defaults: UiSettingsState;
user?: UiSettingsState | undefined;
defaults: Record<string, UiSettingsParams>;
user?: Record<string, UserProvidedValues> | undefined;
};
};
getInjectedVar: (name: string, defaultValue?: any) => unknown;
Expand Down
11 changes: 5 additions & 6 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import React from 'react';
import * as Rx from 'rxjs';
import { ShallowPromise } from '@kbn/utility-types';
import { EuiGlobalToastListToast as Toast } from '@elastic/eui';
import { UiSettingsParams as UiSettingsParams_2 } from 'src/core/server/types';
import { UserProvidedValues as UserProvidedValues_2 } from 'src/core/server/types';

// @public
export interface App extends AppBase {
Expand Down Expand Up @@ -957,7 +959,7 @@ export class UiSettingsClient {
constructor(params: UiSettingsClientParams);
get$(key: string, defaultOverride?: any): Rx.Observable<any>;
get(key: string, defaultOverride?: any): any;
getAll(): UiSettingsState;
getAll(): Record<string, UiSettingsParams_2 & UserProvidedValues_2<any>>;
getSaved$(): Rx.Observable<{
key: string;
newValue: any;
Expand All @@ -979,16 +981,13 @@ export class UiSettingsClient {
stop(): void;
}

// @public (undocumented)
// @public
export type UiSettingsClientContract = PublicMethodsOf<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;
[key: string]: UiSettingsParams_2 & UserProvidedValues_2;
}


Expand Down
23 changes: 2 additions & 21 deletions src/core/public/ui_settings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,9 @@
* under the License.
*/

// properties that come from legacyInjectedMetadata.uiSettings.defaults
interface InjectedUiSettingsDefault {
name?: string;
value?: any;
description?: string;
category?: string[];
type?: string;
readOnly?: boolean;
options?: string[] | { [key: string]: any };
/**
* Whether a change in that setting will only take affect after a page reload.
*/
requiresPageReload?: boolean;
}

// properties that come from legacyInjectedMetadata.uiSettings.user
interface InjectedUiSettingsUser {
userValue?: any;
isOverridden?: boolean;
}
import { UiSettingsParams, UserProvidedValues } from 'src/core/server/types';

/** @public */
export interface UiSettingsState {
[key: string]: InjectedUiSettingsDefault & InjectedUiSettingsUser;
[key: string]: UiSettingsParams & UserProvidedValues;
}
13 changes: 10 additions & 3 deletions src/core/public/ui_settings/ui_settings_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,25 @@ import { cloneDeep, defaultsDeep } from 'lodash';
import * as Rx from 'rxjs';
import { filter, map } from 'rxjs/operators';

import { UiSettingsParams, UserProvidedValues } from 'src/core/server/types';
import { UiSettingsState } from './types';

import { UiSettingsApi } from './ui_settings_api';

/** @public */
interface UiSettingsClientParams {
api: UiSettingsApi;
defaults: UiSettingsState;
defaults: Record<string, UiSettingsParams>;
initialSettings?: UiSettingsState;
}

/**
* Client-side client that provides access to the advanced settings stored in elasticsearch.
* The settings provide control over the behavior of the Kibana application.
* For example, a user can specify how to display numeric or date fields.
* Users can adjust the settings via Management UI.
* {@link UiSettingsClient}
*
* @public
*/
export type UiSettingsClientContract = PublicMethodsOf<UiSettingsClient>;
Expand All @@ -44,8 +51,8 @@ export class UiSettingsClient {
private readonly updateErrors$ = new Rx.Subject<Error>();

private readonly api: UiSettingsApi;
private readonly defaults: UiSettingsState;
private cache: UiSettingsState;
private readonly defaults: Record<string, UiSettingsParams>;
private cache: Record<string, UiSettingsParams & UserProvidedValues>;

constructor(params: UiSettingsClientParams) {
this.api = params.api;
Expand Down
1 change: 1 addition & 0 deletions src/core/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export {
InternalUiSettingsServiceSetup,
UiSettingsType,
UiSettingsServiceSetup,
UserProvidedValues,
} from './ui_settings';

export { RecursiveReadonly } from '../utils';
Expand Down
Loading

0 comments on commit 48d632c

Please sign in to comment.