Skip to content

Commit 983bc52

Browse files
committed
Review nits
1 parent becf2bb commit 983bc52

15 files changed

+173
-181
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2-
3-
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [get](./kibana-plugin-server.basepath.get.md)
4-
5-
## BasePath.get property
6-
7-
returns `basePath` value, specific for an incoming request.
8-
9-
<b>Signature:</b>
10-
11-
```typescript
12-
(request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest) => string;
13-
```
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [get](./kibana-plugin-server.basepath.get.md)
4+
5+
## BasePath.get property
6+
7+
returns `basePath` value, specific for an incoming request.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
get: (request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest) => string;
13+
```
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2-
3-
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [set](./kibana-plugin-server.basepath.set.md)
4-
5-
## BasePath.set property
6-
7-
sets `basePath` value, specific for an incoming request.
8-
9-
<b>Signature:</b>
10-
11-
```typescript
12-
(request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest, requestSpecificBasePath: string) => void;
13-
```
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [BasePath](./kibana-plugin-server.basepath.md) &gt; [set](./kibana-plugin-server.basepath.set.md)
4+
5+
## BasePath.set property
6+
7+
sets `basePath` value, specific for an incoming request.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
set: (request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest, requestSpecificBasePath: string) => void;
13+
```

docs/development/core/server/kibana-plugin-server.irenderoptions.includeusersettings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## IRenderOptions.includeUserSettings property
66

7-
Set whether to output user settings in the page metadata.
7+
Set whether to output user settings in the page metadata. `true` by default.
88

99
<b>Signature:</b>
1010

docs/development/core/server/kibana-plugin-server.irenderoptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export interface IRenderOptions
1515

