koatty 3.5.11 → 3.5.12-3

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +4 -35
  2. package/README.md +4 -7
  3. package/dist/LICENSE +29 -0
  4. package/dist/README.md +147 -0
  5. package/dist/index.d.ts +368 -19
  6. package/dist/index.js +1266 -26
  7. package/dist/index.mjs +1197 -0
  8. package/dist/package.json +98 -0
  9. package/package.json +36 -35
  10. package/.eslintignore +0 -9
  11. package/.eslintrc.js +0 -43
  12. package/babel.config.js +0 -21
  13. package/commitlint.config.js +0 -14
  14. package/dist/config/config.d.ts +0 -18
  15. package/dist/config/config.js +0 -25
  16. package/dist/config/config.js.map +0 -1
  17. package/dist/config/middleware.d.ts +0 -28
  18. package/dist/config/middleware.js +0 -32
  19. package/dist/config/middleware.js.map +0 -1
  20. package/dist/config/plugin.d.ts +0 -11
  21. package/dist/config/plugin.js +0 -15
  22. package/dist/config/plugin.js.map +0 -1
  23. package/dist/config/router.d.ts +0 -8
  24. package/dist/config/router.js +0 -32
  25. package/dist/config/router.js.map +0 -1
  26. package/dist/controller/BaseController.d.ts +0 -60
  27. package/dist/controller/BaseController.js +0 -137
  28. package/dist/controller/BaseController.js.map +0 -1
  29. package/dist/controller/HttpController.d.ts +0 -131
  30. package/dist/controller/HttpController.js +0 -214
  31. package/dist/controller/HttpController.js.map +0 -1
  32. package/dist/core/Bootstrap.d.ts +0 -50
  33. package/dist/core/Bootstrap.js +0 -218
  34. package/dist/core/Bootstrap.js.map +0 -1
  35. package/dist/core/Component.d.ts +0 -94
  36. package/dist/core/Component.js +0 -89
  37. package/dist/core/Component.js.map +0 -1
  38. package/dist/core/Constants.d.ts +0 -11
  39. package/dist/core/Constants.js +0 -24
  40. package/dist/core/Constants.js.map +0 -1
  41. package/dist/core/Loader.d.ts +0 -110
  42. package/dist/core/Loader.js +0 -394
  43. package/dist/core/Loader.js.map +0 -1
  44. package/dist/index.js.map +0 -1
  45. package/dist/middleware/PayloadMiddleware.d.ts +0 -11
  46. package/dist/middleware/PayloadMiddleware.js +0 -22
  47. package/dist/middleware/PayloadMiddleware.js.map +0 -1
  48. package/dist/middleware/TraceMiddleware.d.ts +0 -11
  49. package/dist/middleware/TraceMiddleware.js +0 -22
  50. package/dist/middleware/TraceMiddleware.js.map +0 -1
  51. package/dist/service/BaseService.d.ts +0 -33
  52. package/dist/service/BaseService.js +0 -32
  53. package/dist/service/BaseService.js.map +0 -1
  54. package/dist/util/Helper.d.ts +0 -25
  55. package/dist/util/Helper.js +0 -117
  56. package/dist/util/Helper.js.map +0 -1
  57. package/dist/util/Logger.d.ts +0 -27
  58. package/dist/util/Logger.js +0 -41
  59. package/dist/util/Logger.js.map +0 -1
  60. package/jest.config.js +0 -36
  61. package/jest_html_reporters.html +0 -60
  62. package/tsconfig.json +0 -67
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "koatty",
3
+ "version": "3.5.12-3",
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": "./dist/index.js",
26
+ "import": "./dist/index.mjs"
27
+ },
28
+ "directories": {
29
+ "doc": "docs"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/thinkkoa/koatty.git"
34
+ },
35
+ "engines": {
36
+ "node": ">12.0.0"
37
+ },
38
+ "author": {
39
+ "name": "richenlin",
40
+ "email": "richenlin@gmail.com"
41
+ },
42
+ "license": "BSD-3-Clause",
43
+ "bugs": {
44
+ "url": "https://github.com/thinkkoa/koatty/issues"
45
+ },
46
+ "homepage": "https://github.com/thinkkoa/koatty",
47
+ "maintainers": [
48
+ {
49
+ "name": "richenlin",
50
+ "email": "richenlin@gmail.com"
51
+ }
52
+ ],
53
+ "devDependencies": {
54
+ "@microsoft/api-documenter": "^7.x.x",
55
+ "@microsoft/api-extractor": "^7.x.x",
56
+ "@rollup/plugin-json": "^4.x.x",
57
+ "@types/jest": "^27.x.x",
58
+ "@types/koa": "^2.x.x",
59
+ "@types/koa__router": "^8.x.x",
60
+ "@types/node": "^16.x.x",
61
+ "@types/uuid": "^8.x.x",
62
+ "@types/ws": "^8.x.x",
63
+ "@typescript-eslint/eslint-plugin": "^5.x.x",
64
+ "@typescript-eslint/parser": "^5.x.x",
65
+ "commitlint": "^15.x.x",
66
+ "commitlint-config-gitmoji": "^2.x.x",
67
+ "conventional-changelog-cli": "^2.x.x",
68
+ "copyfiles": "^2.x.x",
69
+ "del-cli": "^4.x.x",
70
+ "eslint": "^8.x.x",
71
+ "eslint-plugin-jest": "^25.x.x",
72
+ "husky": "^7.x.x",
73
+ "jest": "^27.x.x",
74
+ "jest-html-reporters": "^2.x.x",
75
+ "rollup": "^2.x.x",
76
+ "rollup-plugin-typescript2": "^0.x.x",
77
+ "standard-version": "^9.x.x",
78
+ "ts-jest": "^27.x.x",
79
+ "ts-node": "^10.x.x",
80
+ "typescript": "^4.x.x"
81
+ },
82
+ "dependencies": {
83
+ "koa": "^2.13.4",
84
+ "koatty_config": "^1.0.6",
85
+ "koatty_container": "^1.6.16",
86
+ "koatty_core": "^1.4.14",
87
+ "koatty_exception": "^1.0.6",
88
+ "koatty_lib": "^1.2.8",
89
+ "koatty_loader": "^1.0.2",
90
+ "koatty_logger": "^1.3.12",
91
+ "koatty_payload": "^1.3.10",
92
+ "koatty_router": "^1.6.4",
93
+ "koatty_serve": "^1.4.4",
94
+ "koatty_trace": "^1.5.2",
95
+ "reflect-metadata": "^0.1.13",
96
+ "tslib": "^2.3.1"
97
+ }
98
+ }
package/package.json CHANGED
@@ -1,33 +1,37 @@
1
1
  {
2
2
  "name": "koatty",
3
- "version": "3.5.11",
3
+ "version": "3.5.12-3",
4
4
  "description": "Koa2 + Typescript = koatty. Use Typescript's decorator implement auto injection.",
5
5
  "scripts": {
6
- "build": "del-cli --force dist && tsc",
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",
7
11
  "eslint": "eslint --ext .ts,.js ./",
8
12
  "prepublishOnly": "npm test && npm run build",
9
- "release": "npm run prepublishOnly && standard-version",
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",
10
18
  "pub": "git push --follow-tags origin && npm publish",
11
19
  "test": "npm run eslint && jest --passWithNoTests",
12
20
  "test:cov": "jest --collectCoverage --detectOpenHandles",
13
21
  "version": "conventional-changelog -p angular -i CHANGELOG.md -s"
14
22
  },
15
23
  "main": "./dist/index.js",
24
+ "exports": {
25
+ "require": "./dist/index.js",
26
+ "import": "./dist/index.mjs"
27
+ },
28
+ "directories": {
29
+ "doc": "docs"
30
+ },
16
31
  "repository": {
17
32
  "type": "git",
18
33
  "url": "git+https://github.com/thinkkoa/koatty.git"
19
34
  },
20
- "keywords": [
21
- "web",
22
- "typescript",
23
- "framework",
24
- "mvc",
25
- "koa2",
26
- "restful",
27
- "agile",
28
- "koatty",
29
- "thinkkoa"
30
- ],
31
35
  "engines": {
32
36
  "node": ">12.0.0"
33
37
  },
@@ -47,27 +51,29 @@
47
51
  }
