mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* core contracts don't use unknown to support type assignment limitations of https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#-k-string-unknown--is-no-longer-a-wildcard-assignment-target * regenereate docs * remove type over-write
This commit is contained in:
parent
cf8b37925d
commit
8058093241
13 changed files with 25 additions and 25 deletions
|
@ -8,5 +8,5 @@
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type APICaller = (endpoint: string, clientParams: Record<string, unknown>, options?: CallAPIOptions) => Promise<unknown>;
|
||||
export declare type APICaller = (endpoint: string, clientParams: Record<string, any>, options?: CallAPIOptions) => Promise<unknown>;
|
||||
```
|
||||
|
|
|
@ -17,5 +17,5 @@ export interface AuthResultData
|
|||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [headers](./kibana-plugin-server.authresultdata.headers.md) | <code>AuthHeaders</code> | Auth specific headers to authenticate a user against Elasticsearch. |
|
||||
| [state](./kibana-plugin-server.authresultdata.state.md) | <code>Record<string, unknown></code> | Data to associate with an incoming request. Any downstream plugin may get access to the data. |
|
||||
| [state](./kibana-plugin-server.authresultdata.state.md) | <code>Record<string, any></code> | Data to associate with an incoming request. Any downstream plugin may get access to the data. |
|
||||
|
||||
|
|
|
@ -9,5 +9,5 @@ Data to associate with an incoming request. Any downstream plugin may get access
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
state: Record<string, unknown>;
|
||||
state: Record<string, any>;
|
||||
```
|
||||
|
|
|
@ -9,5 +9,5 @@ Calls specified endpoint with provided clientParams on behalf of the Kibana inte
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
callAsInternalUser: (endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions | undefined) => Promise<any>;
|
||||
callAsInternalUser: (endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions | undefined) => Promise<any>;
|
||||
```
|
||||
|
|
|
@ -22,7 +22,7 @@ export declare class ClusterClient
|
|||
|
||||
| Property | Modifiers | Type | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| [callAsInternalUser](./kibana-plugin-server.clusterclient.callasinternaluser.md) | | <code>(endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions | undefined) => Promise<any></code> | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. |
|
||||
| [callAsInternalUser](./kibana-plugin-server.clusterclient.callasinternaluser.md) | | <code>(endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions | undefined) => Promise<any></code> | Calls specified endpoint with provided clientParams on behalf of the Kibana internal user. |
|
||||
|
||||
## Methods
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ Calls specified `endpoint` with provided `clientParams` on behalf of the user in
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
callAsCurrentUser(endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions): Promise<unknown>;
|
||||
callAsCurrentUser(endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions): Promise<unknown>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
@ -17,7 +17,7 @@ callAsCurrentUser(endpoint: string, clientParams?: Record<string, unknown>, opti
|
|||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| endpoint | <code>string</code> | String descriptor of the endpoint e.g. <code>cluster.getSettings</code> or <code>ping</code>. |
|
||||
| clientParams | <code>Record<string, unknown></code> | A dictionary of parameters that will be passed directly to the Elasticsearch JS client. |
|
||||
| clientParams | <code>Record<string, any></code> | A dictionary of parameters that will be passed directly to the Elasticsearch JS client. |
|
||||
| options | <code>CallAPIOptions</code> | Options that affect the way we call the API and process the result. |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
|
|
@ -9,7 +9,7 @@ Calls specified `endpoint` with provided `clientParams` on behalf of the Kibana
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
callAsInternalUser(endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions): Promise<unknown>;
|
||||
callAsInternalUser(endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions): Promise<unknown>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
@ -17,7 +17,7 @@ callAsInternalUser(endpoint: string, clientParams?: Record<string, unknown>, opt
|
|||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| endpoint | <code>string</code> | String descriptor of the endpoint e.g. <code>cluster.getSettings</code> or <code>ping</code>. |
|
||||
| clientParams | <code>Record<string, unknown></code> | A dictionary of parameters that will be passed directly to the Elasticsearch JS client. |
|
||||
| clientParams | <code>Record<string, any></code> | A dictionary of parameters that will be passed directly to the Elasticsearch JS client. |
|
||||
| options | <code>CallAPIOptions</code> | Options that affect the way we call the API and process the result. |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
|
|
@ -70,7 +70,7 @@ export interface CallAPIOptions {
|
|||
async function callAPI(
|
||||
client: Client,
|
||||
endpoint: string,
|
||||
clientParams: Record<string, unknown> = {},
|
||||
clientParams: Record<string, any> = {},
|
||||
options: CallAPIOptions = { wrap401Errors: true }
|
||||
): Promise<any> {
|
||||
const clientPath = endpoint.split('.');
|
||||
|
@ -150,7 +150,7 @@ export class ClusterClient {
|
|||
*/
|
||||
public callAsInternalUser = async (
|
||||
endpoint: string,
|
||||
clientParams: Record<string, unknown> = {},
|
||||
clientParams: Record<string, any> = {},
|
||||
options?: CallAPIOptions
|
||||
) => {
|
||||
this.assertIsNotClosed();
|
||||
|
@ -216,7 +216,7 @@ export class ClusterClient {
|
|||
*/
|
||||
private callAsCurrentUser = async (
|
||||
endpoint: string,
|
||||
clientParams: Record<string, unknown> = {},
|
||||
clientParams: Record<string, any> = {},
|
||||
options?: CallAPIOptions
|
||||
) => {
|
||||
this.assertIsNotClosed();
|
||||
|
|
|
@ -27,7 +27,7 @@ export { Headers };
|
|||
/** @public */
|
||||
export type APICaller = (
|
||||
endpoint: string,
|
||||
clientParams: Record<string, unknown>,
|
||||
clientParams: Record<string, any>,
|
||||
options?: CallAPIOptions
|
||||
) => Promise<unknown>;
|
||||
|
||||
|
@ -58,7 +58,7 @@ export class ScopedClusterClient {
|
|||
*/
|
||||
public callAsInternalUser(
|
||||
endpoint: string,
|
||||
clientParams: Record<string, unknown> = {},
|
||||
clientParams: Record<string, any> = {},
|
||||
options?: CallAPIOptions
|
||||
) {
|
||||
return this.internalAPICaller(endpoint, clientParams, options);
|
||||
|
@ -73,7 +73,7 @@ export class ScopedClusterClient {
|
|||
*/
|
||||
public callAsCurrentUser(
|
||||
endpoint: string,
|
||||
clientParams: Record<string, unknown> = {},
|
||||
clientParams: Record<string, any> = {},
|
||||
options?: CallAPIOptions
|
||||
) {
|
||||
const defaultHeaders = this.headers;
|
||||
|
|
|
@ -27,9 +27,9 @@ import { KibanaRequest, RouteMethod } from './router';
|
|||
|
||||
interface RequestFixtureOptions {
|
||||
headers?: Record<string, string>;
|
||||
params?: Record<string, unknown>;
|
||||
body?: Record<string, unknown>;
|
||||
query?: Record<string, unknown>;
|
||||
params?: Record<string, any>;
|
||||
body?: Record<string, any>;
|
||||
query?: Record<string, any>;
|
||||
path?: string;
|
||||
method?: RouteMethod;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ export interface AuthResultData {
|
|||
/**
|
||||
* Data to associate with an incoming request. Any downstream plugin may get access to the data.
|
||||
*/
|
||||
state: Record<string, unknown>;
|
||||
state: Record<string, any>;
|
||||
/**
|
||||
* Auth specific headers to authenticate a user against Elasticsearch.
|
||||
*/
|
||||
|
|
|
@ -21,7 +21,7 @@ import { TypeOf } from '@kbn/config-schema';
|
|||
import { Url } from 'url';
|
||||
|
||||
// @public (undocumented)
|
||||
export type APICaller = (endpoint: string, clientParams: Record<string, unknown>, options?: CallAPIOptions) => Promise<unknown>;
|
||||
export type APICaller = (endpoint: string, clientParams: Record<string, any>, options?: CallAPIOptions) => Promise<unknown>;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "AuthResult" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
|
@ -34,7 +34,7 @@ export type AuthHeaders = Record<string, string>;
|
|||
// @public
|
||||
export interface AuthResultData {
|
||||
headers: AuthHeaders;
|
||||
state: Record<string, unknown>;
|
||||
state: Record<string, any>;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
@ -61,7 +61,7 @@ export interface CallAPIOptions {
|
|||
export class ClusterClient {
|
||||
constructor(config: ElasticsearchClientConfig, log: Logger, getAuthHeaders?: GetAuthHeaders);
|
||||
asScoped(request?: KibanaRequest | LegacyRequest | FakeRequest): ScopedClusterClient;
|
||||
callAsInternalUser: (endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions | undefined) => Promise<any>;
|
||||
callAsInternalUser: (endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions | undefined) => Promise<any>;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
|
@ -670,8 +670,8 @@ export interface SavedObjectsUpdateResponse<T extends SavedObjectAttributes = an
|
|||
// @public
|
||||
export class ScopedClusterClient {
|
||||
constructor(internalAPICaller: APICaller, scopedAPICaller: APICaller, headers?: Record<string, string | string[] | undefined> | undefined);
|
||||
callAsCurrentUser(endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions): Promise<unknown>;
|
||||
callAsInternalUser(endpoint: string, clientParams?: Record<string, unknown>, options?: CallAPIOptions): Promise<unknown>;
|
||||
callAsCurrentUser(endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions): Promise<unknown>;
|
||||
callAsInternalUser(endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions): Promise<unknown>;
|
||||
}
|
||||
|
||||
// @public
|
||||
|
|
|
@ -106,7 +106,7 @@ export async function setupAuthentication({
|
|||
|
||||
if (authenticationResult.succeeded()) {
|
||||
return t.authenticated({
|
||||
state: (authenticationResult.user as unknown) as Record<string, unknown>,
|
||||
state: authenticationResult.user,
|
||||
headers: authenticationResult.authHeaders,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue