Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into security/user…
Browse files Browse the repository at this point in the history
…name-encoding
  • Loading branch information
legrego committed Oct 26, 2020
2 parents 42adf7c + 68b9823 commit adbcbbb
Show file tree
Hide file tree
Showing 103 changed files with 618 additions and 511 deletions.
5 changes: 5 additions & 0 deletions .telemetryrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
"src/plugins/testbed/",
"src/plugins/kibana_utils/"
]
},
{
"output": "src/plugins/telemetry/schema/legacy_plugins.json",
"root": "src/legacy/server/",
"exclude": []
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Constructs a new instance of the `Execution` class
<b>Signature:</b>

```typescript
constructor(params: ExecutionParams<ExtraContext>);
constructor(execution: ExecutionParams);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| params | <code>ExecutionParams&lt;ExtraContext&gt;</code> | |
| execution | <code>ExecutionParams</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Execution context - object that allows to do side-effects. Context is passed to
<b>Signature:</b>

```typescript
readonly context: ExecutionContext<Input, InspectorAdapters> & ExtraContext;
readonly context: ExecutionContext<InspectorAdapters>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Contract is a public representation of `Execution` instances. Contract we can re
<b>Signature:</b>

```typescript
readonly contract: ExecutionContract<ExtraContext, Input, Output, InspectorAdapters>;
readonly contract: ExecutionContract<Input, Output, InspectorAdapters>;
```
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [Execution](./kibana-plugin-plugins-expressions-public.execution.md) &gt; [params](./kibana-plugin-plugins-expressions-public.execution.params.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [Execution](./kibana-plugin-plugins-expressions-public.execution.md) &gt; [execution](./kibana-plugin-plugins-expressions-public.execution.execution.md)

## Execution.params property
## Execution.execution property

<b>Signature:</b>

```typescript
readonly params: ExecutionParams<ExtraContext>;
readonly execution: ExecutionParams;
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b>Signature:</b>

```typescript
interpret<T>(ast: ExpressionAstNode, input: T, options?: ExpressionExecOptions): Promise<unknown>;
interpret<T>(ast: ExpressionAstNode, input: T): Promise<unknown>;
```

## Parameters
Expand All @@ -16,7 +16,6 @@ interpret<T>(ast: ExpressionAstNode, input: T, options?: ExpressionExecOptions):
| --- | --- | --- |
| ast | <code>ExpressionAstNode</code> | |
| input | <code>T</code> | |
| options | <code>ExpressionExecOptions</code> | |

<b>Returns:</b>

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

```typescript
export declare class Execution<ExtraContext extends Record<string, unknown> = Record<string, unknown>, Input = unknown, Output = unknown, InspectorAdapters extends Adapters = ExtraContext['inspectorAdapters'] extends object ? ExtraContext['inspectorAdapters'] : DefaultInspectorAdapters>
export declare class Execution<Input = unknown, Output = unknown, InspectorAdapters extends Adapters = ExpressionExecutionParams['inspectorAdapters'] extends object ? ExpressionExecutionParams['inspectorAdapters'] : DefaultInspectorAdapters>
```

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(params)](./kibana-plugin-plugins-expressions-public.execution._constructor_.md) | | Constructs a new instance of the <code>Execution</code> class |
| [(constructor)(execution)](./kibana-plugin-plugins-expressions-public.execution._constructor_.md) | | Constructs a new instance of the <code>Execution</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [context](./kibana-plugin-plugins-expressions-public.execution.context.md) | | <code>ExecutionContext&lt;Input, InspectorAdapters&gt; &amp; ExtraContext</code> | Execution context - object that allows to do side-effects. Context is passed to every function. |
| [contract](./kibana-plugin-plugins-expressions-public.execution.contract.md) | | <code>ExecutionContract&lt;ExtraContext, Input, Output, InspectorAdapters&gt;</code> | Contract is a public representation of <code>Execution</code> instances. Contract we can return to other plugins for their consumption. |
| [context](./kibana-plugin-plugins-expressions-public.execution.context.md) | | <code>ExecutionContext&lt;InspectorAdapters&gt;</code> | Execution context - object that allows to do side-effects. Context is passed to every function. |
| [contract](./kibana-plugin-plugins-expressions-public.execution.contract.md) | | <code>ExecutionContract&lt;Input, Output, InspectorAdapters&gt;</code> | Contract is a public representation of <code>Execution</code> instances. Contract we can return to other plugins for their consumption. |
| [execution](./kibana-plugin-plugins-expressions-public.execution.execution.md) | | <code>ExecutionParams</code> | |
| [expression](./kibana-plugin-plugins-expressions-public.execution.expression.md) | | <code>string</code> | |
| [input](./kibana-plugin-plugins-expressions-public.execution.input.md) | | <code>Input</code> | Initial input of the execution.<!-- -->N.B. It is initialized to <code>null</code> rather than <code>undefined</code> for legacy reasons, because in legacy interpreter it was set to <code>null</code> by default. |
| [inspectorAdapters](./kibana-plugin-plugins-expressions-public.execution.inspectoradapters.md) | | <code>InspectorAdapters</code> | |
| [params](./kibana-plugin-plugins-expressions-public.execution.params.md) | | <code>ExecutionParams&lt;ExtraContext&gt;</code> | |
| [result](./kibana-plugin-plugins-expressions-public.execution.result.md) | | <code>Promise&lt;Output &#124; ExpressionValueError&gt;</code> | |
| [state](./kibana-plugin-plugins-expressions-public.execution.state.md) | | <code>ExecutionContainer&lt;Output &#124; ExpressionValueError&gt;</code> | Dynamic state of the execution. |

Expand All @@ -35,7 +35,7 @@ export declare class Execution<ExtraContext extends Record<string, unknown> = Re
| --- | --- | --- |
| [cancel()](./kibana-plugin-plugins-expressions-public.execution.cancel.md) | | Stop execution of expression. |
| [cast(value, toTypeNames)](./kibana-plugin-plugins-expressions-public.execution.cast.md) | | |
| [interpret(ast, input, options)](./kibana-plugin-plugins-expressions-public.execution.interpret.md) | | |
| [interpret(ast, input)](./kibana-plugin-plugins-expressions-public.execution.interpret.md) | | |
| [invokeChain(chainArr, input)](./kibana-plugin-plugins-expressions-public.execution.invokechain.md) | | |
| [invokeFunction(fn, input, args)](./kibana-plugin-plugins-expressions-public.execution.invokefunction.md) | | |
| [resolveArgs(fnDef, input, argAsts)](./kibana-plugin-plugins-expressions-public.execution.resolveargs.md) | | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExecutionContext](./kibana-plugin-plugins-expressions-public.executioncontext.md) &gt; [getInitialInput](./kibana-plugin-plugins-expressions-public.executioncontext.getinitialinput.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExecutionContext](./kibana-plugin-plugins-expressions-public.executioncontext.md) &gt; [getSearchContext](./kibana-plugin-plugins-expressions-public.executioncontext.getsearchcontext.md)

## ExecutionContext.getInitialInput property
## ExecutionContext.getSearchContext property

Get initial input with which execution started.
Get search context of the expression.

<b>Signature:</b>

```typescript
getInitialInput: () => Input;
getSearchContext: () => ExecutionContextSearch;
```
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExecutionContext](./kibana-plugin-plugins-expressions-public.executioncontext.md) &gt; [search](./kibana-plugin-plugins-expressions-public.executioncontext.search.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExecutionContext](./kibana-plugin-plugins-expressions-public.executioncontext.md) &gt; [getSearchSessionId](./kibana-plugin-plugins-expressions-public.executioncontext.getsearchsessionid.md)

## ExecutionContext.search property
## ExecutionContext.getSearchSessionId property

Search context in which expression should operate.

<b>Signature:</b>

```typescript
search?: ExecutionContextSearch;
getSearchSessionId: () => string | undefined;
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
<b>Signature:</b>

```typescript
export interface ExecutionContext<Input = unknown, InspectorAdapters extends Adapters = Adapters>
export interface ExecutionContext<InspectorAdapters extends Adapters = Adapters>
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [abortSignal](./kibana-plugin-plugins-expressions-public.executioncontext.abortsignal.md) | <code>AbortSignal</code> | Adds ability to abort current execution. |
| [getInitialInput](./kibana-plugin-plugins-expressions-public.executioncontext.getinitialinput.md) | <code>() =&gt; Input</code> | Get initial input with which execution started. |
| [getSavedObject](./kibana-plugin-plugins-expressions-public.executioncontext.getsavedobject.md) | <code>&lt;T extends SavedObjectAttributes = SavedObjectAttributes&gt;(type: string, id: string) =&gt; Promise&lt;SavedObject&lt;T&gt;&gt;</code> | Allows to fetch saved objects from ElasticSearch. In browser <code>getSavedObject</code> function is provided automatically by the Expressions plugin. On the server the caller of the expression has to provide this context function. The reason is because on the browser we always know the user who tries to fetch a saved object, thus saved object client is scoped automatically to that user. However, on the server we can scope that saved object client to any user, or even not scope it at all and execute it as an "internal" user. |
| [getSearchContext](./kibana-plugin-plugins-expressions-public.executioncontext.getsearchcontext.md) | <code>() =&gt; ExecutionContextSearch</code> | Get search context of the expression. |
| [getSearchSessionId](./kibana-plugin-plugins-expressions-public.executioncontext.getsearchsessionid.md) | <code>() =&gt; string &#124; undefined</code> | Search context in which expression should operate. |
| [inspectorAdapters](./kibana-plugin-plugins-expressions-public.executioncontext.inspectoradapters.md) | <code>InspectorAdapters</code> | Adapters for <code>inspector</code> plugin. |
| [search](./kibana-plugin-plugins-expressions-public.executioncontext.search.md) | <code>ExecutionContextSearch</code> | Search context in which expression should operate. |
| [types](./kibana-plugin-plugins-expressions-public.executioncontext.types.md) | <code>Record&lt;string, ExpressionType&gt;</code> | A map of available expression types. |
| [variables](./kibana-plugin-plugins-expressions-public.executioncontext.variables.md) | <code>Record&lt;string, unknown&gt;</code> | Context variables that can be consumed using <code>var</code> and <code>var_set</code> functions. |

Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Constructs a new instance of the `ExecutionContract` class
<b>Signature:</b>

```typescript
constructor(execution: Execution<ExtraContext, Input, Output, InspectorAdapters>);
constructor(execution: Execution<Input, Output, InspectorAdapters>);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| execution | <code>Execution&lt;ExtraContext, Input, Output, InspectorAdapters&gt;</code> | |
| execution | <code>Execution&lt;Input, Output, InspectorAdapters&gt;</code> | |

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

```typescript
protected readonly execution: Execution<ExtraContext, Input, Output, InspectorAdapters>;
protected readonly execution: Execution<Input, Output, InspectorAdapters>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<b>Signature:</b>

```typescript
export declare class ExecutionContract<ExtraContext extends Record<string, unknown> = Record<string, unknown>, Input = unknown, Output = unknown, InspectorAdapters = unknown>
export declare class ExecutionContract<Input = unknown, Output = unknown, InspectorAdapters = unknown>
```

## Constructors
Expand All @@ -23,7 +23,7 @@ export declare class ExecutionContract<ExtraContext extends Record<string, unkno
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [cancel](./kibana-plugin-plugins-expressions-public.executioncontract.cancel.md) | | <code>() =&gt; void</code> | Cancel the execution of the expression. This will set abort signal (available in execution context) to aborted state, letting expression functions to stop their execution. |
| [execution](./kibana-plugin-plugins-expressions-public.executioncontract.execution.md) | | <code>Execution&lt;ExtraContext, Input, Output, InspectorAdapters&gt;</code> | |
| [execution](./kibana-plugin-plugins-expressions-public.executioncontract.execution.md) | | <code>Execution&lt;Input, Output, InspectorAdapters&gt;</code> | |
| [getAst](./kibana-plugin-plugins-expressions-public.executioncontract.getast.md) | | <code>() =&gt; ExpressionAstExpression</code> | Get AST used to execute the expression. |
| [getData](./kibana-plugin-plugins-expressions-public.executioncontract.getdata.md) | | <code>() =&gt; Promise&lt;Output &#124; ExpressionValueError&gt;</code> | Returns the final output of expression, if any error happens still wraps that error into <code>ExpressionValueError</code> type and returns that. This function never throws. |
| [getExpression](./kibana-plugin-plugins-expressions-public.executioncontract.getexpression.md) | | <code>() =&gt; string</code> | Get string representation of the expression. Returns the original string if execution was started from a string. If execution was started from an AST this method returns a string generated from AST. |
Expand Down

This file was deleted.

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

```typescript
export interface ExecutionParams<ExtraContext extends Record<string, unknown> = Record<string, unknown>>
export interface ExecutionParams
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [ast](./kibana-plugin-plugins-expressions-public.executionparams.ast.md) | <code>ExpressionAstExpression</code> | |
| [context](./kibana-plugin-plugins-expressions-public.executionparams.context.md) | <code>ExtraContext</code> | |
| [debug](./kibana-plugin-plugins-expressions-public.executionparams.debug.md) | <code>boolean</code> | Whether to execute expression in \*debug mode\*. In \*debug mode\* inputs and outputs as well as all resolved arguments and time it took to execute each function are saved and are available for introspection. |
| [executor](./kibana-plugin-plugins-expressions-public.executionparams.executor.md) | <code>Executor&lt;any&gt;</code> | |
| [expression](./kibana-plugin-plugins-expressions-public.executionparams.expression.md) | <code>string</code> | |
| [params](./kibana-plugin-plugins-expressions-public.executionparams.params.md) | <code>ExpressionExecutionParams</code> | |

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

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExecutionParams](./kibana-plugin-plugins-expressions-public.executionparams.md) &gt; [context](./kibana-plugin-plugins-expressions-public.executionparams.context.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [ExecutionParams](./kibana-plugin-plugins-expressions-public.executionparams.md) &gt; [params](./kibana-plugin-plugins-expressions-public.executionparams.params.md)

## ExecutionParams.context property
## ExecutionParams.params property

<b>Signature:</b>

```typescript
context?: ExtraContext;
params: ExpressionExecutionParams;
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@
<b>Signature:</b>

```typescript
createExecution<ExtraContext extends Record<string, unknown> = Record<string, unknown>, Input = unknown, Output = unknown>(ast: string | ExpressionAstExpression, context?: ExtraContext, { debug }?: ExpressionExecOptions): Execution<Context & ExtraContext, Input, Output>;
createExecution<Input = unknown, Output = unknown>(ast: string | ExpressionAstExpression, params?: ExpressionExecutionParams): Execution<Input, Output>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ast | <code>string &#124; ExpressionAstExpression</code> | |
| context | <code>ExtraContext</code> | |
| { debug } | <code>ExpressionExecOptions</code> | |
| params | <code>ExpressionExecutionParams</code> | |
<b>Returns:</b>
`Execution<Context & ExtraContext, Input, Output>`
`Execution<Input, Output>`
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export declare class Executor<Context extends Record<string, unknown> = Record<s
| Method | Modifiers | Description |
| --- | --- | --- |
| [createExecution(ast, context, { debug })](./kibana-plugin-plugins-expressions-public.executor.createexecution.md) | | |
| [createExecution(ast, params)](./kibana-plugin-plugins-expressions-public.executor.createexecution.md) | | |
| [createWithDefaults(state)](./kibana-plugin-plugins-expressions-public.executor.createwithdefaults.md) | <code>static</code> | |
| [extendContext(extraContext)](./kibana-plugin-plugins-expressions-public.executor.extendcontext.md) | | |
| [extract(ast)](./kibana-plugin-plugins-expressions-public.executor.extract.md) | | |
Expand All @@ -41,6 +41,6 @@ export declare class Executor<Context extends Record<string, unknown> = Record<s
| [inject(ast, references)](./kibana-plugin-plugins-expressions-public.executor.inject.md) | | |
| [registerFunction(functionDefinition)](./kibana-plugin-plugins-expressions-public.executor.registerfunction.md) | | |
| [registerType(typeDefinition)](./kibana-plugin-plugins-expressions-public.executor.registertype.md) | | |
| [run(ast, input, context, options)](./kibana-plugin-plugins-expressions-public.executor.run.md) | | Execute expression and return result. |
| [run(ast, input, params)](./kibana-plugin-plugins-expressions-public.executor.run.md) | | Execute expression and return result. |
| [telemetry(ast, telemetryData)](./kibana-plugin-plugins-expressions-public.executor.telemetry.md) | | |
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Execute expression and return result.
<b>Signature:</b>

```typescript
run<Input, Output, ExtraContext extends Record<string, unknown> = Record<string, unknown>>(ast: string | ExpressionAstExpression, input: Input, context?: ExtraContext, options?: ExpressionExecOptions): Promise<Output>;
run<Input, Output>(ast: string | ExpressionAstExpression, input: Input, params?: ExpressionExecutionParams): Promise<Output>;
```

## Parameters
Expand All @@ -18,8 +18,7 @@ run<Input, Output, ExtraContext extends Record<string, unknown> = Record<string,
| --- | --- | --- |
| ast | <code>string &#124; ExpressionAstExpression</code> | |
| input | <code>Input</code> | |
| context | <code>ExtraContext</code> | |
| options | <code>ExpressionExecOptions</code> | |
| params | <code>ExpressionExecutionParams</code> | |

<b>Returns:</b>

Expand Down
Loading

0 comments on commit adbcbbb

Please sign in to comment.