koatty 3.5.11 → 3.5.12-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.commitlintrc.js +3 -0
- package/.eslintignore +2 -0
- package/.huskyrc +5 -0
- package/.versionrc.js +16 -0
- package/CHANGELOG.md +1 -38
- package/README.md +4 -7
- package/api-extractor.json +345 -0
- package/dist/LICENSE +29 -0
- package/dist/README.md +147 -0
- package/dist/index.d.ts +363 -19
- package/dist/index.js +1266 -26
- package/dist/index.mjs +1197 -0
- package/dist/package.json +99 -0
- package/docs/api/index.md +12 -0
- package/docs/api/koatty.apiinput.code.md +11 -0
- package/docs/api/koatty.apiinput.data.md +11 -0
- package/docs/api/koatty.apiinput.md +22 -0
- package/docs/api/koatty.apiinput.message.md +11 -0
- package/docs/api/koatty.apioutput.code.md +11 -0
- package/docs/api/koatty.apioutput.data.md +11 -0
- package/docs/api/koatty.apioutput.md +22 -0
- package/docs/api/koatty.apioutput.message.md +11 -0
- package/docs/api/koatty.appreadyhookfunc.md +11 -0
- package/docs/api/koatty.basecontroller._constructor_.md +20 -0
- package/docs/api/koatty.basecontroller._options.md +11 -0
- package/docs/api/koatty.basecontroller.app.md +11 -0
- package/docs/api/koatty.basecontroller.ctx.md +11 -0
- package/docs/api/koatty.basecontroller.fail.md +28 -0
- package/docs/api/koatty.basecontroller.init.md +19 -0
- package/docs/api/koatty.basecontroller.md +39 -0
- package/docs/api/koatty.basecontroller.ok.md +28 -0
- package/docs/api/koatty.baseservice._constructor_.md +20 -0
- package/docs/api/koatty.baseservice._options.md +11 -0
- package/docs/api/koatty.baseservice.app.md +11 -0
- package/docs/api/koatty.baseservice.init.md +25 -0
- package/docs/api/koatty.baseservice.md +36 -0
- package/docs/api/koatty.bindappreadyhook.md +26 -0
- package/docs/api/koatty.bootstrap.md +27 -0
- package/docs/api/koatty.component.md +27 -0
- package/docs/api/koatty.componentscan.md +27 -0
- package/docs/api/koatty.configurationscan.md +27 -0
- package/docs/api/koatty.controller.md +27 -0
- package/docs/api/koatty.httpcontroller.body.md +28 -0
- package/docs/api/koatty.httpcontroller.deny.md +26 -0
- package/docs/api/koatty.httpcontroller.expires.md +26 -0
- package/docs/api/koatty.httpcontroller.fail.md +28 -0
- package/docs/api/koatty.httpcontroller.header.md +27 -0
- package/docs/api/koatty.httpcontroller.isget.md +19 -0
- package/docs/api/koatty.httpcontroller.ismethod.md +26 -0
- package/docs/api/koatty.httpcontroller.ispost.md +19 -0
- package/docs/api/koatty.httpcontroller.json.md +26 -0
- package/docs/api/koatty.httpcontroller.md +35 -0
- package/docs/api/koatty.httpcontroller.ok.md +28 -0
- package/docs/api/koatty.httpcontroller.param.md +26 -0
- package/docs/api/koatty.httpcontroller.redirect.md +27 -0
- package/docs/api/koatty.httpcontroller.type.md +27 -0
- package/docs/api/koatty.icontroller.__after.md +11 -0
- package/docs/api/koatty.icontroller.__befor.md +11 -0
- package/docs/api/koatty.icontroller.app.md +11 -0
- package/docs/api/koatty.icontroller.ctx.md +11 -0
- package/docs/api/koatty.icontroller.fail.md +11 -0
- package/docs/api/koatty.icontroller.md +25 -0
- package/docs/api/koatty.icontroller.ok.md +11 -0
- package/docs/api/koatty.imiddleware.md +20 -0
- package/docs/api/koatty.imiddleware.run.md +11 -0
- package/docs/api/koatty.iplugin.md +20 -0
- package/docs/api/koatty.iplugin.run.md +11 -0
- package/docs/api/koatty.iservice.app.md +11 -0
- package/docs/api/koatty.iservice.md +20 -0
- package/docs/api/koatty.logger.md +11 -0
- package/docs/api/koatty.md +51 -0
- package/docs/api/koatty.middleware.md +27 -0
- package/docs/api/koatty.plugin.md +27 -0
- package/docs/api/koatty.service.md +27 -0
- package/jest.config.js +0 -2
- package/jest_html_reporters.html +1 -1
- package/package.json +37 -35
- package/rollup.config.js +63 -0
- package/scripts/copyright.js +28 -0
- package/scripts/postBuild.js +10 -0
- package/tsconfig.json +4 -2
- package/babel.config.js +0 -21
- package/commitlint.config.js +0 -14
- package/dist/config/config.d.ts +0 -18
- package/dist/config/config.js +0 -25
- package/dist/config/config.js.map +0 -1
- package/dist/config/middleware.d.ts +0 -28
- package/dist/config/middleware.js +0 -32
- package/dist/config/middleware.js.map +0 -1
- package/dist/config/plugin.d.ts +0 -11
- package/dist/config/plugin.js +0 -15
- package/dist/config/plugin.js.map +0 -1
- package/dist/config/router.d.ts +0 -8
- package/dist/config/router.js +0 -32
- package/dist/config/router.js.map +0 -1
- package/dist/controller/BaseController.d.ts +0 -60
- package/dist/controller/BaseController.js +0 -137
- package/dist/controller/BaseController.js.map +0 -1
- package/dist/controller/HttpController.d.ts +0 -131
- package/dist/controller/HttpController.js +0 -214
- package/dist/controller/HttpController.js.map +0 -1
- package/dist/core/Bootstrap.d.ts +0 -50
- package/dist/core/Bootstrap.js +0 -218
- package/dist/core/Bootstrap.js.map +0 -1
- package/dist/core/Component.d.ts +0 -94
- package/dist/core/Component.js +0 -89
- package/dist/core/Component.js.map +0 -1
- package/dist/core/Constants.d.ts +0 -11
- package/dist/core/Constants.js +0 -24
- package/dist/core/Constants.js.map +0 -1
- package/dist/core/Loader.d.ts +0 -110
- package/dist/core/Loader.js +0 -394
- package/dist/core/Loader.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/middleware/PayloadMiddleware.d.ts +0 -11
- package/dist/middleware/PayloadMiddleware.js +0 -22
- package/dist/middleware/PayloadMiddleware.js.map +0 -1
- package/dist/middleware/TraceMiddleware.d.ts +0 -11
- package/dist/middleware/TraceMiddleware.js +0 -22
- package/dist/middleware/TraceMiddleware.js.map +0 -1
- package/dist/service/BaseService.d.ts +0 -33
- package/dist/service/BaseService.js +0 -32
- package/dist/service/BaseService.js.map +0 -1
- package/dist/util/Helper.d.ts +0 -25
- package/dist/util/Helper.js +0 -117
- package/dist/util/Helper.js.map +0 -1
- package/dist/util/Logger.d.ts +0 -27
- package/dist/util/Logger.js +0 -41
- package/dist/util/Logger.js.map +0 -1
@@ -0,0 +1,27 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [Controller](./koatty.controller.md)
|
4
|
+
|
5
|
+
## Controller() function
|
6
|
+
|
7
|
+
Indicates that an decorated class is a "controller".
|
8
|
+
|
9
|
+
|
10
|
+
<b>Signature:</b>
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
export declare function Controller(path?: string): ClassDecorator;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| path | string | controller router path |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
ClassDecorator
|
25
|
+
|
26
|
+
{<!-- -->ClassDecorator<!-- -->}
|
27
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [body](./koatty.httpcontroller.body.md)
|
4
|
+
|
5
|
+
## HttpController.body() method
|
6
|
+
|
7
|
+
Set response Body content
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
body(data: any, contentType?: string, encoding?: string): Promise<any>;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| data | any | |
|
20
|
+
| contentType | string | |
|
21
|
+
| encoding | string | |
|
22
|
+
|
23
|
+
<b>Returns:</b>
|
24
|
+
|
25
|
+
Promise<any>
|
26
|
+
|
27
|
+
{<!-- -->Promise<any>} HttpController
|
28
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [deny](./koatty.httpcontroller.deny.md)
|
4
|
+
|
5
|
+
## HttpController.deny() method
|
6
|
+
|
7
|
+
Block access
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
deny(code?: number): Promise<any>;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| code | number | |
|
20
|
+
|
21
|
+
<b>Returns:</b>
|
22
|
+
|
23
|
+
Promise<any>
|
24
|
+
|
25
|
+
{<!-- -->Promise<any>} HttpController
|
26
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [expires](./koatty.httpcontroller.expires.md)
|
4
|
+
|
5
|
+
## HttpController.expires() method
|
6
|
+
|
7
|
+
set cache-control and expires header
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
expires(timeout?: number): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| timeout | number | |
|
20
|
+
|
21
|
+
<b>Returns:</b>
|
22
|
+
|
23
|
+
void
|
24
|
+
|
25
|
+
{<!-- -->void<!-- -->} HttpController
|
26
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [fail](./koatty.httpcontroller.fail.md)
|
4
|
+
|
5
|
+
## HttpController.fail() method
|
6
|
+
|
7
|
+
Response to normalize json format content for fail
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
fail(msg: Error | string | ApiInput, data?: any, code?: number): Promise<any>;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| msg | Error \| string \| [ApiInput](./koatty.apiinput.md) | |
|
20
|
+
| data | any | |
|
21
|
+
| code | number | |
|
22
|
+
|
23
|
+
<b>Returns:</b>
|
24
|
+
|
25
|
+
Promise<any>
|
26
|
+
|
27
|
+
{<!-- -->\*<!-- -->} HttpController
|
28
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [header](./koatty.httpcontroller.header.md)
|
4
|
+
|
5
|
+
## HttpController.header() method
|
6
|
+
|
7
|
+
Get/Set headers.
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
header(name?: string, value?: any): any;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| name | string | |
|
20
|
+
| value | any | |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
any
|
25
|
+
|
26
|
+
{<!-- -->\*<!-- -->} HttpController
|
27
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [isGet](./koatty.httpcontroller.isget.md)
|
4
|
+
|
5
|
+
## HttpController.isGet() method
|
6
|
+
|
7
|
+
Whether it is a GET request
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
isGet(): boolean;
|
13
|
+
```
|
14
|
+
<b>Returns:</b>
|
15
|
+
|
16
|
+
boolean
|
17
|
+
|
18
|
+
{<!-- -->boolean<!-- -->} HttpController
|
19
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [isMethod](./koatty.httpcontroller.ismethod.md)
|
4
|
+
|
5
|
+
## HttpController.isMethod() method
|
6
|
+
|
7
|
+
Determines whether the METHOD request is specified
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
isMethod(method: string): boolean;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| method | string | |
|
20
|
+
|
21
|
+
<b>Returns:</b>
|
22
|
+
|
23
|
+
boolean
|
24
|
+
|
25
|
+
{<!-- -->boolean<!-- -->} HttpController
|
26
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [isPost](./koatty.httpcontroller.ispost.md)
|
4
|
+
|
5
|
+
## HttpController.isPost() method
|
6
|
+
|
7
|
+
Whether it is a POST request
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
isPost(): boolean;
|
13
|
+
```
|
14
|
+
<b>Returns:</b>
|
15
|
+
|
16
|
+
boolean
|
17
|
+
|
18
|
+
{<!-- -->boolean<!-- -->} HttpController
|
19
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [json](./koatty.httpcontroller.json.md)
|
4
|
+
|
5
|
+
## HttpController.json() method
|
6
|
+
|
7
|
+
Respond to json formatted content
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
json(data: any): Promise<any>;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| data | any | |
|
20
|
+
|
21
|
+
<b>Returns:</b>
|
22
|
+
|
23
|
+
Promise<any>
|
24
|
+
|
25
|
+
{<!-- -->Promise<any>} HttpController
|
26
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md)
|
4
|
+
|
5
|
+
## HttpController class
|
6
|
+
|
7
|
+
HTTP controller
|
8
|
+
|
9
|
+
HttpController {<!-- -->IController<!-- -->}
|
10
|
+
|
11
|
+
<b>Signature:</b>
|
12
|
+
|
13
|
+
```typescript
|
14
|
+
export declare class HttpController extends BaseController
|
15
|
+
```
|
16
|
+
<b>Extends:</b> [BaseController](./koatty.basecontroller.md)
|
17
|
+
|
18
|
+
## Methods
|
19
|
+
|
20
|
+
| Method | Modifiers | Description |
|
21
|
+
| --- | --- | --- |
|
22
|
+
| [body(data, contentType, encoding)](./koatty.httpcontroller.body.md) | | Set response Body content |
|
23
|
+
| [deny(code)](./koatty.httpcontroller.deny.md) | | Block access |
|
24
|
+
| [expires(timeout)](./koatty.httpcontroller.expires.md) | | set cache-control and expires header |
|
25
|
+
| [fail(msg, data, code)](./koatty.httpcontroller.fail.md) | | Response to normalize json format content for fail |
|
26
|
+
| [header(name, value)](./koatty.httpcontroller.header.md) | | Get/Set headers. |
|
27
|
+
| [isGet()](./koatty.httpcontroller.isget.md) | | Whether it is a GET request |
|
28
|
+
| [isMethod(method)](./koatty.httpcontroller.ismethod.md) | | Determines whether the METHOD request is specified |
|
29
|
+
| [isPost()](./koatty.httpcontroller.ispost.md) | | Whether it is a POST request |
|
30
|
+
| [json(data)](./koatty.httpcontroller.json.md) | | Respond to json formatted content |
|
31
|
+
| [ok(msg, data, code)](./koatty.httpcontroller.ok.md) | | Response to normalize json format content for success |
|
32
|
+
| [param(name)](./koatty.httpcontroller.param.md) | | Get POST/GET parameters, the POST value is priority. |
|
33
|
+
| [redirect(urls, alt)](./koatty.httpcontroller.redirect.md) | | Url redirect |
|
34
|
+
| [type(contentType, encoding)](./koatty.httpcontroller.type.md) | | Set response content-type |
|
35
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [ok](./koatty.httpcontroller.ok.md)
|
4
|
+
|
5
|
+
## HttpController.ok() method
|
6
|
+
|
7
|
+
Response to normalize json format content for success
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
ok(msg: string | ApiInput, data?: any, code?: number): Promise<any>;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| msg | string \| [ApiInput](./koatty.apiinput.md) | 待处理的message消息 |
|
20
|
+
| data | any | 待处理的数据 |
|
21
|
+
| code | number | 错误码,默认0 |
|
22
|
+
|
23
|
+
<b>Returns:</b>
|
24
|
+
|
25
|
+
Promise<any>
|
26
|
+
|
27
|
+
{<!-- -->\*<!-- -->} HttpController
|
28
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [param](./koatty.httpcontroller.param.md)
|
4
|
+
|
5
|
+
## HttpController.param() method
|
6
|
+
|
7
|
+
Get POST/GET parameters, the POST value is priority.
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
param(name?: string): any;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| name | string | |
|
20
|
+
|
21
|
+
<b>Returns:</b>
|
22
|
+
|
23
|
+
any
|
24
|
+
|
25
|
+
HttpController
|
26
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [redirect](./koatty.httpcontroller.redirect.md)
|
4
|
+
|
5
|
+
## HttpController.redirect() method
|
6
|
+
|
7
|
+
Url redirect
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
redirect(urls: string, alt?: string): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| urls | string | |
|
20
|
+
| alt | string | |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
void
|
25
|
+
|
26
|
+
{<!-- -->void<!-- -->} HttpController
|
27
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [HttpController](./koatty.httpcontroller.md) > [type](./koatty.httpcontroller.type.md)
|
4
|
+
|
5
|
+
## HttpController.type() method
|
6
|
+
|
7
|
+
Set response content-type
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
type(contentType: string, encoding?: string | boolean): string;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| contentType | string | |
|
20
|
+
| encoding | string \| boolean | |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
string
|
25
|
+
|
26
|
+
{<!-- -->string<!-- -->} HttpController
|
27
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IController](./koatty.icontroller.md) > [\_\_after](./koatty.icontroller.__after.md)
|
4
|
+
|
5
|
+
## IController.\_\_after property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
__after?: () => Promise<any>;
|
11
|
+
```
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IController](./koatty.icontroller.md) > [\_\_befor](./koatty.icontroller.__befor.md)
|
4
|
+
|
5
|
+
## IController.\_\_befor property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
__befor?: () => Promise<any>;
|
11
|
+
```
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IController](./koatty.icontroller.md) > [app](./koatty.icontroller.app.md)
|
4
|
+
|
5
|
+
## IController.app property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
app: Koatty;
|
11
|
+
```
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IController](./koatty.icontroller.md) > [ctx](./koatty.icontroller.ctx.md)
|
4
|
+
|
5
|
+
## IController.ctx property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
readonly ctx: KoattyContext;
|
11
|
+
```
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IController](./koatty.icontroller.md) > [fail](./koatty.icontroller.fail.md)
|
4
|
+
|
5
|
+
## IController.fail property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
readonly fail: (msg?: Error | string | ApiInput, data?: any, ret?: number) => Promise<any>;
|
11
|
+
```
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IController](./koatty.icontroller.md)
|
4
|
+
|
5
|
+
## IController interface
|
6
|
+
|
7
|
+
Interface for Controller
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export interface IController
|
13
|
+
```
|
14
|
+
|
15
|
+
## Properties
|
16
|
+
|
17
|
+
| Property | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| [\_\_after?](./koatty.icontroller.__after.md) | () => Promise<any> | <i>(Optional)</i> |
|
20
|
+
| [\_\_befor?](./koatty.icontroller.__befor.md) | () => Promise<any> | <i>(Optional)</i> |
|
21
|
+
| [app](./koatty.icontroller.app.md) | Koatty | |
|
22
|
+
| [ctx](./koatty.icontroller.ctx.md) | KoattyContext | |
|
23
|
+
| [fail](./koatty.icontroller.fail.md) | (msg?: Error \| string \| [ApiInput](./koatty.apiinput.md)<!-- -->, data?: any, ret?: number) => Promise<any> | |
|
24
|
+
| [ok](./koatty.icontroller.ok.md) | (msg?: string \| [ApiInput](./koatty.apiinput.md)<!-- -->, data?: any, ret?: number) => Promise<any> | |
|
25
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IController](./koatty.icontroller.md) > [ok](./koatty.icontroller.ok.md)
|
4
|
+
|
5
|
+
## IController.ok property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
readonly ok: (msg?: string | ApiInput, data?: any, ret?: number) => Promise<any>;
|
11
|
+
```
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IMiddleware](./koatty.imiddleware.md)
|
4
|
+
|
5
|
+
## IMiddleware interface
|
6
|
+
|
7
|
+
Interface for Middleware
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export interface IMiddleware
|
13
|
+
```
|
14
|
+
|
15
|
+
## Properties
|
16
|
+
|
17
|
+
| Property | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| [run](./koatty.imiddleware.run.md) | (options: any, app: Koatty) => Koa.Middleware | |
|
20
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IMiddleware](./koatty.imiddleware.md) > [run](./koatty.imiddleware.run.md)
|
4
|
+
|
5
|
+
## IMiddleware.run property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
run: (options: any, app: Koatty) => Koa.Middleware;
|
11
|
+
```
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IPlugin](./koatty.iplugin.md)
|
4
|
+
|
5
|
+
## IPlugin interface
|
6
|
+
|
7
|
+
Interface for Plugin
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export interface IPlugin
|
13
|
+
```
|
14
|
+
|
15
|
+
## Properties
|
16
|
+
|
17
|
+
| Property | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| [run](./koatty.iplugin.run.md) | (options: any, app: Koatty) => Promise<any> | |
|
20
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IPlugin](./koatty.iplugin.md) > [run](./koatty.iplugin.run.md)
|
4
|
+
|
5
|
+
## IPlugin.run property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
run: (options: any, app: Koatty) => Promise<any>;
|
11
|
+
```
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IService](./koatty.iservice.md) > [app](./koatty.iservice.app.md)
|
4
|
+
|
5
|
+
## IService.app property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
app: Koatty;
|
11
|
+
```
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [IService](./koatty.iservice.md)
|
4
|
+
|
5
|
+
## IService interface
|
6
|
+
|
7
|
+
Interface for Service
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export interface IService
|
13
|
+
```
|
14
|
+
|
15
|
+
## Properties
|
16
|
+
|
17
|
+
| Property | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| [app](./koatty.iservice.app.md) | Koatty | |
|
20
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [Logger](./koatty.logger.md)
|
4
|
+
|
5
|
+
## Logger variable
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
Logger: import("koatty_logger").Logger
|
11
|
+
```
|