Create the @kbn/std package (#77329) (#77477)

* move `src/core/utils` to the @kbn/std package

* update README

* update codeowners and add yarn lock file

* remove export from src/core/public and src/core/server and use package import instead

* update generated doc

* adapt forgotten import

* update `data` plugin doc
# Conflicts:
#	.github/CODEOWNERS
#	src/core/public/application/capabilities/capabilities_service.mock.ts
#	src/core/public/index.ts
This commit is contained in:
Pierre Gayvallet 2020-09-15 17:15:39 +02:00 committed by GitHub
parent ba0f06c463
commit 07481527c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 144 additions and 715 deletions

View file

@ -1,24 +0,0 @@
<!-- 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`

View file

@ -1,24 +0,0 @@
<!-- 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>`

View file

@ -1,14 +0,0 @@
<!-- 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[];
```

View file

@ -1,30 +0,0 @@
<!-- 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;
}`

View file

@ -1,24 +0,0 @@
<!-- 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`

View file

@ -27,16 +27,6 @@ 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 |
@ -128,7 +118,6 @@ 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. |
## Variables
@ -156,7 +145,6 @@ 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)<!-- -->. |

View file

@ -1,31 +0,0 @@
<!-- 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

View file

@ -1,11 +0,0 @@
<!-- 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;
```

View file

@ -1,11 +0,0 @@
<!-- 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;
```

View file

@ -1,11 +0,0 @@
<!-- 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;
```

View file

@ -1,27 +0,0 @@
<!-- 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> | |

View file

@ -1,11 +0,0 @@
<!-- 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;
```

View file

@ -1,11 +0,0 @@
<!-- 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;
```

View file

@ -1,11 +0,0 @@
<!-- 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;
```

View file

@ -1,11 +0,0 @@
<!-- 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;
```

View file

@ -1,11 +0,0 @@
<!-- 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;
```

View file

@ -1,24 +0,0 @@
<!-- 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`

View file

@ -1,24 +0,0 @@
<!-- 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>`

View file

@ -1,14 +0,0 @@
<!-- 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[];
```

View file

@ -1,30 +0,0 @@
<!-- 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; [getFlattenedObject](./kibana-plugin-core-server.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;
}`

View file

@ -1,24 +0,0 @@
<!-- 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; [isRelativeUrl](./kibana-plugin-core-server.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`

View file

@ -42,13 +42,8 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| Function | Description |
| --- | --- |
| [assertNever(x)](./kibana-plugin-core-server.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-server.deepfreeze.md) | Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively |
| [exportSavedObjectsToStream({ types, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, })](./kibana-plugin-core-server.exportsavedobjectstostream.md) | Generates sorted saved object stream to be used for export. See the [options](./kibana-plugin-core-server.savedobjectsexportoptions.md) for more detailed information. |
| [getFlattenedObject(rootValue)](./kibana-plugin-core-server.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\] } |
| [importSavedObjectsFromStream({ readStream, objectLimit, overwrite, createNewCopies, savedObjectsClient, typeRegistry, namespace, })](./kibana-plugin-core-server.importsavedobjectsfromstream.md) | Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information. |
| [isRelativeUrl(candidatePath)](./kibana-plugin-core-server.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-server.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 |
| [resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, typeRegistry, namespace, createNewCopies, })](./kibana-plugin-core-server.resolvesavedobjectsimporterrors.md) | Resolve and return saved object import errors. See the [options](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations. |
## Interfaces
@ -217,7 +212,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) | UiSettings parameters defined by the plugins. |
| [UiSettingsServiceSetup](./kibana-plugin-core-server.uisettingsservicesetup.md) | |
| [UiSettingsServiceStart](./kibana-plugin-core-server.uisettingsservicestart.md) | |
| [URLMeaningfulParts](./kibana-plugin-core-server.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-server.userprovidedvalues.md) | Describes the values explicitly set by user. |
## Variables
@ -246,7 +240,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [DestructiveRouteMethod](./kibana-plugin-core-server.destructiveroutemethod.md) | Set of HTTP methods changing the state of the server. |
| [ElasticsearchClient](./kibana-plugin-core-server.elasticsearchclient.md) | Client used to query the elasticsearch cluster. |
| [ElasticsearchClientConfig](./kibana-plugin-core-server.elasticsearchclientconfig.md) | Configuration options to be used to create a [cluster client](./kibana-plugin-core-server.iclusterclient.md) using the [createClient API](./kibana-plugin-core-server.elasticsearchservicestart.createclient.md) |
| [Freezable](./kibana-plugin-core-server.freezable.md) | |
| [GetAuthHeaders](./kibana-plugin-core-server.getauthheaders.md) | Get headers to authenticate a user against Elasticsearch. |
| [GetAuthState](./kibana-plugin-core-server.getauthstate.md) | Gets authentication state for a request. Returned by <code>auth</code> interceptor. |
| [HandlerContextType](./kibana-plugin-core-server.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-core-server.handlerfunction.md) to represent the type of the context. |

View file

@ -1,31 +0,0 @@
<!-- 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; [modifyUrl](./kibana-plugin-core-server.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

View file

@ -1,11 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) &gt; [auth](./kibana-plugin-core-server.urlmeaningfulparts.auth.md)
## URLMeaningfulParts.auth property
<b>Signature:</b>
```typescript
auth?: string | null;
```

View file

@ -1,11 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) &gt; [hash](./kibana-plugin-core-server.urlmeaningfulparts.hash.md)
## URLMeaningfulParts.hash property
<b>Signature:</b>
```typescript
hash?: string | null;
```

View file

@ -1,11 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) &gt; [hostname](./kibana-plugin-core-server.urlmeaningfulparts.hostname.md)
## URLMeaningfulParts.hostname property
<b>Signature:</b>
```typescript
hostname?: string | null;
```

View file

@ -1,27 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.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-server.urlmeaningfulparts.auth.md) | <code>string &#124; null</code> | |
| [hash](./kibana-plugin-core-server.urlmeaningfulparts.hash.md) | <code>string &#124; null</code> | |
| [hostname](./kibana-plugin-core-server.urlmeaningfulparts.hostname.md) | <code>string &#124; null</code> | |
| [pathname](./kibana-plugin-core-server.urlmeaningfulparts.pathname.md) | <code>string &#124; null</code> | |
| [port](./kibana-plugin-core-server.urlmeaningfulparts.port.md) | <code>string &#124; null</code> | |
| [protocol](./kibana-plugin-core-server.urlmeaningfulparts.protocol.md) | <code>string &#124; null</code> | |
| [query](./kibana-plugin-core-server.urlmeaningfulparts.query.md) | <code>ParsedQuery</code> | |
| [slashes](./kibana-plugin-core-server.urlmeaningfulparts.slashes.md) | <code>boolean &#124; null</code> | |

View file

@ -1,11 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) &gt; [pathname](./kibana-plugin-core-server.urlmeaningfulparts.pathname.md)
## URLMeaningfulParts.pathname property
<b>Signature:</b>
```typescript
pathname?: string | null;
```

View file

@ -1,11 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) &gt; [port](./kibana-plugin-core-server.urlmeaningfulparts.port.md)
## URLMeaningfulParts.port property
<b>Signature:</b>
```typescript
port?: string | null;
```

View file

@ -1,11 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) &gt; [protocol](./kibana-plugin-core-server.urlmeaningfulparts.protocol.md)
## URLMeaningfulParts.protocol property
<b>Signature:</b>
```typescript
protocol?: string | null;
```

View file

@ -1,11 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) &gt; [query](./kibana-plugin-core-server.urlmeaningfulparts.query.md)
## URLMeaningfulParts.query property
<b>Signature:</b>
```typescript
query: ParsedQuery;
```

View file

@ -1,11 +0,0 @@
<!-- 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; [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) &gt; [slashes](./kibana-plugin-core-server.urlmeaningfulparts.slashes.md)
## URLMeaningfulParts.slashes property
<b>Signature:</b>
```typescript
slashes?: boolean | null;
```

View file

@ -7,5 +7,5 @@
<b>Signature:</b>
```typescript
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "isInvalid" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>
QueryStringInput: React.FC<Pick<Props, "prepend" | "query" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "isInvalid" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>
```

View file

