Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-64809
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed May 6, 2020
2 parents abeeefa + 9ee2574 commit 34b594e
Show file tree
Hide file tree
Showing 125 changed files with 2,736 additions and 536 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ module.exports = {
{
basePath: __dirname,
zones: [
{
target: ['(src|x-pack)/**/*', '!src/core/**/*'],
from: ['src/core/utils/**/*'],
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
},
{
target: [
'(src|x-pack)/legacy/**/*',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [assertNever](./kibana-plugin-core-public.assertnever.md)

## assertNever() function

Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking

<b>Signature:</b>

```typescript
export declare function assertNever(x: never): never;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| x | <code>never</code> | |

<b>Returns:</b>

`never`

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

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [deepFreeze](./kibana-plugin-core-public.deepfreeze.md)

## deepFreeze() function

Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively

<b>Signature:</b>

```typescript
export declare function deepFreeze<T extends Freezable>(object: T): RecursiveReadonly<T>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| object | <code>T</code> | |

<b>Returns:</b>

`RecursiveReadonly<T>`

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

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [Freezable](./kibana-plugin-core-public.freezable.md)

## Freezable type


<b>Signature:</b>

```typescript
export declare type Freezable = {
[k: string]: any;
} | any[];
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [getFlattenedObject](./kibana-plugin-core-public.getflattenedobject.md)

## getFlattenedObject() function

Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from `rootValue`<!-- -->.

example: getFlattenedObject(<!-- -->{ a: { b: 1, c: \[2,3\] } }<!-- -->) // =<!-- -->&gt; { 'a.b': 1, 'a.c': \[2,3\] }

<b>Signature:</b>

```typescript
export declare function getFlattenedObject(rootValue: Record<string, any>): {
[key: string]: any;
};
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| rootValue | <code>Record&lt;string, any&gt;</code> | |

<b>Returns:</b>

`{
[key: string]: any;
}`

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

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [isRelativeUrl](./kibana-plugin-core-public.isrelativeurl.md)

## isRelativeUrl() function

Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\*

<b>Signature:</b>

```typescript
export declare function isRelativeUrl(candidatePath: string): boolean;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| candidatePath | <code>string</code> | |

<b>Returns:</b>

`boolean`

12 changes: 12 additions & 0 deletions docs/development/core/public/kibana-plugin-core-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) | Status of the application's navLink. |
| [AppStatus](./kibana-plugin-core-public.appstatus.md) | Accessibility status of an application. |

## Functions

| Function | Description |
| --- | --- |
| [assertNever(x)](./kibana-plugin-core-public.assertnever.md) | Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking |
| [deepFreeze(object)](./kibana-plugin-core-public.deepfreeze.md) | Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively |
| [getFlattenedObject(rootValue)](./kibana-plugin-core-public.getflattenedobject.md) | Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from <code>rootValue</code>.<!-- -->example: getFlattenedObject(<!-- -->{ a: { b: 1, c: \[2,3\] } }<!-- -->) // =<!-- -->&gt; { 'a.b': 1, 'a.c': \[2,3\] } |
| [isRelativeUrl(candidatePath)](./kibana-plugin-core-public.isrelativeurl.md) | Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\* |
| [modifyUrl(url, urlModifier)](./kibana-plugin-core-public.modifyurl.md) | Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url.<!-- -->Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hash<!-- -->Why? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints |

## Interfaces

| Interface | Description |
Expand Down Expand Up @@ -118,6 +128,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | Options available for [IToasts](./kibana-plugin-core-public.itoasts.md) APIs. |
| [UiSettingsParams](./kibana-plugin-core-public.uisettingsparams.md) | UiSettings parameters defined by the plugins. |
| [UiSettingsState](./kibana-plugin-core-public.uisettingsstate.md) | |
| [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) | We define our own typings because the current version of @<!-- -->types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string". |
| [UserProvidedValues](./kibana-plugin-core-public.userprovidedvalues.md) | Describes the values explicitly set by user. |

## Type Aliases
Expand All @@ -139,6 +150,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [ChromeHelpExtensionMenuLink](./kibana-plugin-core-public.chromehelpextensionmenulink.md) | |
| [ChromeNavLinkUpdateableFields](./kibana-plugin-core-public.chromenavlinkupdateablefields.md) | |
| [FatalErrorsStart](./kibana-plugin-core-public.fatalerrorsstart.md) | FatalErrors stop the Kibana Public Core and displays a fatal error screen with details about the Kibana build and the error. |
| [Freezable](./kibana-plugin-core-public.freezable.md) | |
| [HandlerContextType](./kibana-plugin-core-public.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md) to represent the type of the context. |
| [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-core-public.icontextcontainer.md) |
| [HandlerParameters](./kibana-plugin-core-public.handlerparameters.md) | Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md)<!-- -->, excluding the [HandlerContextType](./kibana-plugin-core-public.handlercontexttype.md)<!-- -->. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [modifyUrl](./kibana-plugin-core-public.modifyurl.md)

## modifyUrl() function

Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url.

Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hash

Why? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints

<b>Signature:</b>

```typescript
export declare function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void): string;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| url | <code>string</code> | |
| urlModifier | <code>(urlParts: URLMeaningfulParts) =&gt; Partial&lt;URLMeaningfulParts&gt; &#124; void</code> | |

<b>Returns:</b>

`string`

The modified and reformatted url

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-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) &gt; [auth](./kibana-plugin-core-public.urlmeaningfulparts.auth.md)

## URLMeaningfulParts.auth property

<b>Signature:</b>

```typescript
auth?: string | null;
```
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-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) &gt; [hash](./kibana-plugin-core-public.urlmeaningfulparts.hash.md)

## URLMeaningfulParts.hash property

<b>Signature:</b>

```typescript
hash?: string | null;
```
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-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) &gt; [hostname](./kibana-plugin-core-public.urlmeaningfulparts.hostname.md)

## URLMeaningfulParts.hostname property

<b>Signature:</b>

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

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md)