48
52
  ],
49
53
  "devDependencies": {
50
- "@babel/core": "^7.x.x",
51
- "@babel/plugin-proposal-decorators": "^7.x.x",
52
- "@babel/preset-env": "^7.x.x",
53
- "@babel/preset-typescript": "^7.x.x",
54
- "@commitlint/cli": "^12.x.x",
55
- "@commitlint/config-conventional": "^15.x.x",
54
+ "@microsoft/api-documenter": "^7.x.x",
55
+ "@microsoft/api-extractor": "^7.x.x",
56
+ "@rollup/plugin-json": "^4.x.x",
56
57
  "@types/jest": "^27.x.x",
57
58
  "@types/koa": "^2.x.x",
58
- "@types/koa__router": "^8.0.9",
59
+ "@types/koa__router": "^8.x.x",
59
60
  "@types/node": "^16.x.x",
60
- "@types/uuid": "^8.3.3",
61
- "@types/ws": "^8.2.0",
61
+ "@types/uuid": "^8.x.x",
62
+ "@types/ws": "^8.x.x",
62
63
  "@typescript-eslint/eslint-plugin": "^5.x.x",
63
64
  "@typescript-eslint/parser": "^5.x.x",
65
+ "commitlint": "^15.x.x",
66
+ "commitlint-config-gitmoji": "^2.x.x",
64
67
  "conventional-changelog-cli": "^2.x.x",
68
+ "copyfiles": "^2.x.x",
65
69
  "del-cli": "^4.x.x",
66
70
  "eslint": "^8.x.x",
67
71
  "eslint-plugin-jest": "^25.x.x",
68
72
  "husky": "^7.x.x",
69
73
  "jest": "^27.x.x",
70
74
  "jest-html-reporters": "^2.x.x",
75
+ "rollup": "^2.x.x",
76
+ "rollup-plugin-typescript2": "^0.x.x",
71
77
  "standard-version": "^9.x.x",
72
78
  "ts-jest": "^27.x.x",
73
79
  "ts-node": "^10.x.x",
@@ -76,22 +82,17 @@
76
82
  "dependencies": {
77
83
  "koa": "^2.13.4",
78
84
  "koatty_config": "^1.0.6",
79
- "koatty_container": "^1.6.10",
80
- "koatty_core": "^1.3.38",
85
+ "koatty_container": "^1.6.16",
86
+ "koatty_core": "^1.4.14",
81
87
  "koatty_exception": "^1.0.6",
82
88
  "koatty_lib": "^1.2.8",
83
89
  "koatty_loader": "^1.0.2",
84
- "koatty_logger": "^1.2.12",
90
+ "koatty_logger": "^1.3.12",
85
91
  "koatty_payload": "^1.3.10",
86
- "koatty_router": "^1.5.14",
87
- "koatty_serve": "^1.3.10",
88
- "koatty_trace": "^1.4.30",
92
+ "koatty_router": "^1.6.4",
93
+ "koatty_serve": "^1.4.4",
94
+ "koatty_trace": "^1.5.2",
89
95
  "reflect-metadata": "^0.1.13",
90
96
  "tslib": "^2.3.1"
91
- },
92
- "husky": {
93
- "hooks": {
94
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
95
- }
96
97
  }
97
- }
98
+ }
package/.eslintignore DELETED
@@ -1,9 +0,0 @@
1
- node_modules
2
- .eslintrc.js
3
- **/package-lock.json
4
- **/yarn.lock
5
- **/*.config.js
6
- dist
7
- coverage
8
- test
9
- demo
package/.eslintrc.js DELETED
@@ -1,43 +0,0 @@
1
- /**
2
- *
3
- */
4
- module.exports = {
5
- root: true,
6
- parser: '@typescript-eslint/parser',
7
- extends: [
8
- 'plugin:@typescript-eslint/recommended', // 使用@typescript-eslint/eslint-plugin的推荐规则
9
- 'plugin:jest/recommended',
10
- ],
11
- plugins: [
12
- '@typescript-eslint',
13
- 'jest',
14
- ],
15
- parserOptions: {
16
- project: './tsconfig.json',
17
- },
18
- env: {
19
- node: true,
20
- mongo: true,
21
- jest: true,
22
- },
23
- rules: {
24
- "@typescript-eslint/no-explicit-any": "off",
25
- // "@typescript-eslint/no-require-imports": "off",
26
- "@typescript-eslint/no-var-requires": "off",
27
- "@typescript-eslint/member-ordering": "off",
28
- "@typescript-eslint/consistent-type-assertions": "off",
29
- "@typescript-eslint/no-param-reassign": "off",
30
- "@typescript-eslint/no-empty-function": "off",
31
- "@typescript-eslint/no-empty-interface": "off",
32
- "@typescript-eslint/explicit-module-boundary-types": "off",
33
- "@typescript-eslint/ban-types": ["error",
34
- {
35
- "types": {
36
- "Object": false,
37
- "Function": false,
38
- },
39
- "extendDefaults": true
40
- }
41
- ],
42
- },
43
- };
package/babel.config.js DELETED
@@ -1,21 +0,0 @@
1
- /*
2
- * @Description : babel配置
3
- * @usage : 用于jest执行用例
4
- */
5
-
6
- module.exports = {
7
- presets: [
8
- [
9
- '@babel/preset-env',
10
- {
11
- targets: {
12
- node: 'current',
13
- },
14
- },
15
- ],
16
- '@babel/preset-typescript',
17
- ],
18
- plugins: [
19
- ['@babel/plugin-proposal-decorators', { 'legacy': true }]
20
- ],
21
- };
@@ -1,14 +0,0 @@
1
- /*
2
- *
3
- */
4
- module.exports = {
5
- extends: ['@commitlint/config-conventional'],
6
- rules: {
7
- 'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'style', 'refactor', 'test', 'chore']],
8
- 'type-empty': [2, 'never'],
9
- 'scope-enum': [0], // 不校验scope类型
10
- 'scope-empty': [0], // 不校验scope是否设置
11
- 'subject-case': [0], // 不校验描述的字符格式
12
- 'subject-min-length': [2, 'always', 5], // 描述至少5个字符
13
- },
14
- };
@@ -1,18 +0,0 @@
1
- declare const _default: {
2
- app_port: number;
3
- app_host: string;
4
- protocol: string;
5
- open_trace: boolean;
6
- http_timeout: number;
7
- key_file: string;
8
- crt_file: string;
9
- encoding: string;
10
- logs_path: string;
11
- };
12
- /**
13
- * @ author: richen
14
- * @ copyright: Copyright (c) - <richenlin(at)gmail.com>
15
- * @ license: BSD (3-Clause)
16
- * @ version: 2020-01-19 15:41:30
17
- */
18
- export default _default;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * @ author: richen
5
- * @ copyright: Copyright (c) - <richenlin(at)gmail.com>
6
- * @ license: BSD (3-Clause)
7
- * @ version: 2020-01-19 15:41:30
8
- */
9
- exports.default = {
10
- /*app config*/
11
- app_port: 3000,
12
- app_host: "",
13
- protocol: "http",
14
- open_trace: false,
15
- http_timeout: 10,
16
- key_file: "",
17
- crt_file: "",
18
- encoding: "utf-8",
19
- // logs_level: "DEBUG", // Level log is printed to the console, "DEBUG" | "INFO" | "WARN" | "ERROR"
20
- // logs_console: true, // Whether to console logs
21
- // logs_write: false, // Whether to store logs
22
- // logs_write_level: "WARN", // Level log is printed to the file, "DEBUG" | "INFO" | "WARN" | "ERROR"
23
- logs_path: process.env.ROOT_PATH + "/logs", // Log file directory
24
- };
25
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,kBAAe;IACX,cAAc;IACd,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,EAAE;IAChB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,OAAO;IAEjB,mGAAmG;IACnG,iDAAiD;IACjD,8CAA8C;IAC9C,qGAAqG;IACrG,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,OAAO,EAAE,qBAAqB;CAEpE,CAAC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * @ author: richen
3
- * @ copyright: Copyright (c) - <richenlin(at)gmail.com>
4
- * @ license: BSD (3-Clause)
5
- * @ version: 2020-04-30 14:52:34
6
- */
7
- declare const _default: {
8
- list: any[];
9
- config: {
10
- TraceMiddleware: {
11
- HeaderName: string;
12
- };
13
- PayloadMiddleware: {
14
- extTypes: {
15
- json: string[];
16
- form: string[];
17
- text: string[];
18
- multipart: string[];
19
- xml: string[];
20
- };
21
- limit: string;
22
- encoding: string;
23
- multiples: boolean;
24
- keepExtensions: boolean;
25
- };
26
- };
27
- };
28
- export default _default;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /**
3
- * @ author: richen
4
- * @ copyright: Copyright (c) - <richenlin(at)gmail.com>
5
- * @ license: BSD (3-Clause)
6
- * @ version: 2020-04-30 14:52:34
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.default = {
10
- // List of loaded middleware(except for the middleware loaded by default),
11
- // executed in the order of elements
12
- list: [],
13
- config: {
14
- "TraceMiddleware": {
15
- HeaderName: 'X-Request-Id',
16
- },
17
- "PayloadMiddleware": {
18
- "extTypes": {
19
- "json": ['application/json'],
20
- "form": ['application/x-www-form-urlencoded'],
21
- "text": ['text/plain'],
22
- "multipart": ['multipart/form-data'],
23
- "xml": ['text/xml']
24
- },
25
- "limit": '20mb',
26
- "encoding": 'utf-8',
27
- "multiples": true,
28
- "keepExtensions": true
29
- },
30
- }
31
- };
32
- //# sourceMappingURL=middleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/config/middleware.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,kBAAe;IACX,2EAA2E;IAC3E,oCAAoC;IACpC,IAAI,EAAE,EAAE;IACR,MAAM,EAAE;QACJ,iBAAiB,EAAE;YACf,UAAU,EAAE,cAAc;SAC7B;QACD,mBAAmB,EAAE;YACjB,UAAU,EAAE;gBACR,MAAM,EAAE,CAAC,kBAAkB,CAAC;gBAC5B,MAAM,EAAE,CAAC,mCAAmC,CAAC;gBAC7C,MAAM,EAAE,CAAC,YAAY,CAAC;gBACtB,WAAW,EAAE,CAAC,qBAAqB,CAAC;gBACpC,KAAK,EAAE,CAAC,UAAU,CAAC;aACtB;YACD,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,OAAO;YACnB,WAAW,EAAE,IAAI;YACjB,gBAAgB,EAAE,IAAI;SACzB;KACJ;CACJ,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * @ author: richen
3
- * @ copyright: Copyright (c) - <richenlin(at)gmail.com>
4
- * @ license: BSD (3-Clause)
5
- * @ version: 2020-04-30 14:52:34
6
- */
7
- declare const _default: {
8
- list: any[];
9
- config: {};
10
- };
11
- export default _default;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- /**
3
- * @ author: richen
4
- * @ copyright: Copyright (c) - <richenlin(at)gmail.com>
5
- * @ license: BSD (3-Clause)
6
- * @ version: 2020-04-30 14:52:34
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.default = {
10
- // List of loaded plugins, executed in the order of elements
11
- list: [],
12
- config: { // plugin configuration
13
- }
14
- };
15
- //# sourceMappingURL=plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/config/plugin.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,kBAAe;IACX,4DAA4D;IAC5D,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,EAAE,uBAAuB;KAEhC;CACJ,CAAC"}
@@ -1,8 +0,0 @@
1
- declare const _default: {};
2
- /**
3
- * @ author: richen
4
- * @ copyright: Copyright (c) - <richenlin(at)gmail.com>
5
- * @ license: BSD (3-Clause)
6
- * @ version: 2019-11-01 18:37:35
7
- */
8
- export default _default;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * @ author: richen
5
- * @ copyright: Copyright (c) - <richenlin(at)gmail.com>
6
- * @ license: BSD (3-Clause)
7
- * @ version: 2019-11-01 18:37:35
8
- */
9
- exports.default = {
10
- // prefix: string;
11
- /**
12
- * Methods which should be supported by the router.
13
- */
14
- // methods?: string[];
15
- // routerPath?: string;
16
- /**
17
- * Whether or not routing should be case-sensitive.
18
- */
19
- // sensitive?: boolean;
20
- /**
21
- * Whether or not routes should matched strictly.
22
- *
23
- * If strict matching is enabled, the trailing slash is taken into
24
- * account when matching routes.
25
- */
26
- // strict?: boolean;
27
- /**
28
- * Other extended configuration
29
- */
30
- // ext?: any;
31
- };
32
- //# sourceMappingURL=router.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/config/router.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,kBAAe;AACX,kBAAkB;AAElB;;GAEG;AACH,sBAAsB;AAEtB,uBAAuB;AAEvB;;GAEG;AACH,uBAAuB;AAEvB;;;;;GAKG;AACH,oBAAoB;AAEpB;;GAEG;AACH,aAAa;CAChB,CAAC"}
@@ -1,60 +0,0 @@
1
- import { Koatty, KoattyContext } from 'koatty_core';
2
- import { ObjectDefinitionOptions } from "koatty_container";
3
- import { ApiInput, ApiOutput, IController } from '../core/Component';
4
- /**
5
- * Base controller
6
- *
7
- * @export
8
- * @class BaseController
9
- * @implements {IController}
10
- */
11
- export declare class BaseController implements IController {
12
- app: Koatty;
13
- ctx: KoattyContext;
14
- protected _options: ObjectDefinitionOptions;
15
- /**
16
- * instance of BaseController.
17
- * @param {Koatty} app
18
- * @param {KoattyContext} ctx
19
- * @memberof BaseController
20
- */
21
- protected constructor(ctx: KoattyContext);
22
- /**
23
- * init
24
- *
25
- * @protected
26
- * @memberof BaseController
27
- */
28
- protected init(): void;
29
- /**
30
- * Format api interface data format
31
- *
32
- * @private
33
- * @param {Error | string | ApiInput} msg 待处理的接口数据信息|接口msg
34
- * @param {*} data 待返回的数据
35
- * @param {number} defaultCode 默认错误码
36
- * @returns {ApiOutput} 格式化之后的接口数据
37
- * @memberof BaseController
38
- */
39
- protected formatApiData(msg: any, data: any, defaultCode: number): ApiOutput;
40
- /**
41
- * Response to normalize json format content for success
42
- *
43
- * @param {(string | ApiInput)} msg 待处理的message消息
44
- * @param {*} [data] 待处理的数据
45
- * @param {number} [code=200] 错误码,默认0
46
- * @returns {Promise<ApiOutput>}
47
- * @memberof BaseController
48
- */
49
- ok(msg: string | ApiInput, data?: any, code?: number): Promise<ApiOutput>;
50
- /**
51
- * Response to normalize json format content for fail
52
- *
53
- * @param {(string | ApiInput)} msg
54
- * @param {*} [data]
55
- * @param {number} [code=1]
56
- * @returns {Promise<ApiOutput>}
57
- * @memberof BaseController
58
- */
59
- fail(msg: Error | string | ApiInput, data?: any, code?: number): Promise<ApiOutput>;
60
- }