@ -138,6 +138,7 @@
"@kbn/i18n": "1.0.0",
"@kbn/interpreter": "1.0.0",
"@kbn/pm": "1.0.0",
"@kbn/std": "1.0.0",
"@kbn/telemetry-tools": "1.0.0",
"@kbn/test-subj-selector": "0.2.1",
"@kbn/ui-framework": "1.0.0",

View file

@ -0,0 +1,3 @@
# `@kbn/std` — Kibana standard library
This package is a set of utilities that can be used both on server-side and client-side.

View file

@ -0,0 +1,21 @@
{
"name": "@kbn/std",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"version": "1.0.0",
"license": "Apache-2.0",
"private": true,
"scripts": {
"build": "tsc",
"kbn:bootstrap": "yarn build"
},
"devDependencies": {
"typescript": "4.0.2",
"tsd": "^0.13.1"
},
"dependencies": {
"@kbn/utility-types": "1.0.0",
"lodash": "^4.17.15",
"query-string": "5.1.1"
}
}

View file

@ -0,0 +1,29 @@
/*
* 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.
*/
export { assertNever } from './assert_never';
export { deepFreeze, Freezable } from './deep_freeze';
export { get } from './get';
export { mapToObject } from './map_to_object';
export { merge } from './merge';
export { pick } from './pick';
export { withTimeout } from './promise';
export { isRelativeUrl, modifyUrl, URLMeaningfulParts } from './url';
export { unset } from './unset';
export { getFlattenedObject } from './get_flattened_object';

View file

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { isPlainObject } from 'lodash';
import isPlainObject from 'lodash/isPlainObject';
/**
* Deeply merges two objects, omitting undefined values, and not deeply merging Arrays.
*

View file

@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"declarationDir": "./target",
"outDir": "./target",
"stripInternal": true,
"declarationMap": true,
"types": ["jest", "node"]
},
"include": [
"./src/**/*.ts",
"../../typings/query_string.d.ts"
],
"exclude": ["target"]
}

1
packages/kbn-std/yarn.lock Symbolic link
View file

@ -0,0 +1 @@
../../yarn.lock

View file

@ -98,3 +98,9 @@ export type PublicKeys<T> = keyof T;
* Returns an object with public keys only.
*/
export type PublicContract<T> = Pick<T, PublicKeys<T>>;
type MethodKeysOf<T> = {
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
}[keyof T];
export type PublicMethodsOf<T> = Pick<T, MethodKeysOf<T>>;

View file