## URLMeaningfulParts interface

We define our own typings because the current version of @<!-- -->types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string".

<b>Signature:</b>

```typescript
export interface URLMeaningfulParts
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [auth](./kibana-plugin-core-public.urlmeaningfulparts.auth.md) | <code>string &#124; null</code> | |
| [hash](./kibana-plugin-core-public.urlmeaningfulparts.hash.md) | <code>string &#124; null</code> | |
| [hostname](./kibana-plugin-core-public.urlmeaningfulparts.hostname.md) | <code>string &#124; null</code> | |
| [pathname](./kibana-plugin-core-public.urlmeaningfulparts.pathname.md) | <code>string &#124; null</code> | |
| [port](./kibana-plugin-core-public.urlmeaningfulparts.port.md) | <code>string &#124; null</code> | |
| [protocol](./kibana-plugin-core-public.urlmeaningfulparts.protocol.md) | <code>string &#124; null</code> | |
| [query](./kibana-plugin-core-public.urlmeaningfulparts.query.md) | <code>ParsedQuery</code> | |
| [slashes](./kibana-plugin-core-public.urlmeaningfulparts.slashes.md) | <code>boolean &#124; null</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-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) &gt; [pathname](./kibana-plugin-core-public.urlmeaningfulparts.pathname.md)

## URLMeaningfulParts.pathname property

<b>Signature:</b>

```typescript
pathname?: string | null;
```
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-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) &gt; [port](./kibana-plugin-core-public.urlmeaningfulparts.port.md)

## URLMeaningfulParts.port property

<b>Signature:</b>

```typescript
port?: string | null;
```
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-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) &gt; [protocol](./kibana-plugin-core-public.urlmeaningfulparts.protocol.md)

## URLMeaningfulParts.protocol property

<b>Signature:</b>

```typescript
protocol?: string | null;
```
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-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) &gt; [query](./kibana-plugin-core-public.urlmeaningfulparts.query.md)

## URLMeaningfulParts.query property

<b>Signature:</b>

```typescript
query: ParsedQuery;
```
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-core-public](./kibana-plugin-core-public.md) &gt; [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) &gt; [slashes](./kibana-plugin-core-public.urlmeaningfulparts.slashes.md)

## URLMeaningfulParts.slashes property

<b>Signature:</b>

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [assertNever](./kibana-plugin-core-server.assertnever.md)

## assertNever() function

Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking

<b>Signature:</b>

```typescript
export declare function assertNever(x: never): never;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| x | <code>never</code> | |

<b>Returns:</b>

`never`

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [deepFreeze](./kibana-plugin-core-server.deepfreeze.md)

## deepFreeze() function

Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively

<b>Signature:</b>

```typescript
export declare function deepFreeze<T extends Freezable>(object: T): RecursiveReadonly<T>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| object | <code>T</code> | |

<b>Returns:</b>

`RecursiveReadonly<T>`

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

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Freezable](./kibana-plugin-core-server.freezable.md)

## Freezable type


<b>Signature:</b>

```typescript
export declare type Freezable = {
[k: string]: any;
} | any[];
```
Loading

0 comments on commit 34b594e

Please sign in to comment.