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,99 @@
|
|
1
|
+
{
|
2
|
+
"name": "koatty",
|
3
|
+
"version": "3.5.12-0",
|
4
|
+
"description": "Koa2 + Typescript = koatty. Use Typescript's decorator implement auto injection.",
|
5
|
+
"scripts": {
|
6
|
+
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
7
|
+
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
8
|
+
"build:js": "del-cli --force dist && npx rollup -c",
|
9
|
+
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
10
|
+
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
11
|
+
"eslint": "eslint --ext .ts,.js ./",
|
12
|
+
"prepublishOnly": "npm test && npm run build",
|
13
|
+
"prerelease": "npm test && npm run build",
|
14
|
+
"release": "standard-version",
|
15
|
+
"release:pre": "npm run release -- --prerelease",
|
16
|
+
"release:major": "npm run release -- --release-as major",
|
17
|
+
"release:minor": "npm run release -- --release-as minor",
|
18
|
+
"pub": "git push --follow-tags origin && npm publish",
|
19
|
+
"test": "npm run eslint && jest --passWithNoTests",
|
20
|
+
"test:cov": "jest --collectCoverage --detectOpenHandles",
|
21
|
+
"version": "conventional-changelog -p angular -i CHANGELOG.md -s"
|
22
|
+
},
|
23
|
+
"main": "./dist/index.js",
|
24
|
+
"exports": {
|
25
|
+
"require": "./index.js",
|
26
|
+
"import": "./index.mjs"
|
27
|
+
},
|
28
|
+
"typings": "index.d.ts",
|
29
|
+
"directories": {
|
30
|
+
"doc": "docs"
|
31
|
+
},
|
32
|
+
"repository": {
|
33
|
+
"type": "git",
|
34
|
+
"url": "git+https://github.com/thinkkoa/koatty.git"
|
35
|
+
},
|
36
|
+
"engines": {
|
37
|
+
"node": ">12.0.0"
|
38
|
+
},
|
39
|
+
"author": {
|
40
|
+
"name": "richenlin",
|
41
|
+
"email": "richenlin@gmail.com"
|
42
|
+
},
|
43
|
+
"license": "BSD-3-Clause",
|
44
|
+
"bugs": {
|
45
|
+
"url": "https://github.com/thinkkoa/koatty/issues"
|
46
|
+
},
|
47
|
+
"homepage": "https://github.com/thinkkoa/koatty",
|
48
|
+
"maintainers": [
|
49
|
+
{
|
50
|
+
"name": "richenlin",
|
51
|
+
"email": "richenlin@gmail.com"
|
52
|
+
}
|
53
|
+
],
|
54
|
+
"devDependencies": {
|
55
|
+
"@microsoft/api-documenter": "^7.x.x",
|
56
|
+
"@microsoft/api-extractor": "^7.x.x",
|
57
|
+
"@rollup/plugin-json": "^4.x.x",
|
58
|
+
"@types/jest": "^27.x.x",
|
59
|
+
"@types/koa": "^2.x.x",
|
60
|
+
"@types/koa__router": "^8.x.x",
|
61
|
+
"@types/node": "^16.x.x",
|
62
|
+
"@types/uuid": "^8.x.x",
|
63
|
+
"@types/ws": "^8.x.x",
|
64
|
+
"@typescript-eslint/eslint-plugin": "^5.x.x",
|
65
|
+
"@typescript-eslint/parser": "^5.x.x",
|
66
|
+
"commitlint": "^15.x.x",
|
67
|
+
"commitlint-config-gitmoji": "^2.x.x",
|
68
|
+
"conventional-changelog-cli": "^2.x.x",
|
69
|
+
"copyfiles": "^2.x.x",
|
70
|
+
"del-cli": "^4.x.x",
|
71
|
+
"eslint": "^8.x.x",
|
72
|
+
"eslint-plugin-jest": "^25.x.x",
|
73
|
+
"husky": "^7.x.x",
|
74
|
+
"jest": "^27.x.x",
|
75
|
+
"jest-html-reporters": "^2.x.x",
|
76
|
+
"rollup": "^2.x.x",
|
77
|
+
"rollup-plugin-typescript2": "^0.x.x",
|
78
|
+
"standard-version": "^9.x.x",
|
79
|
+
"ts-jest": "^27.x.x",
|
80
|
+
"ts-node": "^10.x.x",
|
81
|
+
"typescript": "^4.x.x"
|
82
|
+
},
|
83
|
+
"dependencies": {
|
84
|
+
"koa": "^2.13.4",
|
85
|
+
"koatty_config": "^1.0.6",
|
86
|
+
"koatty_container": "^1.6.12",
|
87
|
+
"koatty_core": "^1.4.6",
|
88
|
+
"koatty_exception": "^1.0.6",
|
89
|
+
"koatty_lib": "^1.2.8",
|
90
|
+
"koatty_loader": "^1.0.2",
|
91
|
+
"koatty_logger": "^1.3.12",
|
92
|
+
"koatty_payload": "^1.3.10",
|
93
|
+
"koatty_router": "^1.6.2",
|
94
|
+
"koatty_serve": "^1.4.2",
|
95
|
+
"koatty_trace": "^1.5.0",
|
96
|
+
"reflect-metadata": "^0.1.13",
|
97
|
+
"tslib": "^2.3.1"
|
98
|
+
}
|
99
|
+
}
|
@@ -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) > [ApiInput](./koatty.apiinput.md) > [code](./koatty.apiinput.code.md)
|
4
|
+
|
5
|
+
## ApiInput.code property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
code?: number;
|
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) > [ApiInput](./koatty.apiinput.md) > [data](./koatty.apiinput.data.md)
|
4
|
+
|
5
|
+
## ApiInput.data property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
data?: any;
|
11
|
+
```
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [ApiInput](./koatty.apiinput.md)
|
4
|
+
|
5
|
+
## ApiInput interface
|
6
|
+
|
7
|
+
Interface for Api input
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export interface ApiInput
|
13
|
+
```
|
14
|
+
|
15
|
+
## Properties
|
16
|
+
|
17
|
+
| Property | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| [code?](./koatty.apiinput.code.md) | number | <i>(Optional)</i> |
|
20
|
+
| [data?](./koatty.apiinput.data.md) | any | <i>(Optional)</i> |
|
21
|
+
| [message?](./koatty.apiinput.message.md) | string | <i>(Optional)</i> |
|
22
|
+
|
@@ -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) > [ApiInput](./koatty.apiinput.md) > [message](./koatty.apiinput.message.md)
|
4
|
+
|
5
|
+
## ApiInput.message property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
message?: string;
|
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) > [ApiOutput](./koatty.apioutput.md) > [code](./koatty.apioutput.code.md)
|
4
|
+
|
5
|
+
## ApiOutput.code property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
code: number;
|
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) > [ApiOutput](./koatty.apioutput.md) > [data](./koatty.apioutput.data.md)
|
4
|
+
|
5
|
+
## ApiOutput.data property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
data: any;
|
11
|
+
```
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [ApiOutput](./koatty.apioutput.md)
|
4
|
+
|
5
|
+
## ApiOutput interface
|
6
|
+
|
7
|
+
Interface for Api output
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
export interface ApiOutput
|
13
|
+
```
|
14
|
+
|
15
|
+
## Properties
|
16
|
+
|
17
|
+
| Property | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| [code](./koatty.apioutput.code.md) | number | |
|
20
|
+
| [data](./koatty.apioutput.data.md) | any | |
|
21
|
+
| [message](./koatty.apioutput.message.md) | string | |
|
22
|
+
|
@@ -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) > [ApiOutput](./koatty.apioutput.md) > [message](./koatty.apioutput.message.md)
|
4
|
+
|
5
|
+
## ApiOutput.message property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
message: string;
|
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) > [AppReadyHookFunc](./koatty.appreadyhookfunc.md)
|
4
|
+
|
5
|
+
## AppReadyHookFunc type
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
export declare type AppReadyHookFunc = (app: Koatty) => 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) > [BaseController](./koatty.basecontroller.md) > [(constructor)](./koatty.basecontroller._constructor_.md)
|
4
|
+
|
5
|
+
## BaseController.(constructor)
|
6
|
+
|
7
|
+
instance of BaseController.
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
protected constructor(ctx: KoattyContext);
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| ctx | KoattyContext | BaseController |
|
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) > [BaseController](./koatty.basecontroller.md) > [\_options](./koatty.basecontroller._options.md)
|
4
|
+
|
5
|
+
## BaseController.\_options property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
protected _options: ObjectDefinitionOptions;
|
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) > [BaseController](./koatty.basecontroller.md) > [app](./koatty.basecontroller.app.md)
|
4
|
+
|
5
|
+
## BaseController.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) > [BaseController](./koatty.basecontroller.md) > [ctx](./koatty.basecontroller.ctx.md)
|
4
|
+
|
5
|
+
## BaseController.ctx property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
readonly ctx: KoattyContext;
|
11
|
+
```
|
@@ -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) > [BaseController](./koatty.basecontroller.md) > [fail](./koatty.basecontroller.fail.md)
|
4
|
+
|
5
|
+
## BaseController.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): 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
|
+
any
|
26
|
+
|
27
|
+
{<!-- -->\*<!-- -->} BaseController
|
28
|
+
|
@@ -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) > [BaseController](./koatty.basecontroller.md) > [init](./koatty.basecontroller.init.md)
|
4
|
+
|
5
|
+
## BaseController.init() method
|
6
|
+
|
7
|
+
init
|
8
|
+
|
9
|
+
BaseController
|
10
|
+
|
11
|
+
<b>Signature:</b>
|
12
|
+
|
13
|
+
```typescript
|
14
|
+
protected init(): void;
|
15
|
+
```
|
16
|
+
<b>Returns:</b>
|
17
|
+
|
18
|
+
void
|
19
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [BaseController](./koatty.basecontroller.md)
|
4
|
+
|
5
|
+
## BaseController class
|
6
|
+
|
7
|
+
Base controller
|
8
|
+
|
9
|
+
BaseController {<!-- -->IController<!-- -->}
|
10
|
+
|
11
|
+
<b>Signature:</b>
|
12
|
+
|
13
|
+
```typescript
|
14
|
+
export declare class BaseController implements IController
|
15
|
+
```
|
16
|
+
<b>Implements:</b> [IController](./koatty.icontroller.md)
|
17
|
+
|
18
|
+
## Constructors
|
19
|
+
|
20
|
+
| Constructor | Modifiers | Description |
|
21
|
+
| --- | --- | --- |
|
22
|
+
| [(constructor)(ctx)](./koatty.basecontroller._constructor_.md) | | instance of BaseController. |
|
23
|
+
|
24
|
+
## Properties
|
25
|
+
|
26
|
+
| Property | Modifiers | Type | Description |
|
27
|
+
| --- | --- | --- | --- |
|
28
|
+
| [\_options](./koatty.basecontroller._options.md) | | ObjectDefinitionOptions | |
|
29
|
+
| [app](./koatty.basecontroller.app.md) | | Koatty | |
|
30
|
+
| [ctx](./koatty.basecontroller.ctx.md) | | KoattyContext | |
|
31
|
+
|
32
|
+
## Methods
|
33
|
+
|
34
|
+
| Method | Modifiers | Description |
|
35
|
+
| --- | --- | --- |
|
36
|
+
| [fail(msg, data, code)](./koatty.basecontroller.fail.md) | | Response to normalize json format content for fail |
|
37
|
+
| [init()](./koatty.basecontroller.init.md) | | init BaseController |
|
38
|
+
| [ok(msg, data, code)](./koatty.basecontroller.ok.md) | | Response to normalize json format content for success |
|
39
|
+
|
@@ -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) > [BaseController](./koatty.basecontroller.md) > [ok](./koatty.basecontroller.ok.md)
|
4
|
+
|
5
|
+
## BaseController.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<ApiOutput>;
|
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<[ApiOutput](./koatty.apioutput.md)<!-- -->>
|
26
|
+
|
27
|
+
{<!-- -->\*<!-- -->} BaseController
|
28
|
+
|
@@ -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) > [BaseService](./koatty.baseservice.md) > [(constructor)](./koatty.baseservice._constructor_.md)
|
4
|
+
|
5
|
+
## BaseService.(constructor)
|
6
|
+
|
7
|
+
instance of Base.
|
8
|
+
|
9
|
+
<b>Signature:</b>
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
protected constructor(...arg: any[]);
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| arg | any\[\] | Base |
|
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) > [BaseService](./koatty.baseservice.md) > [\_options](./koatty.baseservice._options.md)
|
4
|
+
|
5
|
+
## BaseService.\_options property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
protected _options: ObjectDefinitionOptions;
|
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) > [BaseService](./koatty.baseservice.md) > [app](./koatty.baseservice.app.md)
|
4
|
+
|
5
|
+
## BaseService.app property
|
6
|
+
|
7
|
+
<b>Signature:</b>
|
8
|
+
|
9
|
+
```typescript
|
10
|
+
app: Koatty;
|
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) > [BaseService](./koatty.baseservice.md) > [init](./koatty.baseservice.init.md)
|
4
|
+
|
5
|
+
## BaseService.init() method
|
6
|
+
|
7
|
+
init
|
8
|
+
|
9
|
+
|
10
|
+
<b>Signature:</b>
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
protected init(...arg: any[]): void;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| arg | any\[\] | Base |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
void
|
25
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [koatty](./koatty.md) > [BaseService](./koatty.baseservice.md)
|
4
|
+
|
5
|
+
## BaseService class
|
6
|
+
|
7
|
+
Base class
|
8
|
+
|
9
|
+
Base
|
10
|
+
|
11
|
+
<b>Signature:</b>
|
12
|
+
|
13
|
+
```typescript
|
14
|
+
export declare class BaseService implements IService
|
15
|
+
```
|
16
|
+
<b>Implements:</b> [IService](./koatty.iservice.md)
|
17
|
+
|
18
|
+
## Constructors
|
19
|
+
|
20
|
+
| Constructor | Modifiers | Description |
|
21
|
+
| --- | --- | --- |
|
22
|
+
| [(constructor)(arg)](./koatty.baseservice._constructor_.md) | | instance of Base. |
|
23
|
+
|
24
|
+
## Properties
|
25
|
+
|
26
|
+
| Property | Modifiers | Type | Description |
|
27
|
+
| --- | --- | --- | --- |
|
28
|
+
| [\_options](./koatty.baseservice._options.md) | | ObjectDefinitionOptions | |
|
29
|
+
| [app](./koatty.baseservice.app.md) | | Koatty | |
|
30
|
+
|
31
|
+
## Methods
|
32
|
+
|
33
|
+
| Method | Modifiers | Description |
|
34
|
+
| --- | --- | --- |
|
35
|
+
| [init(arg)](./koatty.baseservice.init.md) | | init |
|
36
|
+
|
@@ -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) > [BindAppReadyHook](./koatty.bindappreadyhook.md)
|
4
|
+
|
5
|
+
## BindAppReadyHook() function
|
6
|
+
|
7
|
+
bind AppReadyHookFunc example: export function TestDecorator(): ClassDecorator { return (target: any) =<!-- -->> { BindAppReadyHook((app: Koatty) =<!-- -->> { // todo return Promise.resolve(); }<!-- -->, target) } }
|
8
|
+
|
9
|
+
|
10
|
+
<b>Signature:</b>
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
export declare function BindAppReadyHook(func: AppReadyHookFunc, target: any): void;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| func | [AppReadyHookFunc](./koatty.appreadyhookfunc.md) | |
|
21
|
+
| target | any | |
|
22
|
+
|
23
|
+
<b>Returns:</b>
|
24
|
+
|
25
|
+
void
|
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) > [Bootstrap](./koatty.bootstrap.md)
|
4
|
+
|
5
|
+
## Bootstrap() function
|
6
|
+
|
7
|
+
Bootstrap application
|
8
|
+
|
9
|
+
|
10
|
+
<b>Signature:</b>
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
export declare function Bootstrap(bootFunc?: Function): ClassDecorator;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| bootFunc | Function | |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
ClassDecorator
|
25
|
+
|
26
|
+
{<!-- -->ClassDecorator<!-- -->}
|
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) > [Component](./koatty.component.md)
|
4
|
+
|
5
|
+
## Component() function
|
6
|
+
|
7
|
+
Indicates that an decorated class is a "component".
|
8
|
+
|
9
|
+
|
10
|
+
<b>Signature:</b>
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
export declare function Component(identifier?: string): ClassDecorator;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| identifier | string | component name |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
ClassDecorator
|
25
|
+
|
26
|
+
{<!-- -->ClassDecorator<!-- -->}
|
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) > [ComponentScan](./koatty.componentscan.md)
|
4
|
+
|
5
|
+
## ComponentScan() function
|
6
|
+
|
7
|
+
Define project scan path
|
8
|
+
|
9
|
+
|
10
|
+
<b>Signature:</b>
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
export declare function ComponentScan(scanPath?: string | string[]): ClassDecorator;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| scanPath | string \| string\[\] | |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
ClassDecorator
|
25
|
+
|
26
|
+
{<!-- -->ClassDecorator<!-- -->}
|
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) > [ConfigurationScan](./koatty.configurationscan.md)
|
4
|
+
|
5
|
+
## ConfigurationScan() function
|
6
|
+
|
7
|
+
Define project configuration scan path
|
8
|
+
|
9
|
+
|
10
|
+
<b>Signature:</b>
|
11
|
+
|
12
|
+
```typescript
|
13
|
+
export declare function ConfigurationScan(scanPath?: string | string[]): ClassDecorator;
|
14
|
+
```
|
15
|
+
|
16
|
+
## Parameters
|
17
|
+
|
18
|
+
| Parameter | Type | Description |
|
19
|
+
| --- | --- | --- |
|
20
|
+
| scanPath | string \| string\[\] | |
|
21
|
+
|
22
|
+
<b>Returns:</b>
|
23
|
+
|
24
|
+
ClassDecorator
|
25
|
+
|
26
|
+
{<!-- -->ClassDecorator<!-- -->}
|
27
|
+
|