Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into rule-schema-u…
Browse files Browse the repository at this point in the history
…pdates-2
  • Loading branch information
spong committed Jul 14, 2020
2 parents 3322ca8 + 513d0e0 commit a687a93
Show file tree
Hide file tree
Showing 873 changed files with 22,451 additions and 8,940 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ target
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/src/plugins/vis_type_timelion/public/_generated_/**
/src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
/src/plugins/timelion/public/webpackShims/jquery.flot.*
/x-pack/legacy/plugins/**/__tests__/fixtures/**
/x-pack/plugins/apm/e2e/**/snapshots.js
/x-pack/plugins/apm/e2e/tmp/*
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"src/plugins/telemetry_management_section"
],
"tileMap": "src/plugins/tile_map",
"timelion": ["src/legacy/core_plugins/timelion", "src/plugins/vis_type_timelion"],
"timelion": ["src/plugins/timelion", "src/plugins/vis_type_timelion"],
"uiActions": "src/plugins/ui_actions",
"visDefaultEditor": "src/plugins/vis_default_editor",
"visTypeMarkdown": "src/plugins/vis_type_markdown",
Expand Down
2 changes: 1 addition & 1 deletion .sass-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
files:
include:
- 'src/legacy/core_plugins/metrics/**/*.s+(a|c)ss'
- 'src/legacy/core_plugins/timelion/**/*.s+(a|c)ss'
- 'src/plugins/timelion/**/*.s+(a|c)ss'
- 'src/plugins/vis_type_vislib/**/*.s+(a|c)ss'
- 'src/plugins/vis_type_xy/**/*.s+(a|c)ss'
- 'x-pack/plugins/canvas/**/*.s+(a|c)ss'
Expand Down
2 changes: 1 addition & 1 deletion docs/api/saved-objects/bulk_get.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ experimental[] Retrieve multiple {kib} saved objects by ID.
(Required, string) ID of the retrieved object. The ID includes the {kib} unique identifier or a custom identifier.

`fields`::
(Optional, array) The fields returned in the object response.
(Optional, array) The fields to return in the `attributes` key of the object response.

[[saved-objects-api-bulk-get-response-body]]
==== Response body
Expand Down
2 changes: 1 addition & 1 deletion docs/api/saved-objects/find.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ experimental[] Retrieve a paginated set of {kib} saved objects by various condit
(Optional, array|string) The fields to perform the `simple_query_string` parsed query against.

`fields`::
(Optional, array|string) The fields to return in the response.
(Optional, array|string) The fields to return in the `attributes` key of the response.

`sort_field`::
(Optional, string) The field that sorts the response.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export interface ISearchOptions
| Property | Type | Description |
| --- | --- | --- |
| [signal](./kibana-plugin-plugins-data-server.isearchoptions.signal.md) | <code>AbortSignal</code> | An <code>AbortSignal</code> that allows the caller of <code>search</code> to abort a search request. |
| [strategy](./kibana-plugin-plugins-data-server.isearchoptions.strategy.md) | <code>string</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-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [ISearchOptions](./kibana-plugin-plugins-data-server.isearchoptions.md) &gt; [strategy](./kibana-plugin-plugins-data-server.isearchoptions.strategy.md)

## ISearchOptions.strategy property

<b>Signature:</b>

```typescript
strategy?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export interface ISearchSetup

| Property | Type | Description |
| --- | --- | --- |
| [registerSearchStrategy](./kibana-plugin-plugins-data-server.isearchsetup.registersearchstrategy.md) | <code>TRegisterSearchStrategy</code> | Extension point exposed for other plugins to register their own search strategies. |
| [registerSearchStrategy](./kibana-plugin-plugins-data-server.isearchsetup.registersearchstrategy.md) | <code>(name: string, strategy: ISearchStrategy) =&gt; void</code> | Extension point exposed for other plugins to register their own search strategies. |

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Extension point exposed for other plugins to register their own search strategie
<b>Signature:</b>

```typescript
registerSearchStrategy: TRegisterSearchStrategy;
registerSearchStrategy: (name: string, strategy: ISearchStrategy) => void;
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Get other registered search strategies. For example, if a new strategy needs to
<b>Signature:</b>

```typescript
getSearchStrategy: TGetSearchStrategy;
getSearchStrategy: (name: string) => ISearchStrategy;
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export interface ISearchStart

| Property | Type | Description |
| --- | --- | --- |
| [getSearchStrategy](./kibana-plugin-plugins-data-server.isearchstart.getsearchstrategy.md) | <code>TGetSearchStrategy</code> | Get other registered search strategies. For example, if a new strategy needs to use the already-registered ES search strategy, it can use this function to accomplish that. |
| [getSearchStrategy](./kibana-plugin-plugins-data-server.isearchstart.getsearchstrategy.md) | <code>(name: string) =&gt; ISearchStrategy</code> | Get other registered search strategies. For example, if a new strategy needs to use the already-registered ES search strategy, it can use this function to accomplish that. |
| [search](./kibana-plugin-plugins-data-server.isearchstart.search.md) | <code>(context: RequestHandlerContext, request: IKibanaSearchRequest, options: ISearchOptions) =&gt; Promise&lt;IKibanaSearchResponse&gt;</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-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [ISearchStart](./kibana-plugin-plugins-data-server.isearchstart.md) &gt; [search](./kibana-plugin-plugins-data-server.isearchstart.search.md)

## ISearchStart.search property

<b>Signature:</b>

```typescript
search: (context: RequestHandlerContext, request: IKibanaSearchRequest, options: ISearchOptions) => Promise<IKibanaSearchResponse>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
cancel?: ISearchCancel<T>;
cancel?: (context: RequestHandlerContext, id: string) => Promise<void>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Search strategy interface contains a search method that takes in a request and r
<b>Signature:</b>

