koatty 3.10.4-3 → 3.10.4-5
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/CHANGELOG.md +14 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +87 -93
- package/dist/index.mjs +82 -83
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,20 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
4
4
|
|
5
|
+
### [3.10.4-5](https://github.com/thinkkoa/koatty/compare/v3.10.4-4...v3.10.4-5) (2023-12-23)
|
6
|
+
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
* KoattyMiddleware ([50dd7f5](https://github.com/thinkkoa/koatty/commit/50dd7f57fc6824127443ddfc614d5f61e83530ed))
|
11
|
+
|
12
|
+
### [3.10.4-4](https://github.com/thinkkoa/koatty/compare/v3.10.4-3...v3.10.4-4) (2023-12-23)
|
13
|
+
|
14
|
+
|
15
|
+
### Bug Fixes
|
16
|
+
|
17
|
+
* remove export ([b2eed18](https://github.com/thinkkoa/koatty/commit/b2eed18017838e9e91394f91cd60ea9790c59920))
|
18
|
+
|
5
19
|
### [3.10.4-3](https://github.com/thinkkoa/koatty/compare/v3.10.4-2...v3.10.4-3) (2023-12-16)
|
6
20
|
|
7
21
|
|
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
* @Author: richen
|
3
|
-
* @Date: 2023-12-
|
3
|
+
* @Date: 2023-12-23 11:42:32
|
4
4
|
* @License: BSD (3-Clause)
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
6
6
|
* @HomePage: https://koatty.org/
|
@@ -11,8 +11,8 @@ import { EventHookFunc } from 'koatty_core';
|
|
11
11
|
import { Helper } from 'koatty_lib';
|
12
12
|
import { Koatty } from 'koatty_core';
|
13
13
|
import { KoattyContext } from 'koatty_core';
|
14
|
-
import { KoattyNext } from 'koatty_core';
|
15
14
|
import { Logger as Logger_2 } from 'koatty_logger';
|
15
|
+
import { Middleware as Middleware_2 } from 'koa';
|
16
16
|
import { Value } from 'koatty_config';
|
17
17
|
|
18
18
|
/**
|
@@ -212,7 +212,8 @@ export declare interface IService {
|
|
212
212
|
/**
|
213
213
|
* Interface for Middleware
|
214
214
|
*/
|
215
|
-
export declare
|
215
|
+
export declare interface KoattyMiddleware extends Middleware_2 {
|
216
|
+
}
|
216
217
|
|
217
218
|
export declare const Logger: Logger_2;
|
218
219
|
|
@@ -250,6 +251,5 @@ export * from "koatty_container";
|
|
250
251
|
export * from "koatty_core";
|
251
252
|
export * from "koatty_exception";
|
252
253
|
export * from "koatty_serve";
|
253
|
-
export * from "koatty_trace";
|
254
254
|
|
255
255
|
export { }
|
package/dist/index.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
/*!
|
2
2
|
* @Author: richen
|
3
|
-
* @Date: 2023-12-
|
3
|
+
* @Date: 2023-12-23 11:42:17
|
4
4
|
* @License: BSD (3-Clause)
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
6
6
|
* @HomePage: https://koatty.org/
|
7
7
|
*/
|
8
8
|
'use strict';
|
9
9
|
|
10
|
+
var koatty_container = require('koatty_container');
|
10
11
|
var koatty_core = require('koatty_core');
|
12
|
+
var koatty_serve = require('koatty_serve');
|
11
13
|
var path = require('path');
|
12
14
|
var koatty_loader = require('koatty_loader');
|
15
|
+
var koatty_exception = require('koatty_exception');
|
13
16
|
var koatty_config = require('koatty_config');
|
17
|
+
var koatty_trace = require('koatty_trace');
|
14
18
|
var koatty_lib = require('koatty_lib');
|
15
19
|
var koatty_logger = require('koatty_logger');
|
16
|
-
var koatty_exception = require('koatty_exception');
|
17
|
-
var koatty_container = require('koatty_container');
|
18
|
-
var koatty_trace = require('koatty_trace');
|
19
|
-
var koatty_serve = require('koatty_serve');
|
20
20
|
require('reflect-metadata');
|
21
21
|
|
22
22
|
function _interopNamespaceDefault(e) {
|
@@ -38,39 +38,21 @@ function _interopNamespaceDefault(e) {
|
|
38
38
|
|
39
39
|
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
* @param {{
|
57
|
-
* logLevel?: LogLevelType;
|
58
|
-
* logFilePath?: string;
|
59
|
-
* sensFields?: string[];
|
60
|
-
* }} config
|
61
|
-
*/
|
62
|
-
function SetLogger(app, config) {
|
63
|
-
if (config.logLevel) {
|
64
|
-
koatty_logger.DefaultLogger.setLevel(config.logLevel);
|
65
|
-
}
|
66
|
-
if (config.logFilePath && !app.silent) {
|
67
|
-
koatty_lib.Helper.define(app, "logsPath", config.logFilePath);
|
68
|
-
process.env.LOGS_PATH = config.logFilePath;
|
69
|
-
koatty_logger.DefaultLogger.setLogFilePath(config.logFilePath);
|
70
|
-
}
|
71
|
-
if (config.sensFields) {
|
72
|
-
koatty_logger.DefaultLogger.setSensFields(config.sensFields);
|
73
|
-
}
|
41
|
+
async function TraceHandler(app) {
|
42
|
+
const timeout = (app.config('http_timeout') || 10) * 1000;
|
43
|
+
const encoding = app.config('encoding') || 'utf-8';
|
44
|
+
const openTrace = app.config("open_trace") || false;
|
45
|
+
const asyncHooks = app.config("async_hooks") || false;
|
46
|
+
const options = {
|
47
|
+
RequestIdHeaderName: app.config('trace_header') || 'X-Request-Id',
|
48
|
+
RequestIdName: app.config('trace_id') || "requestId",
|
49
|
+
IdFactory: undefined,
|
50
|
+
Timeout: timeout,
|
51
|
+
Encoding: encoding,
|
52
|
+
OpenTrace: openTrace,
|
53
|
+
AsyncHooks: asyncHooks,
|
54
|
+
};
|
55
|
+
app.use(await koatty_trace.Trace(options, app));
|
74
56
|
}
|
75
57
|
|
76
58
|
/*
|
@@ -149,27 +131,6 @@ function formatApiData(msg, data, defaultCode) {
|
|
149
131
|
return obj;
|
150
132
|
}
|
151
133
|
|
152
|
-
/*
|
153
|
-
* @Description: framework constants
|
154
|
-
* @Usage:
|
155
|
-
* @Author: richen
|
156
|
-
* @Date: 2023-12-09 21:56:32
|
157
|
-
* @LastEditTime: 2023-12-09 23:00:13
|
158
|
-
* @License: BSD (3-Clause)
|
159
|
-
* @Copyright (c): <richenlin(at)gmail.com>
|
160
|
-
*/
|
161
|
-
const COMPONENT_SCAN = 'COMPONENT_SCAN';
|
162
|
-
const CONFIGURATION_SCAN = 'CONFIGURATION_SCAN';
|
163
|
-
// tslint:disable: no-irregular-whitespace
|
164
|
-
const LOGO = `
|
165
|
-
|
166
|
-
┬┌─┌─┐┌─┐┌┬┐┌┬┐┬ ┬
|
167
|
-
├┴┐│ │├─┤ │ │ └┬┘
|
168
|
-
┴ ┴└─┘┴ ┴ ┴ ┴ ┴
|
169
|
-
-------------------------------------------
|
170
|
-
https://github.com/koatty
|
171
|
-
`;
|
172
|
-
|
173
134
|
/*
|
174
135
|
* @Description: base controller
|
175
136
|
* @Usage:
|
@@ -256,29 +217,68 @@ class BaseController {
|
|
256
217
|
// }
|
257
218
|
// });
|
258
219
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
220
|
+
/*
|
221
|
+
* @Description: framework logger
|
222
|
+
* @Usage:
|
223
|
+
* @Author: richen
|
224
|
+
* @Date: 2023-12-09 21:56:32
|
225
|
+
* @LastEditTime: 2023-12-09 23:02:27
|
226
|
+
* @License: BSD (3-Clause)
|
227
|
+
* @Copyright (c): <richenlin(at)gmail.com>
|
228
|
+
*/
|
229
|
+
// Logger
|
230
|
+
const Logger = koatty_logger.DefaultLogger;
|
231
|
+
/**
|
232
|
+
* SetLogger
|
233
|
+
*
|
234
|
+
* @export
|
235
|
+
* @param {{
|
236
|
+
* logLevel?: LogLevelType;
|
237
|
+
* logFilePath?: string;
|
238
|
+
* sensFields?: string[];
|
239
|
+
* }} config
|
240
|
+
*/
|
241
|
+
function SetLogger(app, config) {
|
242
|
+
if (config.logLevel) {
|
243
|
+
koatty_logger.DefaultLogger.setLevel(config.logLevel);
|
244
|
+
}
|
245
|
+
if (config.logFilePath && !app.silent) {
|
246
|
+
koatty_lib.Helper.define(app, "logsPath", config.logFilePath);
|
247
|
+
process.env.LOGS_PATH = config.logFilePath;
|
248
|
+
koatty_logger.DefaultLogger.setLogFilePath(config.logFilePath);
|
249
|
+
}
|
250
|
+
if (config.sensFields) {
|
251
|
+
koatty_logger.DefaultLogger.setSensFields(config.sensFields);
|
252
|
+
}
|
274
253
|
}
|
275
254
|
|
255
|
+
/*
|
256
|
+
* @Description: framework constants
|
257
|
+
* @Usage:
|
258
|
+
* @Author: richen
|
259
|
+
* @Date: 2023-12-09 21:56:32
|
260
|
+
* @LastEditTime: 2023-12-09 23:00:13
|
261
|
+
* @License: BSD (3-Clause)
|
262
|
+
* @Copyright (c): <richenlin(at)gmail.com>
|
263
|
+
*/
|
264
|
+
const COMPONENT_SCAN = 'COMPONENT_SCAN';
|
265
|
+
const CONFIGURATION_SCAN = 'CONFIGURATION_SCAN';
|
266
|
+
// tslint:disable: no-irregular-whitespace
|
267
|
+
const LOGO = `
|
268
|
+
|
269
|
+
┬┌─┌─┐┌─┐┌┬┐┌┬┐┬ ┬
|
270
|
+
├┴┐│ │├─┤ │ │ └┬┘
|
271
|
+
┴ ┴└─┘┴ ┴ ┴ ┴ ┴
|
272
|
+
-------------------------------------------
|
273
|
+
https://github.com/koatty
|
274
|
+
`;
|
275
|
+
|
276
276
|
/*
|
277
277
|
* @Description: framework loader
|
278
278
|
* @Usage:
|
279
279
|
* @Author: richen
|
280
280
|
* @Date: 2023-12-09 22:55:49
|
281
|
-
* @LastEditTime: 2023-12-
|
281
|
+
* @LastEditTime: 2023-12-22 07:31:21
|
282
282
|
* @License: BSD (3-Clause)
|
283
283
|
* @Copyright (c): <richenlin(at)gmail.com>
|
284
284
|
*/
|
@@ -508,7 +508,7 @@ class Loader {
|
|
508
508
|
* @memberof Loader
|
509
509
|
*/
|
510
510
|
static async LoadMiddlewares(app, loadPath) {
|
511
|
-
// Error
|
511
|
+
// Error handling middleware
|
512
512
|
await TraceHandler(app);
|
513
513
|
let middlewareConf = app.config(undefined, "middleware");
|
514
514
|
if (koatty_lib.Helper.isEmpty(middlewareConf)) {
|
@@ -662,7 +662,7 @@ class Loader {
|
|
662
662
|
}
|
663
663
|
}
|
664
664
|
|
665
|
-
var version = "3.10.4-
|
665
|
+
var version = "3.10.4-5";
|
666
666
|
var engines = {
|
667
667
|
node: ">12.0.0"
|
668
668
|
};
|
@@ -715,7 +715,7 @@ const checkUTRuntime = () => {
|
|
715
715
|
* @Usage:
|
716
716
|
* @Author: richen
|
717
717
|
* @Date: 2023-12-09 21:56:32
|
718
|
-
* @LastEditTime: 2023-12-
|
718
|
+
* @LastEditTime: 2023-12-22 07:31:53
|
719
719
|
* @License: BSD (3-Clause)
|
720
720
|
* @Copyright (c): <richenlin(at)gmail.com>
|
721
721
|
*/
|
@@ -929,7 +929,7 @@ function BindEventHook(eventName, eventFunc, target) {
|
|
929
929
|
* @Usage:
|
930
930
|
* @Author: richen
|
931
931
|
* @Date: 2023-12-09 21:56:32
|
932
|
-
* @LastEditTime: 2023-12-
|
932
|
+
* @LastEditTime: 2023-12-23 11:40:44
|
933
933
|
* @License: BSD (3-Clause)
|
934
934
|
* @Copyright (c): <richenlin(at)gmail.com>
|
935
935
|
*/
|
@@ -1065,28 +1065,16 @@ exports.Logger = Logger;
|
|
1065
1065
|
exports.Middleware = Middleware;
|
1066
1066
|
exports.Plugin = Plugin;
|
1067
1067
|
exports.Service = Service;
|
1068
|
-
Object.keys(koatty_core).forEach(function (k) {
|
1069
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
1070
|
-
enumerable: true,
|
1071
|
-
get: function () { return koatty_core[k]; }
|
1072
|
-
});
|
1073
|
-
});
|
1074
|
-
Object.keys(koatty_exception).forEach(function (k) {
|
1075
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
1076
|
-
enumerable: true,
|
1077
|
-
get: function () { return koatty_exception[k]; }
|
1078
|
-
});
|
1079
|
-
});
|
1080
1068
|
Object.keys(koatty_container).forEach(function (k) {
|
1081
1069
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
1082
1070
|
enumerable: true,
|
1083
1071
|
get: function () { return koatty_container[k]; }
|
1084
1072
|
});
|
1085
1073
|
});
|
1086
|
-
Object.keys(
|
1074
|
+
Object.keys(koatty_core).forEach(function (k) {
|
1087
1075
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
1088
1076
|
enumerable: true,
|
1089
|
-
get: function () { return
|
1077
|
+
get: function () { return koatty_core[k]; }
|
1090
1078
|
});
|
1091
1079
|
});
|
1092
1080
|
Object.keys(koatty_serve).forEach(function (k) {
|
@@ -1095,3 +1083,9 @@ Object.keys(koatty_serve).forEach(function (k) {
|
|
1095
1083
|
get: function () { return koatty_serve[k]; }
|
1096
1084
|
});
|
1097
1085
|
});
|
1086
|
+
Object.keys(koatty_exception).forEach(function (k) {
|
1087
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
1088
|
+
enumerable: true,
|
1089
|
+
get: function () { return koatty_exception[k]; }
|
1090
|
+
});
|
1091
|
+
});
|
package/dist/index.mjs
CHANGED
@@ -1,62 +1,43 @@
|
|
1
1
|
/*!
|
2
2
|
* @Author: richen
|
3
|
-
* @Date: 2023-12-
|
3
|
+
* @Date: 2023-12-23 11:42:17
|
4
4
|
* @License: BSD (3-Clause)
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
6
6
|
* @HomePage: https://koatty.org/
|
7
7
|
*/
|
8
|
+
import { IOCContainer, TAGGED_CLS } from 'koatty_container';
|
9
|
+
export * from 'koatty_container';
|
8
10
|
import { AppEventArr, Koatty } from 'koatty_core';
|
9
11
|
export * from 'koatty_core';
|
12
|
+
import { NewServe, NewRouter, BindProcessEvent, CONTROLLER_ROUTER } from 'koatty_serve';
|
13
|
+
export * from 'koatty_serve';
|
10
14
|
import * as path from 'path';
|
11
15
|
import { Load } from 'koatty_loader';
|
16
|
+
import { prevent } from 'koatty_exception';
|
17
|
+
export * from 'koatty_exception';
|
12
18
|
import { LoadConfigs } from 'koatty_config';
|
13
19
|
export { Config, Value } from 'koatty_config';
|
20
|
+
import { Trace } from 'koatty_trace';
|
14
21
|
import { Helper } from 'koatty_lib';
|
15
22
|
export { Helper } from 'koatty_lib';
|
16
23
|
import { DefaultLogger } from 'koatty_logger';
|
17
|
-
import { prevent } from 'koatty_exception';
|
18
|
-
export * from 'koatty_exception';
|
19
|
-
import { IOCContainer, TAGGED_CLS } from 'koatty_container';
|
20
|
-
export * from 'koatty_container';
|
21
|
-
import { Trace } from 'koatty_trace';
|
22
|
-
export * from 'koatty_trace';
|
23
|
-
import { NewServe, NewRouter, BindProcessEvent, CONTROLLER_ROUTER } from 'koatty_serve';
|
24
|
-
export * from 'koatty_serve';
|
25
24
|
import 'reflect-metadata';
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
* @param {{
|
43
|
-
* logLevel?: LogLevelType;
|
44
|
-
* logFilePath?: string;
|
45
|
-
* sensFields?: string[];
|
46
|
-
* }} config
|
47
|
-
*/
|
48
|
-
function SetLogger(app, config) {
|
49
|
-
if (config.logLevel) {
|
50
|
-
DefaultLogger.setLevel(config.logLevel);
|
51
|
-
}
|
52
|
-
if (config.logFilePath && !app.silent) {
|
53
|
-
Helper.define(app, "logsPath", config.logFilePath);
|
54
|
-
process.env.LOGS_PATH = config.logFilePath;
|
55
|
-
DefaultLogger.setLogFilePath(config.logFilePath);
|
56
|
-
}
|
57
|
-
if (config.sensFields) {
|
58
|
-
DefaultLogger.setSensFields(config.sensFields);
|
59
|
-
}
|
26
|
+
async function TraceHandler(app) {
|
27
|
+
const timeout = (app.config('http_timeout') || 10) * 1000;
|
28
|
+
const encoding = app.config('encoding') || 'utf-8';
|
29
|
+
const openTrace = app.config("open_trace") || false;
|
30
|
+
const asyncHooks = app.config("async_hooks") || false;
|
31
|
+
const options = {
|
32
|
+
RequestIdHeaderName: app.config('trace_header') || 'X-Request-Id',
|
33
|
+
RequestIdName: app.config('trace_id') || "requestId",
|
34
|
+
IdFactory: undefined,
|
35
|
+
Timeout: timeout,
|
36
|
+
Encoding: encoding,
|
37
|
+
OpenTrace: openTrace,
|
38
|
+
AsyncHooks: asyncHooks,
|
39
|
+
};
|
40
|
+
app.use(await Trace(options, app));
|
60
41
|
}
|
61
42
|
|
62
43
|
/*
|
@@ -135,27 +116,6 @@ function formatApiData(msg, data, defaultCode) {
|
|
135
116
|
return obj;
|
136
117
|
}
|
137
118
|
|
138
|
-
/*
|
139
|
-
* @Description: framework constants
|
140
|
-
* @Usage:
|
141
|
-
* @Author: richen
|
142
|
-
* @Date: 2023-12-09 21:56:32
|
143
|
-
* @LastEditTime: 2023-12-09 23:00:13
|
144
|
-
* @License: BSD (3-Clause)
|
145
|
-
* @Copyright (c): <richenlin(at)gmail.com>
|
146
|
-
*/
|
147
|
-
const COMPONENT_SCAN = 'COMPONENT_SCAN';
|
148
|
-
const CONFIGURATION_SCAN = 'CONFIGURATION_SCAN';
|
149
|
-
// tslint:disable: no-irregular-whitespace
|
150
|
-
const LOGO = `
|
151
|
-
|
152
|
-
┬┌─┌─┐┌─┐┌┬┐┌┬┐┬ ┬
|
153
|
-
├┴┐│ │├─┤ │ │ └┬┘
|
154
|
-
┴ ┴└─┘┴ ┴ ┴ ┴ ┴
|
155
|
-
-------------------------------------------
|
156
|
-
https://github.com/koatty
|
157
|
-
`;
|
158
|
-
|
159
119
|
/*
|
160
120
|
* @Description: base controller
|
161
121
|
* @Usage:
|
@@ -242,29 +202,68 @@ class BaseController {
|
|
242
202
|
// }
|
243
203
|
// });
|
244
204
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
205
|
+
/*
|
206
|
+
* @Description: framework logger
|
207
|
+
* @Usage:
|
208
|
+
* @Author: richen
|
209
|
+
* @Date: 2023-12-09 21:56:32
|
210
|
+
* @LastEditTime: 2023-12-09 23:02:27
|
211
|
+
* @License: BSD (3-Clause)
|
212
|
+
* @Copyright (c): <richenlin(at)gmail.com>
|
213
|
+
*/
|
214
|
+
// Logger
|
215
|
+
const Logger = DefaultLogger;
|
216
|
+
/**
|
217
|
+
* SetLogger
|
218
|
+
*
|
219
|
+
* @export
|
220
|
+
* @param {{
|
221
|
+
* logLevel?: LogLevelType;
|
222
|
+
* logFilePath?: string;
|
223
|
+
* sensFields?: string[];
|
224
|
+
* }} config
|
225
|
+
*/
|
226
|
+
function SetLogger(app, config) {
|
227
|
+
if (config.logLevel) {
|
228
|
+
DefaultLogger.setLevel(config.logLevel);
|
229
|
+
}
|
230
|
+
if (config.logFilePath && !app.silent) {
|
231
|
+
Helper.define(app, "logsPath", config.logFilePath);
|
232
|
+
process.env.LOGS_PATH = config.logFilePath;
|
233
|
+
DefaultLogger.setLogFilePath(config.logFilePath);
|
234
|
+
}
|
235
|
+
if (config.sensFields) {
|
236
|
+
DefaultLogger.setSensFields(config.sensFields);
|
237
|
+
}
|
260
238
|
}
|
261
239
|
|
240
|
+
/*
|
241
|
+
* @Description: framework constants
|
242
|
+
* @Usage:
|
243
|
+
* @Author: richen
|
244
|
+
* @Date: 2023-12-09 21:56:32
|
245
|
+
* @LastEditTime: 2023-12-09 23:00:13
|
246
|
+
* @License: BSD (3-Clause)
|
247
|
+
* @Copyright (c): <richenlin(at)gmail.com>
|
248
|
+
*/
|
249
|
+
const COMPONENT_SCAN = 'COMPONENT_SCAN';
|
250
|
+
const CONFIGURATION_SCAN = 'CONFIGURATION_SCAN';
|
251
|
+
// tslint:disable: no-irregular-whitespace
|
252
|
+
const LOGO = `
|
253
|
+
|
254
|
+
┬┌─┌─┐┌─┐┌┬┐┌┬┐┬ ┬
|
255
|
+
├┴┐│ │├─┤ │ │ └┬┘
|
256
|
+
┴ ┴└─┘┴ ┴ ┴ ┴ ┴
|
257
|
+
-------------------------------------------
|
258
|
+
https://github.com/koatty
|
259
|
+
`;
|
260
|
+
|
262
261
|
/*
|
263
262
|
* @Description: framework loader
|
264
263
|
* @Usage:
|
265
264
|
* @Author: richen
|
266
265
|
* @Date: 2023-12-09 22:55:49
|
267
|
-
* @LastEditTime: 2023-12-
|
266
|
+
* @LastEditTime: 2023-12-22 07:31:21
|
268
267
|
* @License: BSD (3-Clause)
|
269
268
|
* @Copyright (c): <richenlin(at)gmail.com>
|
270
269
|
*/
|
@@ -494,7 +493,7 @@ class Loader {
|
|
494
493
|
* @memberof Loader
|
495
494
|
*/
|
496
495
|
static async LoadMiddlewares(app, loadPath) {
|
497
|
-
// Error
|
496
|
+
// Error handling middleware
|
498
497
|
await TraceHandler(app);
|
499
498
|
let middlewareConf = app.config(undefined, "middleware");
|
500
499
|
if (Helper.isEmpty(middlewareConf)) {
|
@@ -648,7 +647,7 @@ class Loader {
|
|
648
647
|
}
|
649
648
|
}
|
650
649
|
|
651
|
-
var version = "3.10.4-
|
650
|
+
var version = "3.10.4-5";
|
652
651
|
var engines = {
|
653
652
|
node: ">12.0.0"
|
654
653
|
};
|
@@ -701,7 +700,7 @@ const checkUTRuntime = () => {
|
|
701
700
|
* @Usage:
|
702
701
|
* @Author: richen
|
703
702
|
* @Date: 2023-12-09 21:56:32
|
704
|
-
* @LastEditTime: 2023-12-
|
703
|
+
* @LastEditTime: 2023-12-22 07:31:53
|
705
704
|
* @License: BSD (3-Clause)
|
706
705
|
* @Copyright (c): <richenlin(at)gmail.com>
|
707
706
|
*/
|
@@ -915,7 +914,7 @@ function BindEventHook(eventName, eventFunc, target) {
|
|
915
914
|
* @Usage:
|
916
915
|
* @Author: richen
|
917
916
|
* @Date: 2023-12-09 21:56:32
|
918
|
-
* @LastEditTime: 2023-12-
|
917
|
+
* @LastEditTime: 2023-12-23 11:40:44
|
919
918
|
* @License: BSD (3-Clause)
|
920
919
|
* @Copyright (c): <richenlin(at)gmail.com>
|
921
920
|
*/
|
package/dist/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "koatty",
|
3
|
-
"version": "3.10.4-
|
3
|
+
"version": "3.10.4-5",
|
4
4
|
"description": "Koa2 + Typescript = koatty. Use Typescript's decorator implement auto injection.",
|
5
5
|
"scripts": {
|
6
6
|
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "koatty",
|
3
|
-
"version": "3.10.4-
|
3
|
+
"version": "3.10.4-5",
|
4
4
|
"description": "Koa2 + Typescript = koatty. Use Typescript's decorator implement auto injection.",
|
5
5
|
"scripts": {
|
6
6
|
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|