1616
| Property | Type | Description |
1717
| --- | --- | --- |
18-
| [includeUserSettings](./kibana-plugin-server.irenderoptions.includeusersettings.md) | <code>boolean</code> | Set whether to output user settings in the page metadata. |
18+
| [includeUserSettings](./kibana-plugin-server.irenderoptions.includeusersettings.md) | <code>boolean</code> | Set whether to output user settings in the page metadata. <code>true</code> by default. |
1919

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2-
3-
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [IRouter](./kibana-plugin-server.irouter.md) &gt; [handleLegacyErrors](./kibana-plugin-server.irouter.handlelegacyerrors.md)
4-
5-
## IRouter.handleLegacyErrors property
6-
7-
Wrap a router handler to catch and converts legacy boom errors to proper custom errors.
8-
9-
<b>Signature:</b>
10-
11-
```typescript
12-
<P, Q, B>(handler: RequestHandler<P, Q, B>) => RequestHandler<P, Q, B>;
13-
```
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [IRouter](./kibana-plugin-server.irouter.md) &gt; [handleLegacyErrors](./kibana-plugin-server.irouter.handlelegacyerrors.md)
4+
5+
## IRouter.handleLegacyErrors property
6+
7+
Wrap a router handler to catch and converts legacy boom errors to proper custom errors.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
handleLegacyErrors: <P, Q, B>(handler: RequestHandler<P, Q, B>) => RequestHandler<P, Q, B>;
13+
```
Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2-
3-
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteConfig](./kibana-plugin-server.routeconfig.md) &gt; [validate](./kibana-plugin-server.routeconfig.validate.md)
4-
5-
## RouteConfig.validate property
6-
7-
A schema created with `@kbn/config-schema` that every request will be validated against.
8-
9-
<b>Signature:</b>
10-
11-
```typescript
12-
RouteValidatorFullConfig<P, Q, B> | false;
13-
```
14-
15-
## Remarks
16-
17-
You \*must\* specify a validation schema to be able to read: - url path segments - request query - request body To opt out of validating the request, specify `validate: false`<!-- -->. In this case request params, query, and body will be \*\*empty\*\* objects and have no access to raw values. In some cases you may want to use another validation library. To do this, you need to instruct the `@kbn/config-schema` library to output \*\*non-validated values\*\* with setting schema as `schema.object({}, { allowUnknowns: true })`<!-- -->;
18-
19-
## Example
20-
21-
22-
```ts
23-
import { schema } from '@kbn/config-schema';
24-
router.get({
25-
path: 'path/{id}',
26-
validate: {
27-
params: schema.object({
28-
id: schema.string(),
29-
}),
30-
query: schema.object({...}),
31-
body: schema.object({...}),
32-
},
33-
},
34-
(context, req, res,) {
35-
req.params; // type Readonly<{id: string}>
36-
console.log(req.params.id); // value
37-
});
38-
39-
router.get({
40-
path: 'path/{id}',
41-
validate: false, // handler has no access to params, query, body values.
42-
},
43-
(context, req, res,) {
44-
req.params; // type Readonly<{}>;
45-
console.log(req.params.id); // undefined
46-
});
47-
48-
router.get({
49-
path: 'path/{id}',
50-
validate: {
51-
// handler has access to raw non-validated params in runtime
52-
params: schema.object({}, { allowUnknowns: true })
53-
},
54-
},
55-
(context, req, res,) {
56-
req.params; // type Readonly<{}>;
57-
console.log(req.params.id); // value
58-
myValidationLibrary.validate({ params: req.params });
59-
});
60-
61-
```
62-
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteConfig](./kibana-plugin-server.routeconfig.md) &gt; [validate](./kibana-plugin-server.routeconfig.validate.md)
4+
5+
## RouteConfig.validate property
6+
7+
A schema created with `@kbn/config-schema` that every request will be validated against.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
validate: RouteValidatorFullConfig<P, Q, B> | false;
13+
```
14+
15+
## Remarks
16+
17+
You \*must\* specify a validation schema to be able to read: - url path segments - request query - request body To opt out of validating the request, specify `validate: false`<!-- -->. In this case request params, query, and body will be \*\*empty\*\* objects and have no access to raw values. In some cases you may want to use another validation library. To do this, you need to instruct the `@kbn/config-schema` library to output \*\*non-validated values\*\* with setting schema as `schema.object({}, { allowUnknowns: true })`<!-- -->;
18+
19+
## Example
20+
21+
22+
```ts
23+
import { schema } from '@kbn/config-schema';
24+
router.get({
25+
path: 'path/{id}',
26+
validate: {
27+
params: schema.object({
28+
id: schema.string(),
29+
}),
30+
query: schema.object({...}),
31+
body: schema.object({...}),
32+
},
33+
},
34+
(context, req, res,) {
35+
req.params; // type Readonly<{id: string}>
36+
console.log(req.params.id); // value
37+
});
38+
39+
router.get({
40+
path: 'path/{id}',
41+
validate: false, // handler has no access to params, query, body values.
42+
},
43+
(context, req, res,) {
44+
req.params; // type Readonly<{}>;
45+
console.log(req.params.id); // undefined
46+
});
47+
48+
router.get({
49+
path: 'path/{id}',
50+
validate: {
51+
// handler has access to raw non-validated params in runtime
52+
params: schema.object({}, { allowUnknowns: true })
53+
},
54+
},
55+
(context, req, res,) {
56+
req.params; // type Readonly<{}>;
57+
console.log(req.params.id); // value
58+
myValidationLibrary.validate({ params: req.params });
59+
});
60+
61+
```
62+
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2-
3-
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteValidationError](./kibana-plugin-server.routevalidationerror.md) &gt; [(constructor)](./kibana-plugin-server.routevalidationerror._constructor_.md)
4-
5-
## RouteValidationError.(constructor)
6-
7-
Constructs a new instance of the `RouteValidationError` class
8-
9-
<b>Signature:</b>
10-
11-
```typescript
12-
constructor(error;: Error | string, path?: string[];)
13-
```
14-
15-
## Parameters
16-
17-
| Parameter | Type | Description |
18-
| --- | --- | --- |
19-
| error | <code>Error &#124; string</code> | |
20-
| path | <code>string[]</code> | |
21-
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteValidationError](./kibana-plugin-server.routevalidationerror.md) &gt; [(constructor)](./kibana-plugin-server.routevalidationerror._constructor_.md)
4+
5+
## RouteValidationError.(constructor)
6+
7+
Constructs a new instance of the `RouteValidationError` class
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
constructor(error: Error | string, path?: string[]);
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| error | <code>Error &#124; string</code> | |
20+
| path | <code>string[]</code> | |
21+
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2-
3-
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteValidationResultFactory](./kibana-plugin-server.routevalidationresultfactory.md) &gt; [badRequest](./kibana-plugin-server.routevalidationresultfactory.badrequest.md)
4-
5-
## RouteValidationResultFactory.badRequest property
6-
7-
<b>Signature:</b>
8-
9-
```typescript
10-
(error: Error | string, path?: string[]) => {
11-
RouteValidationError;
12-
};
13-
```
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteValidationResultFactory](./kibana-plugin-server.routevalidationresultfactory.md) &gt; [badRequest](./kibana-plugin-server.routevalidationresultfactory.badrequest.md)
4+
5+
## RouteValidationResultFactory.badRequest property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
badRequest: (error: Error | string, path?: string[]) => {
11+
error: RouteValidationError;
12+
};
13+
```
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2-
3-
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteValidationResultFactory](./kibana-plugin-server.routevalidationresultfactory.md) &gt; [ok](./kibana-plugin-server.routevalidationresultfactory.ok.md)
4-
5-
## RouteValidationResultFactory.ok property
6-
7-
<b>Signature:</b>
8-
9-
```typescript
10-
<T>(value: T) => {
11-
T;
12-
};
13-
```
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteValidationResultFactory](./kibana-plugin-server.routevalidationresultfactory.md) &gt; [ok](./kibana-plugin-server.routevalidationresultfactory.ok.md)
4+
5+
## RouteValidationResultFactory.ok property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
ok: <T>(value: T) => {
11+
value: T;
12+
};
13+
```
Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2-
3-
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteValidatorOptions](./kibana-plugin-server.routevalidatoroptions.md) &gt; [unsafe](./kibana-plugin-server.routevalidatoroptions.unsafe.md)
4-
5-
## RouteValidatorOptions.unsafe property
6-
7-
Set the `unsafe` config to avoid running some additional internal \*safe\* validations on top of your custom validation
8-
9-
<b>Signature:</b>
10-
11-
```typescript
12-
unsafe?: {
13-
params?: boolean;
14-
query?: boolean;
15-
body?: boolean;
16-
}
17-
18-
```
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [RouteValidatorOptions](./kibana-plugin-server.routevalidatoroptions.md) &gt; [unsafe](./kibana-plugin-server.routevalidatoroptions.unsafe.md)
4+
5+
## RouteValidatorOptions.unsafe property
6+
7+
Set the `unsafe` config to avoid running some additional internal \*safe\* validations on top of your custom validation
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
unsafe?: {
13+
params?: boolean;
14+
query?: boolean;
15+
body?: boolean;
16+
};
17+
```

0 commit comments

Comments
 (0)