```typescript
export interface ISearchStrategy<T extends TStrategyTypes>
export interface ISearchStrategy
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [cancel](./kibana-plugin-plugins-data-server.isearchstrategy.cancel.md) | <code>ISearchCancel&lt;T&gt;</code> | |
| [search](./kibana-plugin-plugins-data-server.isearchstrategy.search.md) | <code>ISearch&lt;T&gt;</code> | |
| [cancel](./kibana-plugin-plugins-data-server.isearchstrategy.cancel.md) | <code>(context: RequestHandlerContext, id: string) =&gt; Promise&lt;void&gt;</code> | |
| [search](./kibana-plugin-plugins-data-server.isearchstrategy.search.md) | <code>(context: RequestHandlerContext, request: IEsSearchRequest, options?: ISearchOptions) =&gt; Promise&lt;IEsSearchResponse&gt;</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
search: ISearch<T>;
search: (context: RequestHandlerContext, request: IEsSearchRequest, options?: ISearchOptions) => Promise<IEsSearchResponse>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
| [IIndexPattern](./kibana-plugin-plugins-data-server.iindexpattern.md) | |
| [IndexPatternAttributes](./kibana-plugin-plugins-data-server.indexpatternattributes.md) | Use data plugin interface instead |
| [IndexPatternFieldDescriptor](./kibana-plugin-plugins-data-server.indexpatternfielddescriptor.md) | |
| [IRequestTypesMap](./kibana-plugin-plugins-data-server.irequesttypesmap.md) | The map of search strategy IDs to the corresponding request type definitions. |
| [IResponseTypesMap](./kibana-plugin-plugins-data-server.iresponsetypesmap.md) | The map of search strategy IDs to the corresponding response type definitions. |
| [ISearchOptions](./kibana-plugin-plugins-data-server.isearchoptions.md) | |
| [ISearchSetup](./kibana-plugin-plugins-data-server.isearchsetup.md) | |
| [ISearchStart](./kibana-plugin-plugins-data-server.isearchstart.md) | |
Expand Down Expand Up @@ -73,8 +71,5 @@
| --- | --- |
| [FieldFormatsGetConfigFn](./kibana-plugin-plugins-data-server.fieldformatsgetconfigfn.md) | |
| [IFieldFormatsRegistry](./kibana-plugin-plugins-data-server.ifieldformatsregistry.md) | |
| [ISearch](./kibana-plugin-plugins-data-server.isearch.md) | |
| [ISearchCancel](./kibana-plugin-plugins-data-server.isearchcancel.md) | |
| [ParsedInterval](./kibana-plugin-plugins-data-server.parsedinterval.md) | |
| [TStrategyTypes](./kibana-plugin-plugins-data-server.tstrategytypes.md) | Contains all known strategy type identifiers that will be used to map to request and response shapes. Plugins that wish to add their own custom search strategies should extend this type via:<!-- -->const MY\_STRATEGY = 'MY\_STRATEGY';<!-- -->declare module 'src/plugins/search/server' { export interface IRequestTypesMap { \[MY\_STRATEGY\]: IMySearchRequest; }<!-- -->export interface IResponseTypesMap { \[MY\_STRATEGY\]: IMySearchResponse } } |

This file was deleted.

2 changes: 1 addition & 1 deletion docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ retrieved.
`timelion:es.timefield`:: The default field containing a timestamp when using the `.es()` query.
`timelion:graphite.url`:: [experimental] Used with graphite queries, this is the URL of your graphite host
in the form https://www.hostedgraphite.com/UID/ACCESS_KEY/graphite. This URL can be
selected from a whitelist configured in the `kibana.yml` under `timelion.graphiteUrls`.
selected from an allow-list configured in the `kibana.yml` under `timelion.graphiteUrls`.
`timelion:max_buckets`:: The maximum number of buckets a single data source can return.
This value is used for calculating automatic intervals in visualizations.
`timelion:min_interval`:: The smallest interval to calculate when using "auto".
Expand Down
5 changes: 2 additions & 3 deletions docs/settings/ingest-manager-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
experimental[]

You can configure `xpack.ingestManager` settings in your `kibana.yml`.
By default, {ingest-manager} is not enabled. You need to
enable it. To use {fleet}, you also need to configure {kib} and {es} hosts.
By default, {ingest-manager} is enabled. To use {fleet}, you also need to configure {kib} and {es} hosts.

See the {ingest-guide}/index.html[Ingest Management] docs for more information.

Expand All @@ -19,7 +18,7 @@ See the {ingest-guide}/index.html[Ingest Management] docs for more information.
[cols="2*<"]
|===
| `xpack.ingestManager.enabled` {ess-icon}
| Set to `true` to enable {ingest-manager}.
| Set to `true` (default) to enable {ingest-manager}.
| `xpack.ingestManager.fleet.enabled` {ess-icon}
| Set to `true` (default) to enable {fleet}.
|===
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-config-schema/src/types/string_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export type StringOptions = TypeOptions<string> & {

export class StringType extends Type<string> {
constructor(options: StringOptions = {}) {
// We want to allow empty strings, however calling `allow('')` casues
// Joi to whitelist the value and skip any additional validation.
// We want to allow empty strings, however calling `allow('')` causes
// Joi to allow the value and skip any additional validation.
// Instead, we reimplement the string validator manually except in the
// hostname case where empty strings aren't allowed anyways.
let schema =
Expand Down
6 changes: 3 additions & 3 deletions src/core/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ export class MyPlugin implements Plugin<MyPluginSetup> {
return mountApp(await core.getStartServices(), params);
},
});
plugins.management.sections.getSection('another').registerApp({
plugins.management.sections.section.kibana.registerApp({
id: 'app',
title: 'My app',
order: 1,
Expand Down Expand Up @@ -1309,7 +1309,7 @@ This table shows where these uiExports have moved to in the New Platform. In mos
| `hacks` | n/a | Just run the code in your plugin's `start` method. |
| `home` | [`plugins.home.featureCatalogue.register`](./src/plugins/home/public/feature_catalogue) | Must add `home` as a dependency in your kibana.json. |
| `indexManagement` | | Should be an API on the indexManagement plugin. |
| `injectDefaultVars` | n/a | Plugins will only be able to "whitelist" config values for the frontend. See [#41990](https://github.com/elastic/kibana/issues/41990) |
| `injectDefaultVars` | n/a | Plugins will only be able to allow config values for the frontend. See [#41990](https://github.com/elastic/kibana/issues/41990) |
| `inspectorViews` | | Should be an API on the data (?) plugin. |
| `interpreter` | | Should be an API on the interpreter plugin. |
| `links` | n/a | Not necessary, just register your app via `core.application.register` |
Expand Down Expand Up @@ -1389,7 +1389,7 @@ class MyPlugin {
}
```

If your plugin also have a client-side part, you can also expose configuration properties to it using a whitelisting mechanism with the configuration `exposeToBrowser` property.
If your plugin also have a client-side part, you can also expose configuration properties to it using the configuration `exposeToBrowser` allow-list property.

```typescript
// my_plugin/server/index.ts
Expand Down
13 changes: 7 additions & 6 deletions src/core/public/application/scoped_history.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
import { Location } from 'history';
import { ScopedHistory } from './scoped_history';

type ScopedHistoryMock = jest.Mocked<Pick<ScopedHistory, keyof ScopedHistory>>;
export type ScopedHistoryMock = jest.Mocked<ScopedHistory>;

const createMock = ({
pathname = '/',
search = '',
hash = '',
key,
state,
...overrides
}: Partial<Location & ScopedHistoryMock> = {}) => {
const mock: ScopedHistoryMock = {
}: Partial<Location> = {}) => {
const mock: jest.Mocked<Pick<ScopedHistory, keyof ScopedHistory>> = {
block: jest.fn(),
createHref: jest.fn(),
createSubHistory: jest.fn(),
Expand All @@ -39,7 +39,6 @@ const createMock = ({
listen: jest.fn(),
push: jest.fn(),
replace: jest.fn(),
...overrides,
action: 'PUSH',
length: 1,
location: {
Expand All @@ -51,7 +50,9 @@ const createMock = ({
},
};

return mock;
// jest.Mocked still expects private methods and properties to be present, even
// if not part of the public contract.
return mock as ScopedHistoryMock;
};

export const scopedHistoryMock = {
Expand Down
8 changes: 4 additions & 4 deletions src/core/server/elasticsearch/client/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
node: 'http://localhost',
}) as any;

const blackListedProps = [
const omittedProps = [
'_events',
'_eventsCount',
'_maxListeners',
Expand All @@ -39,9 +39,9 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
'helpers',
];

const mockify = (obj: Record<string, any>, blacklist: string[] = []) => {
const mockify = (obj: Record<string, any>, omitted: string[] = []) => {
Object.keys(obj)
.filter((key) => !blacklist.includes(key))
.filter((key) => !omitted.includes(key))
.forEach((key) => {
const propType = typeof obj[key];
if (propType === 'function') {
Expand All @@ -52,7 +52,7 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
});
};

mockify(client, blackListedProps);
mockify(client, omittedProps);

client.transport = {
request: jest.fn(),
Expand Down
Loading

0 comments on commit a687a93

Please sign in to comment.