@ -16,8 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
import { deepFreeze } from '@kbn/std';
import type { PublicMethodsOf } from '@kbn/utility-types';
import { CapabilitiesService, CapabilitiesStart } from './capabilities_service';
import { deepFreeze } from '../../../utils';
const createStartContractMock = (): jest.Mocked<CapabilitiesStart> => ({
capabilities: deepFreeze({

View file

@ -17,9 +17,9 @@
* under the License.
*/
import { RecursiveReadonly } from '@kbn/utility-types';
import { deepFreeze } from '@kbn/std';
import { Capabilities } from '../../../types/capabilities';
import { deepFreeze } from '../../../utils';
import { HttpStart } from '../../http';
interface StartDeps {

View file

@ -17,7 +17,7 @@
* under the License.
*/
import { pick } from '../../../utils';
import { pick } from '@kbn/std';
import { AppCategory } from '../../';
/**

View file

@ -17,6 +17,7 @@
* under the License.
*/
import { pick } from '@kbn/std';
import { CoreId } from '../server';
import { PackageInfo, EnvironmentMode } from '../server/types';
import { CoreSetup, CoreStart } from '.';
@ -35,7 +36,6 @@ import { OverlayService } from './overlays';
import { PluginsService } from './plugins';
import { UiSettingsService } from './ui_settings';
import { ApplicationService } from './application';
import { pick } from '../utils/';
import { DocLinksService } from './doc_links';
import { RenderingService } from './rendering';
import { SavedObjectsService } from './saved_objects';

View file

@ -17,8 +17,8 @@
* under the License.
*/
import { deepFreeze } from '@kbn/std';
import { InjectedMetadataSetup } from '../injected_metadata';
import { deepFreeze } from '../../utils';
interface StartDeps {
injectedMetadata: InjectedMetadataSetup;

View file

@ -35,7 +35,7 @@
* under the License.
*/
import { modifyUrl } from '../../utils';
import { modifyUrl } from '@kbn/std';
export class BasePath {
constructor(

View file

@ -68,7 +68,6 @@ import { UiSettingsState, IUiSettingsClient } from './ui_settings';
import { ApplicationSetup, Capabilities, ApplicationStart } from './application';
import { DocLinksStart } from './doc_links';
import { SavedObjectsStart } from './saved_objects';
export { PackageInfo, EnvironmentMode } from '../server/types';
import {
IContextContainer,
IContextProvider,
@ -78,18 +77,10 @@ import {
HandlerParameters,
} from './context';
export { PackageInfo, EnvironmentMode } from '../server/types';
/** @interal */
export { CoreContext, CoreSystem } from './core_system';
export {
DEFAULT_APP_CATEGORIES,
getFlattenedObject,
URLMeaningfulParts,
modifyUrl,
isRelativeUrl,
Freezable,
deepFreeze,
assertNever,
} from '../utils';
export { DEFAULT_APP_CATEGORIES } from '../utils';
export {
AppCategory,
UiSettingsParams,

View file

@ -18,6 +18,7 @@
*/
import { get } from 'lodash';
import { deepFreeze } from '@kbn/std';
import { DiscoveredPlugin, PluginName } from '../../server';
import {
EnvironmentMode,
@ -25,7 +26,6 @@ import {
UiSettingsParams,
UserProvidedValues,
} from '../../server/types';
import { deepFreeze } from '../../utils/';
import { AppCategory } from '../';
export interface InjectedPluginMetadata {

View file

@ -17,6 +17,7 @@
* under the License.
*/
import { withTimeout } from '@kbn/std';
import { PluginName, PluginOpaqueId } from '../../server';
import { CoreService } from '../../types';
import { CoreContext } from '../core_system';
@ -28,7 +29,6 @@ import {
} from './plugin_context';
import { InternalCoreSetup, InternalCoreStart } from '../core_system';
import { InjectedPluginMetadata } from '../injected_metadata';
import { withTimeout } from '../../utils';
const Sec = 1000;
/** @internal */

View file

@ -22,7 +22,6 @@ import { Location } from 'history';
import { LocationDescriptorObject } from 'history';
import { MaybePromise } from '@kbn/utility-types';
import { Observable } from 'rxjs';
import { ParsedQuery } from 'query-string';
import { Path } from 'history';
import { PublicUiSettingsParams as PublicUiSettingsParams_2 } from 'src/core/server/types';
import React from 'react';
@ -187,9 +186,6 @@ export type AppUpdatableFields = Pick<App, 'status' | 'navLinkStatus' | 'tooltip
// @public
export type AppUpdater = (app: App) => Partial<AppUpdatableFields> | undefined;
// @public
export function assertNever(x: never): never;
// @public
export interface Capabilities {
[key: string]: Record<string, boolean | Record<string, boolean>>;
@ -444,9 +440,6 @@ export class CoreSystem {
stop(): void;
}
// @public
export function deepFreeze<T extends Freezable>(object: T): RecursiveReadonly<T>;
// @internal (undocumented)
export const DEFAULT_APP_CATEGORIES: Readonly<{
kibana: {
@ -616,16 +609,6 @@ export interface FatalErrorsSetup {
// @public
export type FatalErrorsStart = FatalErrorsSetup;
// @public (undocumented)
export type Freezable = {
[k: string]: any;
} | any[];
// @public
export function getFlattenedObject(rootValue: Record<string, any>): {
[key: string]: any;
};
// @public
export type HandlerContextType<T extends HandlerFunction<any>> = T extends HandlerFunction<infer U> ? U : never;
@ -837,9 +820,6 @@ export interface ImageValidation {
};
}
// @public
export function isRelativeUrl(candidatePath: string): boolean;
// @public
export type IToasts = Pick<ToastsApi, 'get$' | 'add' | 'remove' | 'addSuccess' | 'addWarning' | 'addDanger' | 'addError' | 'addInfo'>;
@ -868,9 +848,6 @@ export interface IUiSettingsClient {
set: (key: string, value: any) => Promise<boolean>;
}
// @public
export function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void): string;
// @public
export type MountPoint<T extends HTMLElement = HTMLElement> = (element: T) => UnmountCallback;
@ -1447,26 +1424,6 @@ export type UnmountCallback = () => void;
// @public
export const URL_MAX_LENGTH: number;
// @public
export interface URLMeaningfulParts {
// (undocumented)
auth?: string | null;
// (undocumented)
hash?: string | null;
// (undocumented)
hostname?: string | null;
// (undocumented)
pathname?: string | null;
// (undocumented)
port?: string | null;
// (undocumented)
protocol?: string | null;
// (undocumented)
query: ParsedQuery;
// (undocumented)
slashes?: boolean | null;
}
// @public
export interface UserProvidedValues<T = any> {
// (undocumented)

View file

@ -17,10 +17,10 @@
* under the License.
*/
import { set } from '@elastic/safer-lodash-set';
import { get } from 'lodash';
import { set } from '@elastic/safer-lodash-set';
import { unset } from '@kbn/std';
import { ConfigDeprecation, ConfigDeprecationLogger, ConfigDeprecationFactory } from './types';
import { unset } from '../../../utils';
const _rename = (
config: Record<string, any>,

View file

@ -17,10 +17,10 @@
* under the License.
*/
import { set } from '@elastic/safer-lodash-set';
import { cloneDeep, get, has } from 'lodash';
import { set } from '@elastic/safer-lodash-set';
import { getFlattenedObject } from '@kbn/std';
import { getFlattenedObject } from '../../utils';
import { Config, ConfigPath } from './';
/**

View file

@ -19,9 +19,9 @@
import { Observable, Subject } from 'rxjs';
import { first, map, shareReplay, takeUntil } from 'rxjs/operators';
import { merge } from '@kbn/std';
import { CoreService } from '../../types';
import { merge } from '../../utils';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import {

View file

@ -22,7 +22,7 @@ import { cloneDeep } from 'lodash';
import { Duration } from 'moment';
import { checkServerIdentity } from 'tls';
import url from 'url';
import { pick } from '../../../utils';
import { pick } from '@kbn/std';
import { Logger } from '../../logging';
import { ElasticsearchConfig } from '../elasticsearch_config';

View file

@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
import { ensureRawRequest, KibanaRequest, LegacyRequest } from './router';
import { modifyUrl } from '@kbn/std';
import { modifyUrl } from '../../utils';
import { ensureRawRequest, KibanaRequest, LegacyRequest } from './router';
/**
* Access or manipulate the Kibana base path

View file

@ -20,9 +20,9 @@
import { Observable, Subscription, combineLatest } from 'rxjs';
import { first, map } from 'rxjs/operators';
import { Server } from 'hapi';
import { pick } from '@kbn/std';
import { CoreService } from '../../types';
import { pick } from '../../utils';
import { Logger, LoggerFactory } from '../logging';
import { ContextSetup } from '../context';
import { Env } from '../config';

View file

@ -17,8 +17,7 @@
* under the License.
*/
import { IncomingHttpHeaders } from 'http';
import { pick } from '../../../utils';
import { pick } from '@kbn/std';
/**
* Creates a Union type of all known keys of a given interface.

View file

@ -23,8 +23,8 @@ import { Request, RouteOptionsApp, ApplicationState } from 'hapi';
import { Observable, fromEvent, merge } from 'rxjs';
import { shareReplay, first, takeUntil } from 'rxjs/operators';
import { RecursiveReadonly } from '@kbn/utility-types';
import { deepFreeze } from '@kbn/std';
import { deepFreeze } from '../../../utils';
import { Headers } from './headers';
import { RouteMethod, RouteConfigOptions, validBodyOutput, isSafeMethod } from './route';
import { KibanaSocket, IKibanaSocket } from './socket';

View file

@ -322,16 +322,7 @@ export {
MetricsServiceSetup,
} from './metrics';
export {
DEFAULT_APP_CATEGORIES,
getFlattenedObject,
URLMeaningfulParts,
modifyUrl,
isRelativeUrl,
Freezable,
deepFreeze,
assertNever,
} from '../utils';
export { DEFAULT_APP_CATEGORIES } from '../utils';
export {
SavedObject,

View file

@ -18,8 +18,8 @@
*/
import { difference } from 'lodash';
import { getFlattenedObject } from '@kbn/std';
import { unset } from '../../../../legacy/utils';
import { getFlattenedObject } from '../../../utils';
import { hasConfigPathIntersection } from '../../config';
import { LegacyPluginSpec, LegacyConfig, LegacyVars } from '../types';

View file

@ -18,8 +18,8 @@
*/
import { schema } from '@kbn/config-schema';
import { assertNever } from '@kbn/std';
import { assertNever } from '../../../utils';
import {
LegacyAppender,
LegacyAppenderConfig,

View file

@ -18,8 +18,8 @@
*/
import { schema } from '@kbn/config-schema';
import { assertNever } from '@kbn/std';
import { assertNever } from '../../../utils';
import { LogRecord } from '../log_record';
import { JsonLayout, JsonLayoutConfigType } from './json_layout';
import { PatternLayout, PatternLayoutConfigType } from './pattern_layout';

View file

@ -17,7 +17,7 @@
* under the License.
*/
import { assertNever } from '../../utils';
import { assertNever } from '@kbn/std';
/**
* Possible log level string values.

View file

@ -19,6 +19,8 @@
import { map, shareReplay } from 'rxjs/operators';
import { combineLatest } from 'rxjs';
import { pick, deepFreeze } from '@kbn/std';
import { CoreContext } from '../core_context';
import { PluginWrapper } from './plugin';
import { PluginsServiceSetupDeps, PluginsServiceStartDeps } from './plugins_service';
@ -34,7 +36,6 @@ import {
ElasticsearchConfigType,
config as elasticsearchConfig,
} from '../elasticsearch/elasticsearch_config';
import { pick, deepFreeze } from '../../utils';
import { CoreSetup, CoreStart } from '..';
export interface InstanceInfo {

View file

@ -20,9 +20,10 @@
import Path from 'path';
import { Observable } from 'rxjs';
import { filter, first, map, mergeMap, tap, toArray } from 'rxjs/operators';
import { pick } from '@kbn/std';
import { CoreService } from '../../types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { discover, PluginDiscoveryError, PluginDiscoveryErrorType } from './discovery';
import { PluginWrapper } from './plugin';
@ -31,7 +32,6 @@ import { PluginsConfig, PluginsConfigType } from './plugins_config';
import { PluginsSystem } from './plugins_system';
import { InternalCoreSetup, InternalCoreStart } from '../internal_types';
import { IConfigService } from '../config';
import { pick } from '../../utils';
import { InternalEnvironmentServiceSetup } from '../environment';
/** @internal */

View file

@ -17,13 +17,13 @@
* under the License.
*/
import { withTimeout } from '@kbn/std';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { PluginWrapper } from './plugin';
import { DiscoveredPlugin, PluginName } from './types';
import { createPluginSetupContext, createPluginStartContext } from './plugin_context';
import { PluginsServiceSetupDeps, PluginsServiceStartDeps } from './plugins_service';
import { withTimeout } from '../../utils';
import { PluginDependencies } from '.';
const Sec = 1000;

View file

@ -17,7 +17,7 @@
* under the License.
*/
import { deepFreeze } from '../../utils';
import { deepFreeze } from '@kbn/std';
import { SavedObjectsType } from './types';
/**

View file

@ -106,7 +106,6 @@ import { NodesInfoParams } from 'elasticsearch';
import { NodesStatsParams } from 'elasticsearch';
import { ObjectType } from '@kbn/config-schema';
import { Observable } from 'rxjs';
import { ParsedQuery } from 'query-string';
import { PeerCertificate } from 'tls';
import { PingParams } from 'elasticsearch';
import { PutScriptParams } from 'elasticsearch';
@ -160,9 +159,6 @@ import { Url } from 'url';
// @public (undocumented)
export type AppenderConfigType = ConsoleAppenderConfig | FileAppenderConfig | LegacyAppenderConfig;
// @public
export function assertNever(x: never): never;
// @public @deprecated (undocumented)
export interface AssistanceAPIResponse {
// (undocumented)
@ -504,9 +500,6 @@ export interface CustomHttpResponseOptions<T extends HttpResponsePayload | Respo
statusCode: number;
}
// @public
export function deepFreeze<T extends Freezable>(object: T): RecursiveReadonly<T>;
// @internal (undocumented)
export const DEFAULT_APP_CATEGORIES: Readonly<{
kibana: {
@ -716,11 +709,6 @@ export interface FakeRequest {
headers: Headers;
}
// @public (undocumented)
export type Freezable = {
[k: string]: any;
} | any[];
// @public
export type GetAuthHeaders = (request: KibanaRequest | LegacyRequest) => AuthHeaders | undefined;
@ -730,11 +718,6 @@ export type GetAuthState = <T = unknown>(request: KibanaRequest | LegacyRequest)
state: T;
};
// @public
export function getFlattenedObject(rootValue: Record<string, any>): {
[key: string]: any;
};
// @public (undocumented)
export interface GetResponse<T> {
// (undocumented)
@ -966,9 +949,6 @@ export interface IScopedClusterClient {
readonly asInternalUser: ElasticsearchClient;
}
// @public
export function isRelativeUrl(candidatePath: string): boolean;
// @public
export interface IUiSettingsClient {
get: <T = any>(key: string) => Promise<T>;
@ -1543,9 +1523,6 @@ export type MIGRATION_ASSISTANCE_INDEX_ACTION = 'upgrade' | 'reindex';
// @public @deprecated (undocumented)
export type MIGRATION_DEPRECATION_LEVEL = 'none' | 'info' | 'warning' | 'critical';
// @public
export function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void): string;
// @public
export type MutatingOperationRefreshSetting = boolean | 'wait_for';
@ -2848,26 +2825,6 @@ export interface UiSettingsServiceStart {
// @public
export type UiSettingsType = 'undefined' | 'json' | 'markdown' | 'number' | 'select' | 'boolean' | 'string' | 'array' | 'image';
// @public
export interface URLMeaningfulParts {
// (undocumented)
auth?: string | null;
// (undocumented)
hash?: string | null;
// (undocumented)
hostname?: string | null;
// (undocumented)
pathname?: string | null;
// (undocumented)
port?: string | null;
// (undocumented)
protocol?: string | null;
// (undocumented)
query: ParsedQuery;
// (undocumented)
slashes?: boolean | null;
}
// @public
export interface UserProvidedValues<T = any> {
// (undocumented)

View file

@ -17,6 +17,7 @@
* under the License.
*/
import { mapToObject } from '@kbn/std';
import { ConfigService, Env, RawConfigurationProvider, coreDeprecationProvider } from './config';
import { CoreApp } from './core_app';
import { AuditTrailService } from './audit_trail';
@ -44,7 +45,6 @@ import { config as kibanaConfig } from './kibana_config';
import { savedObjectsConfig, savedObjectsMigrationConfig } from './saved_objects';
import { config as uiSettingsConfig } from './ui_settings';
import { config as statusConfig } from './status';
import { mapToObject } from '../utils';
import { ContextService } from './context';
import { RequestHandlerContext } from '.';
import { InternalCoreSetup, InternalCoreStart, ServiceConfigDescriptor } from './internal_types';

View file

@ -18,7 +18,7 @@
*/
import { Observable } from 'rxjs';
import { deepFreeze } from '../../utils';
import { deepFreeze } from '@kbn/std';
import { PluginName } from '../plugins';
/**

View file

@ -19,8 +19,8 @@
import { schema } from '@kbn/config-schema';
import { i18n } from '@kbn/i18n';
import { isRelativeUrl } from '@kbn/std';
import { UiSettingsParams } from '../../../types';
import { isRelativeUrl } from '../../../utils';
export const getNavigationSettings = (): Record<string, UiSettingsParams> => {
return {

View file

@ -19,10 +19,11 @@
import { Observable } from 'rxjs';
import { first } from 'rxjs/operators';
import { mapToObject } from '@kbn/std';
import { CoreService } from '../../types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { SavedObjectsClientContract } from '../saved_objects/types';
import { InternalSavedObjectsServiceSetup } from '../saved_objects';
import { InternalHttpServiceSetup } from '../http';
@ -33,7 +34,6 @@ import {
InternalUiSettingsServiceStart,
UiSettingsParams,
} from './types';
import { mapToObject } from '../../utils/';
import { uiSettingsType } from './saved_objects';
import { registerRoutes } from './routes';
import { getCoreSettings } from './settings';

View file

@ -19,8 +19,8 @@
import { flatten } from 'lodash';
import { ShallowPromise } from '@kbn/utility-types';
import { pick } from '.';
import { CoreId, PluginOpaqueId } from '../server';
import { pick } from '@kbn/std';
import type { CoreId, PluginOpaqueId } from '../server';
/**
* Make all properties in T optional, except for the properties whose keys are in the union K

View file

@ -17,15 +17,12 @@
* under the License.
*/
export * from './assert_never';
export * from './context';
export * from './deep_freeze';
export * from './get';
export * from './map_to_object';
export * from './merge';
export * from './pick';
export * from './promise';
export * from './url';
export * from './unset';
export * from './get_flattened_object';
export * from './default_app_categories';
export {
ContextContainer,
HandlerContextType,
HandlerFunction,
HandlerParameters,
IContextContainer,
IContextProvider,
} from './context';
export { DEFAULT_APP_CATEGORIES } from './default_app_categories';

View file

@ -1693,7 +1693,7 @@ export interface QueryStateChange extends QueryStateChangePartial {
// Warning: (ae-missing-release-tag) "QueryStringInput" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const QueryStringInput: React.FC<Pick<Props_3, "query" | "prepend" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "isInvalid" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>;
export const QueryStringInput: React.FC<Pick<Props_3, "prepend" | "query" | "size" | "className" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "isInvalid" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>;
// @public (undocumented)
export type QuerySuggestion = QuerySuggestionBasic | QuerySuggestionField;

View file

@ -17,9 +17,9 @@
* under the License.
*/
import React from 'react';
import { getFlattenedObject } from '@kbn/std';
import { EuiCodeBlock, EuiDescriptionList, EuiSpacer } from '@elastic/eui';
import { ShardFailure } from './shard_failure_types';
import { getFlattenedObject } from '../../../../../core/public';
import { ShardFailureDescriptionHeader } from './shard_failure_description_header';
/**

View file

@ -19,11 +19,11 @@
import { CoreSetup, IRouter } from 'kibana/server';
import { schema } from '@kbn/config-schema';
import { modifyUrl } from '@kbn/std';
import { shortUrlAssertValid } from './lib/short_url_assert_valid';
import { ShortUrlLookupService } from './lib/short_url_lookup';
import { getGotoPath } from '../../common/short_url_routes';
import { modifyUrl } from '../../../../core/server';
export const createGotoRoute = ({
router,

View file

@ -21,10 +21,10 @@ import { i18n } from '@kbn/i18n';
import { first } from 'rxjs/operators';
import { TypeOf, schema } from '@kbn/config-schema';
import { RecursiveReadonly } from '@kbn/utility-types';
import { deepFreeze } from '@kbn/std';
import { PluginStart } from '../../../../src/plugins/data/server';
import { CoreSetup, PluginInitializerContext } from '../../../../src/core/server';
import { deepFreeze } from '../../../../src/core/server';
import { configSchema } from '../config';
import loadFunctions from './lib/load_functions';
import { functionsRoute } from './routes/functions';

View file

@ -22,9 +22,9 @@ import { Key, Origin } from 'selenium-webdriver';
// @ts-ignore internal modules are not typed
import { LegacyActionSequence } from 'selenium-webdriver/lib/actions';
import { ProvidedType } from '@kbn/test/types/ftr';
import { modifyUrl } from '@kbn/std';
import Jimp from 'jimp';
import { modifyUrl } from '../../../../src/core/utils';
import { WebElementWrapper } from '../lib/web_element_wrapper';
import { FtrProviderContext } from '../../ftr_provider_context';
import { Browsers } from '../remote/browsers';

View file

@ -6,7 +6,7 @@
import { i18n } from '@kbn/i18n';
import { Observable, Subscription } from 'rxjs';
import { assertNever } from '../../../../../src/core/server';
import { assertNever } from '@kbn/std';
import { ILicense } from '../../../licensing/common/types';
import { PLUGIN } from '../constants/plugin';
import { ActionType } from '../types';

Some files were not shown because too many files have changed in this diff Show more