koatty 3.5.7 → 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 +5 -9
- 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 +40 -39
- 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 -21
- package/dist/config/config.js +0 -25
- package/dist/config/config.js.map +0 -1
- package/dist/config/middleware.d.ts +0 -23
- package/dist/config/middleware.js +0 -34
- 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 -215
- package/dist/controller/HttpController.js.map +0 -1
- package/dist/core/Bootstrap.d.ts +0 -50
- package/dist/core/Bootstrap.js +0 -217
- 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 -407
- 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
package/dist/core/Bootstrap.js
DELETED
@@ -1,217 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BindAppReadyHook = exports.ConfigurationScan = exports.ComponentScan = exports.Bootstrap = void 0;
|
4
|
-
/**
|
5
|
-
* @ author: richen
|
6
|
-
* @ copyright: Copyright (c) - <richenlin(at)gmail.com>
|
7
|
-
* @ license: BSD (3-Clause)
|
8
|
-
* @ version: 2020-07-06 11:22:58
|
9
|
-
*/
|
10
|
-
// tslint:disable-next-line: no-import-side-effect
|
11
|
-
require("reflect-metadata");
|
12
|
-
const koatty_core_1 = require("koatty_core");
|
13
|
-
const Loader_1 = require("./Loader");
|
14
|
-
const Helper_1 = require("../util/Helper");
|
15
|
-
const Logger_1 = require("../util/Logger");
|
16
|
-
const koatty_container_1 = require("koatty_container");
|
17
|
-
const koatty_serve_1 = require("koatty_serve");
|
18
|
-
const Constants_1 = require("./Constants");
|
19
|
-
const koatty_router_1 = require("koatty_router");
|
20
|
-
const pkg = require("../../package.json");
|
21
|
-
/**
|
22
|
-
* execute bootstrap
|
23
|
-
*
|
24
|
-
* @param {*} target
|
25
|
-
* @param {Function} bootFunc
|
26
|
-
* @returns {Promise<void>}
|
27
|
-
*/
|
28
|
-
const ExecBootstrap = async function (target, bootFunc) {
|
29
|
-
// checked runtime
|
30
|
-
(0, Helper_1.checkRuntime)();
|
31
|
-
const app = Reflect.construct(target, []);
|
32
|
-
try {
|
33
|
-
console.log(Constants_1.LOGO);
|
34
|
-
Logger_1.Logger.Custom('think', '', '====================================');
|
35
|
-
Logger_1.Logger.Custom('think', '', 'Bootstrap');
|
36
|
-
if (!(app instanceof koatty_core_1.Koatty)) {
|
37
|
-
throw new Error(`class ${target.name} does not inherit from Koatty`);
|
38
|
-
}
|
39
|
-
// version
|
40
|
-
Helper_1.Helper.define(app, "version", pkg.version);
|
41
|
-
// exec bootFunc
|
42
|
-
if (Helper_1.Helper.isFunction(bootFunc)) {
|
43
|
-
Logger_1.Logger.Custom('think', '', 'Execute bootFunc ...');
|
44
|
-
await bootFunc(app);
|
45
|
-
}
|
46
|
-
// Initialize env
|
47
|
-
Loader_1.Loader.initialize(app);
|
48
|
-
// Set IOC.app
|
49
|
-
koatty_container_1.IOCContainer.setApp(app);
|
50
|
-
Helper_1.Helper.define(app, "container", koatty_container_1.IOCContainer);
|
51
|
-
Logger_1.Logger.Custom('think', '', 'ComponentScan ...');
|
52
|
-
// Check all bean
|
53
|
-
Loader_1.Loader.CheckAllComponents(app, target);
|
54
|
-
// Load configuration
|
55
|
-
Logger_1.Logger.Custom('think', '', 'Load Configurations ...');
|
56
|
-
// configuration metadata
|
57
|
-
const configurationMetas = Loader_1.Loader.GetConfigurationMetas(app, target);
|
58
|
-
Loader_1.Loader.LoadConfigs(app, configurationMetas);
|
59
|
-
// Load Plugin
|
60
|
-
Logger_1.Logger.Custom('think', '', 'Load Plugins ...');
|
61
|
-
await Loader_1.Loader.LoadPlugins(app);
|
62
|
-
// Set Logger
|
63
|
-
Loader_1.Loader.SetLogger(app);
|
64
|
-
// Load App ready hooks
|
65
|
-
Loader_1.Loader.LoadAppReadyHooks(app, target);
|
66
|
-
// New router
|
67
|
-
const KoattyRouter = newRouter(app);
|
68
|
-
// Load Middleware
|
69
|
-
Logger_1.Logger.Custom('think', '', 'Load Middlewares ...');
|
70
|
-
await Loader_1.Loader.LoadMiddlewares(app);
|
71
|
-
// Emit app ready event
|
72
|
-
Logger_1.Logger.Custom('think', '', 'Emit App Ready ...');
|
73
|
-
// app.emit("appReady");
|
74
|
-
await asyncEvent(app, 'appReady');
|
75
|
-
// Load Components
|
76
|
-
Logger_1.Logger.Custom('think', '', 'Load Components ...');
|
77
|
-
Loader_1.Loader.LoadComponents(app);
|
78
|
-
// Load Services
|
79
|
-
Logger_1.Logger.Custom('think', '', 'Load Services ...');
|
80
|
-
Loader_1.Loader.LoadServices(app);
|
81
|
-
// Load Controllers
|
82
|
-
Logger_1.Logger.Custom('think', '', 'Load Controllers ...');
|
83
|
-
Loader_1.Loader.LoadControllers(app);
|
84
|
-
// Load Routers
|
85
|
-
Logger_1.Logger.Custom('think', '', 'Load Routers ...');
|
86
|
-
KoattyRouter.LoadRouter(app.getMetaData("_controllers"));
|
87
|
-
// Emit app started event
|
88
|
-
Logger_1.Logger.Custom('think', '', 'Emit App Start ...');
|
89
|
-
// app.emit("appStart");
|
90
|
-
await asyncEvent(app, 'appStart');
|
91
|
-
Logger_1.Logger.Custom('think', '', '====================================');
|
92
|
-
// Start server
|
93
|
-
app.listen(newServe(app));
|
94
|
-
// binding event "appStop"
|
95
|
-
(0, koatty_serve_1.BindProcessEvent)(app, 'appStop');
|
96
|
-
}
|
97
|
-
catch (err) {
|
98
|
-
Logger_1.Logger.Error(err);
|
99
|
-
process.exit();
|
100
|
-
}
|
101
|
-
};
|
102
|
-
/**
|
103
|
-
* create router
|
104
|
-
*
|
105
|
-
* @export
|
106
|
-
* @param {Koatty} app
|
107
|
-
* @returns {*}
|
108
|
-
*/
|
109
|
-
const newRouter = function (app) {
|
110
|
-
var _a;
|
111
|
-
const protocol = app.config("protocol") || "http";
|
112
|
-
const options = (_a = app.config(undefined, 'router')) !== null && _a !== void 0 ? _a : {};
|
113
|
-
const router = (0, koatty_router_1.NewRouter)(app, options, protocol);
|
114
|
-
Helper_1.Helper.define(app, "router", router);
|
115
|
-
return router;
|
116
|
-
};
|
117
|
-
/**
|
118
|
-
* create serve
|
119
|
-
*
|
120
|
-
* @param {Koatty} app
|
121
|
-
* @returns {*}
|
122
|
-
*/
|
123
|
-
const newServe = function (app) {
|
124
|
-
const protocol = app.config("protocol") || "http";
|
125
|
-
const server = (0, koatty_serve_1.Serve)(app, protocol);
|
126
|
-
Helper_1.Helper.define(app, "server", server);
|
127
|
-
return server;
|
128
|
-
};
|
129
|
-
/**
|
130
|
-
* Execute event as async
|
131
|
-
*
|
132
|
-
* @param {Koatty} event
|
133
|
-
* @param {string} eventName
|
134
|
-
*/
|
135
|
-
const asyncEvent = async function (event, eventName) {
|
136
|
-
const ls = event.listeners(eventName);
|
137
|
-
// eslint-disable-next-line no-restricted-syntax
|
138
|
-
for await (const func of ls) {
|
139
|
-
if (Helper_1.Helper.isFunction(func)) {
|
140
|
-
func();
|
141
|
-
}
|
142
|
-
}
|
143
|
-
return event.removeAllListeners(eventName);
|
144
|
-
};
|
145
|
-
/**
|
146
|
-
* Bootstrap application
|
147
|
-
*
|
148
|
-
* @export
|
149
|
-
* @param {Function} [bootFunc]
|
150
|
-
* @returns {ClassDecorator}
|
151
|
-
*/
|
152
|
-
function Bootstrap(bootFunc) {
|
153
|
-
return function (target) {
|
154
|
-
if (!(target.prototype instanceof koatty_core_1.Koatty)) {
|
155
|
-
throw new Error(`class does not inherit from Koatty`);
|
156
|
-
}
|
157
|
-
ExecBootstrap(target, bootFunc);
|
158
|
-
};
|
159
|
-
}
|
160
|
-
exports.Bootstrap = Bootstrap;
|
161
|
-
/**
|
162
|
-
* Define project scan path
|
163
|
-
*
|
164
|
-
* @export
|
165
|
-
* @param {(string | string[])} [scanPath]
|
166
|
-
* @returns {ClassDecorator}
|
167
|
-
*/
|
168
|
-
function ComponentScan(scanPath) {
|
169
|
-
Logger_1.Logger.Custom('think', '', 'ComponentScan');
|
170
|
-
return (target) => {
|
171
|
-
if (!(target.prototype instanceof koatty_core_1.Koatty)) {
|
172
|
-
throw new Error(`class does not inherit from Koatty`);
|
173
|
-
}
|
174
|
-
scanPath = scanPath !== null && scanPath !== void 0 ? scanPath : '';
|
175
|
-
koatty_container_1.IOCContainer.saveClassMetadata(koatty_container_1.TAGGED_CLS, Constants_1.COMPONENT_SCAN, scanPath, target);
|
176
|
-
};
|
177
|
-
}
|
178
|
-
exports.ComponentScan = ComponentScan;
|
179
|
-
/**
|
180
|
-
* Define project configuration scan path
|
181
|
-
*
|
182
|
-
* @export
|
183
|
-
* @param {(string | string[])} [scanPath]
|
184
|
-
* @returns {ClassDecorator}
|
185
|
-
*/
|
186
|
-
function ConfigurationScan(scanPath) {
|
187
|
-
Logger_1.Logger.Custom('think', '', 'ConfigurationScan');
|
188
|
-
return (target) => {
|
189
|
-
if (!(target.prototype instanceof koatty_core_1.Koatty)) {
|
190
|
-
throw new Error(`class does not inherit from Koatty`);
|
191
|
-
}
|
192
|
-
scanPath = scanPath !== null && scanPath !== void 0 ? scanPath : '';
|
193
|
-
koatty_container_1.IOCContainer.saveClassMetadata(koatty_container_1.TAGGED_CLS, Constants_1.CONFIGURATION_SCAN, scanPath, target);
|
194
|
-
};
|
195
|
-
}
|
196
|
-
exports.ConfigurationScan = ConfigurationScan;
|
197
|
-
/**
|
198
|
-
* bind AppReadyHookFunc
|
199
|
-
* example:
|
200
|
-
* export function TestDecorator(): ClassDecorator {
|
201
|
-
* return (target: any) => {
|
202
|
-
* BindAppReadyHook((app: Koatty) => {
|
203
|
-
* // todo
|
204
|
-
* return Promise.resolve();
|
205
|
-
* }, target)
|
206
|
-
* }
|
207
|
-
* }
|
208
|
-
*
|
209
|
-
* @export
|
210
|
-
* @param {AppReadyHookFunc} func
|
211
|
-
* @param {*} target
|
212
|
-
*/
|
213
|
-
function BindAppReadyHook(func, target) {
|
214
|
-
koatty_container_1.IOCContainer.attachClassMetadata(koatty_container_1.TAGGED_CLS, Constants_1.APP_READY_HOOK, func, target);
|
215
|
-
}
|
216
|
-
exports.BindAppReadyHook = BindAppReadyHook;
|
217
|
-
//# sourceMappingURL=Bootstrap.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Bootstrap.js","sourceRoot":"","sources":["../../src/core/Bootstrap.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,kDAAkD;AAClD,4BAA0B;AAE1B,6CAA0D;AAC1D,qCAAkC;AAClC,2CAAsD;AACtD,2CAAwC;AACxC,uDAA4D;AAC5D,+CAAuD;AACvD,2CAAuF;AACvF,iDAA0C;AAC1C,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,aAAa,GAAG,KAA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iB,CAAC,6BAAU,EAAE,0BAAc,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjF,CAAC,CAAC;AACN,CAAC;AAVD,sCAUC;AAED;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,QAA4B;IAC1D,eAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,mBAAmB,CAAC,CAAC;IAEhD,OAAO,CAAC,MAAW,EAAE,EAAE;QACnB,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,YAAY,oBAAM,CAAC,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;SACzD;QACD,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAC;QAC1B,+BAAY,CAAC,iBAAiB,CAAC,6BAAU,EAAE,8BAAkB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACrF,CAAC,CAAC;AACN,CAAC;AAVD,8CAUC;AAKD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,gBAAgB,CAAC,IAAsB,EAAE,MAAW;IAChE,+BAAY,CAAC,mBAAmB,CAAC,6BAAU,EAAE,0BAAc,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/E,CAAC;AAFD,4CAEC"}
|
package/dist/core/Component.d.ts
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @ author: richen
|
3
|
-
* @ copyright: Copyright (c) - <richenlin(at)gmail.com>
|
4
|
-
* @ license: BSD (3-Clause)
|
5
|
-
* @ version: 2020-05-10 11:32:45
|
6
|
-
*/
|
7
|
-
import "reflect-metadata";
|
8
|
-
import Koa from "koa";
|
9
|
-
import { Koatty, KoattyContext } from 'koatty_core';
|
10
|
-
/**
|
11
|
-
* Indicates that an decorated class is a "component".
|
12
|
-
*
|
13
|
-
* @export
|
14
|
-
* @param {string} [identifier] component name
|
15
|
-
* @returns {ClassDecorator}
|
16
|
-
*/
|
17
|
-
export declare function Component(identifier?: string): ClassDecorator;
|
18
|
-
/**
|
19
|
-
* Indicates that an decorated class is a "controller".
|
20
|
-
*
|
21
|
-
* @export
|
22
|
-
* @param {string} [path] controller router path
|
23
|
-
* @returns {ClassDecorator}
|
24
|
-
*/
|
25
|
-
export declare function Controller(path?: string): ClassDecorator;
|
26
|
-
/**
|
27
|
-
* Interface for Api output
|
28
|
-
*/
|
29
|
-
export interface ApiOutput {
|
30
|
-
code: number;
|
31
|
-
message: string;
|
32
|
-
data: any;
|
33
|
-
}
|
34
|
-
/**
|
35
|
-
* Interface for Api input
|
36
|
-
*/
|
37
|
-
export interface ApiInput {
|
38
|
-
code?: number;
|
39
|
-
message?: string;
|
40
|
-
data?: any;
|
41
|
-
}
|
42
|
-
/**
|
43
|
-
* Interface for Controller
|
44
|
-
*/
|
45
|
-
export interface IController {
|
46
|
-
app: Koatty;
|
47
|
-
ctx: KoattyContext;
|
48
|
-
__befor?: () => Promise<any>;
|
49
|
-
__after?: () => Promise<any>;
|
50
|
-
readonly fail: (msg?: Error | string | ApiInput, data?: any, ret?: number) => Promise<ApiOutput>;
|
51
|
-
readonly ok: (msg?: string | ApiInput, data?: any, ret?: number) => Promise<ApiOutput>;
|
52
|
-
}
|
53
|
-
/**
|
54
|
-
* Indicates that an decorated class is a "middleware".
|
55
|
-
*
|
56
|
-
* @export
|
57
|
-
* @param {string} [identifier] middleware name
|
58
|
-
* @returns {ClassDecorator}
|
59
|
-
*/
|
60
|
-
export declare function Middleware(identifier?: string): ClassDecorator;
|
61
|
-
/**
|
62
|
-
* Interface for Middleware
|
63
|
-
*/
|
64
|
-
export interface IMiddleware {
|
65
|
-
run: (options: any, app: Koatty) => Koa.Middleware;
|
66
|
-
}
|
67
|
-
/**
|
68
|
-
* Indicates that an decorated class is a "service".
|
69
|
-
*
|
70
|
-
* @export
|
71
|
-
* @param {string} [identifier] middleware name
|
72
|
-
* @returns {ClassDecorator}
|
73
|
-
*/
|
74
|
-
export declare function Service(identifier?: string): ClassDecorator;
|
75
|
-
/**
|
76
|
-
* Interface for Service
|
77
|
-
*/
|
78
|
-
export interface IService {
|
79
|
-
app: Koatty;
|
80
|
-
}
|
81
|
-
/**
|
82
|
-
* Indicates that an decorated class is a "plugin".
|
83
|
-
*
|
84
|
-
* @export
|
85
|
-
* @param {string} [identifier]
|
86
|
-
* @returns {ClassDecorator}
|
87
|
-
*/
|
88
|
-
export declare function Plugin(identifier?: string): ClassDecorator;
|
89
|
-
/**
|
90
|
-
* Interface for Plugin
|
91
|
-
*/
|
92
|
-
export interface IPlugin {
|
93
|
-
run: (options: any, app: Koatty) => Promise<any>;
|
94
|
-
}
|
package/dist/core/Component.js
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Plugin = exports.Service = exports.Middleware = exports.Controller = exports.Component = void 0;
|
4
|
-
/**
|
5
|
-
* @ author: richen
|
6
|
-
* @ copyright: Copyright (c) - <richenlin(at)gmail.com>
|
7
|
-
* @ license: BSD (3-Clause)
|
8
|
-
* @ version: 2020-05-10 11:32:45
|
9
|
-
*/
|
10
|
-
// tslint:disable-next-line: no-import-side-effect
|
11
|
-
require("reflect-metadata");
|
12
|
-
const koatty_container_1 = require("koatty_container");
|
13
|
-
const koatty_router_1 = require("koatty_router");
|
14
|
-
/**
|
15
|
-
* Indicates that an decorated class is a "component".
|
16
|
-
*
|
17
|
-
* @export
|
18
|
-
* @param {string} [identifier] component name
|
19
|
-
* @returns {ClassDecorator}
|
20
|
-
*/
|
21
|
-
function Component(identifier) {
|
22
|
-
return (target) => {
|
23
|
-
identifier = identifier || koatty_container_1.IOCContainer.getIdentifier(target);
|
24
|
-
koatty_container_1.IOCContainer.saveClass("COMPONENT", target, identifier);
|
25
|
-
};
|
26
|
-
}
|
27
|
-
exports.Component = Component;
|
28
|
-
/**
|
29
|
-
* Indicates that an decorated class is a "controller".
|
30
|
-
*
|
31
|
-
* @export
|
32
|
-
* @param {string} [path] controller router path
|
33
|
-
* @returns {ClassDecorator}
|
34
|
-
*/
|
35
|
-
function Controller(path = "") {
|
36
|
-
return (target) => {
|
37
|
-
const identifier = koatty_container_1.IOCContainer.getIdentifier(target);
|
38
|
-
koatty_container_1.IOCContainer.saveClass("CONTROLLER", target, identifier);
|
39
|
-
koatty_container_1.IOCContainer.savePropertyData(koatty_router_1.CONTROLLER_ROUTER, path, target, identifier);
|
40
|
-
};
|
41
|
-
}
|
42
|
-
exports.Controller = Controller;
|
43
|
-
/**
|
44
|
-
* Indicates that an decorated class is a "middleware".
|
45
|
-
*
|
46
|
-
* @export
|
47
|
-
* @param {string} [identifier] middleware name
|
48
|
-
* @returns {ClassDecorator}
|
49
|
-
*/
|
50
|
-
function Middleware(identifier) {
|
51
|
-
return (target) => {
|
52
|
-
identifier = identifier || koatty_container_1.IOCContainer.getIdentifier(target);
|
53
|
-
koatty_container_1.IOCContainer.saveClass("MIDDLEWARE", target, identifier);
|
54
|
-
};
|
55
|
-
}
|
56
|
-
exports.Middleware = Middleware;
|
57
|
-
/**
|
58
|
-
* Indicates that an decorated class is a "service".
|
59
|
-
*
|
60
|
-
* @export
|
61
|
-
* @param {string} [identifier] middleware name
|
62
|
-
* @returns {ClassDecorator}
|
63
|
-
*/
|
64
|
-
function Service(identifier) {
|
65
|
-
return (target) => {
|
66
|
-
identifier = identifier || koatty_container_1.IOCContainer.getIdentifier(target);
|
67
|
-
koatty_container_1.IOCContainer.saveClass("SERVICE", target, identifier);
|
68
|
-
};
|
69
|
-
}
|
70
|
-
exports.Service = Service;
|
71
|
-
/**
|
72
|
-
* Indicates that an decorated class is a "plugin".
|
73
|
-
*
|
74
|
-
* @export
|
75
|
-
* @param {string} [identifier]
|
76
|
-
* @returns {ClassDecorator}
|
77
|
-
*/
|
78
|
-
function Plugin(identifier) {
|
79
|
-
return (target) => {
|
80
|
-
identifier = identifier || koatty_container_1.IOCContainer.getIdentifier(target);
|
81
|
-
//
|
82
|
-
if (!identifier.endsWith("Plugin")) {
|
83
|
-
throw Error("Plugin class name must be 'Plugin' suffix.");
|
84
|
-
}
|
85
|
-
koatty_container_1.IOCContainer.saveClass("COMPONENT", target, `${identifier}`);
|
86
|
-
};
|
87
|
-
}
|
88
|
-
exports.Plugin = Plugin;
|
89
|
-
//# sourceMappingURL=Component.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Component.js","sourceRoot":"","sources":["../../src/core/Component.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,kDAAkD;AAClD,4BAA0B;AAE1B,uDAAgD;AAEhD,iDAAkD;AAElD;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,UAAmB;IACzC,OAAO,CAAC,MAAW,EAAE,EAAE;QACnB,UAAU,GAAG,UAAU,IAAI,+BAAY,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC9D,+BAAY,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC,CAAC;AACN,CAAC;AALD,8BAKC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAI,GAAG,EAAE;IAChC,OAAO,CAAC,MAAW,EAAE,EAAE;QACnB,MAAM,UAAU,GAAG,+BAAY,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACtD,+BAAY,CAAC,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACzD,+BAAY,CAAC,gBAAgB,CAAC,iCAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/E,CAAC,CAAC;AACN,CAAC;AAND,gCAMC;AAiCD;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,UAAmB;IAC1C,OAAO,CAAC,MAAW,EAAE,EAAE;QACnB,UAAU,GAAG,UAAU,IAAI,+BAAY,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC9D,+BAAY,CAAC,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC,CAAC;AACN,CAAC;AALD,gCAKC;AASD;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,UAAmB;IACvC,OAAO,CAAC,MAAW,EAAE,EAAE;QACnB,UAAU,GAAG,UAAU,IAAI,+BAAY,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC9D,+BAAY,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC,CAAC;AACN,CAAC;AALD,0BAKC;AAWD;;;;;;GAMG;AACH,SAAgB,MAAM,CAAC,UAAmB;IACtC,OAAO,CAAC,MAAW,EAAE,EAAE;QACnB,UAAU,GAAG,UAAU,IAAI,+BAAY,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC9D,GAAG;QACH,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAChC,MAAM,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC7D;QACD,+BAAY,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC;AACN,CAAC;AATD,wBASC"}
|
package/dist/core/Constants.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @ author: richen
|
3
|
-
* @ copyright: Copyright (c) - <richenlin(at)gmail.com>
|
4
|
-
* @ license: BSD (3-Clause)
|
5
|
-
* @ version: 2020-05-10 11:49:15
|
6
|
-
*/
|
7
|
-
export declare const COMPONENT_SCAN = "COMPONENT_SCAN";
|
8
|
-
export declare const CONFIGURATION_SCAN = "CONFIGURATION_SCAN";
|
9
|
-
export declare const PRIORITY_KEY = "PRIORITY_KEY";
|
10
|
-
export declare const APP_READY_HOOK = "APP_READY_HOOK";
|
11
|
-
export declare const LOGO = "\n\n\u2588\u2588\u2001 \u2588\u2588\u2001 \u2588\u2588\u2588\u2588\u2588\u2588\u2001 \u2588\u2588\u2588\u2588\u2588\u2001 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2001\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2001\u2588\u2588\u2001 \u2588\u2588\u2001\n\u2588\u2588\u2001 \u2588\u2588\u2001\u2001\u2588\u2588\u2001\u2001\u2001\u2001\u2588\u2588\u2001\u2588\u2588\u2001\u2001\u2001\u2588\u2588\u2001\u2001\u2001\u2001\u2588\u2588\u2001\u2001\u2001\u2001\u2001\u2001\u2001\u2588\u2588\u2001\u2001\u2001\u2001\u2001\u2588\u2588\u2001 \u2588\u2588\u2001\u2001\n\u2588\u2588\u2588\u2588\u2588\u2001\u2001 \u2588\u2588\u2001 \u2588\u2588\u2001\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2001 \u2588\u2588\u2001 \u2588\u2588\u2001 \u2001\u2588\u2588\u2588\u2588\u2001\u2001 \n\u2588\u2588\u2001\u2001\u2588\u2588\u2001 \u2588\u2588\u2001 \u2588\u2588\u2001\u2588\u2588\u2001\u2001\u2001\u2588\u2588\u2001 \u2588\u2588\u2001 \u2588\u2588\u2001 \u2001\u2588\u2588\u2001\u2001 \n\u2588\u2588\u2001 \u2588\u2588\u2001\u2001\u2588\u2588\u2588\u2588\u2588\u2588\u2001\u2001\u2588\u2588\u2001 \u2588\u2588\u2001 \u2588\u2588\u2001 \u2588\u2588\u2001 \u2588\u2588\u2001 \n https://github.com/koatty\n";
|
package/dist/core/Constants.js
DELETED
@@ -1,24 +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-05-10 11:49:15
|
7
|
-
*/
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
-
exports.LOGO = exports.APP_READY_HOOK = exports.PRIORITY_KEY = exports.CONFIGURATION_SCAN = exports.COMPONENT_SCAN = void 0;
|
10
|
-
exports.COMPONENT_SCAN = 'COMPONENT_SCAN';
|
11
|
-
exports.CONFIGURATION_SCAN = 'CONFIGURATION_SCAN';
|
12
|
-
exports.PRIORITY_KEY = 'PRIORITY_KEY';
|
13
|
-
exports.APP_READY_HOOK = "APP_READY_HOOK";
|
14
|
-
// tslint:disable: no-irregular-whitespace
|
15
|
-
exports.LOGO = `
|
16
|
-
|
17
|
-
██ ██ ██████ █████ ████████ ████████ ██ ██
|
18
|
-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
19
|
-
█████ ██ ██ ███████ ██ ██ ████
|
20
|
-
██ ██ ██ ██ ██ ██ ██ ██ ██
|
21
|
-
██ ██ ██████ ██ ██ ██ ██ ██
|
22
|
-
https://github.com/koatty
|
23
|
-
`;
|
24
|
-
//# sourceMappingURL=Constants.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/core/Constants.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAClC,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,YAAY,GAAG,cAAc,CAAC;AAE9B,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAE/C,0CAA0C;AAC7B,QAAA,IAAI,GAAG;;;;;;;;CAQnB,CAAC"}
|
package/dist/core/Loader.d.ts
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
import { Koatty } from 'koatty_core';
|
2
|
-
/**
|
3
|
-
*
|
4
|
-
*/
|
5
|
-
export declare class Loader {
|
6
|
-
/**
|
7
|
-
* initialize env
|
8
|
-
*
|
9
|
-
* @static
|
10
|
-
* @param {Koatty} app
|
11
|
-
* @memberof Loader
|
12
|
-
*/
|
13
|
-
static initialize(app: Koatty): void;
|
14
|
-
/**
|
15
|
-
* Get component metadata
|
16
|
-
*
|
17
|
-
* @static
|
18
|
-
* @param {Koatty} app
|
19
|
-
* @param {*} target
|
20
|
-
* @returns {*} {any[]}
|
21
|
-
* @memberof Loader
|
22
|
-
*/
|
23
|
-
static GetComponentMetas(app: Koatty, target: any): any[];
|
24
|
-
/**
|
25
|
-
* Load all bean, excepted config/*、App.ts
|
26
|
-
*
|
27
|
-
* @static
|
28
|
-
* @param {Koatty} app
|
29
|
-
* @param {*} target
|
30
|
-
* @memberof Loader
|
31
|
-
*/
|
32
|
-
static CheckAllComponents(app: Koatty, target: any): void;
|
33
|
-
/**
|
34
|
-
* Get configuration metadata
|
35
|
-
*
|
36
|
-
* @static
|
37
|
-
* @param {Koatty} app
|
38
|
-
* @param {*} target
|
39
|
-
* @returns {*} {any[]}
|
40
|
-
* @memberof Loader
|
41
|
-
*/
|
42
|
-
static GetConfigurationMetas(app: Koatty, target: any): any[];
|
43
|
-
/**
|
44
|
-
* Set Logger level
|
45
|
-
*
|
46
|
-
* @static
|
47
|
-
* @param {Koatty} app
|
48
|
-
* @memberof Loader
|
49
|
-
*/
|
50
|
-
static SetLogger(app: Koatty): void;
|
51
|
-
/**
|
52
|
-
* Load app ready hook funcs
|
53
|
-
*
|
54
|
-
* @static
|
55
|
-
* @param {Koatty} app
|
56
|
-
* @param {*} target
|
57
|
-
* @memberof Loader
|
58
|
-
*/
|
59
|
-
static LoadAppReadyHooks(app: Koatty, target: any): void;
|
60
|
-
/**
|
61
|
-
* Load configuration
|
62
|
-
*
|
63
|
-
* @static
|
64
|
-
* @param {Koatty} app
|
65
|
-
* @param {string[]} [loadPath]
|
66
|
-
* @memberof Loader
|
67
|
-
*/
|
68
|
-
static LoadConfigs(app: Koatty, loadPath?: string[]): void;
|
69
|
-
/**
|
70
|
-
* Load middlewares
|
71
|
-
* [async]
|
72
|
-
* @static
|
73
|
-
* @param {*} app
|
74
|
-
* @param {(string | string[])} [loadPath]
|
75
|
-
* @memberof Loader
|
76
|
-
*/
|
77
|
-
static LoadMiddlewares(app: Koatty, loadPath?: string[]): Promise<void>;
|
78
|
-
/**
|
79
|
-
* Load controllers
|
80
|
-
*
|
81
|
-
* @static
|
82
|
-
* @param {*} app
|
83
|
-
* @memberof Loader
|
84
|
-
*/
|
85
|
-
static LoadControllers(app: Koatty): void;
|
86
|
-
/**
|
87
|
-
* Load services
|
88
|
-
*
|
89
|
-
* @static
|
90
|
-
* @param {*} app
|
91
|
-
* @memberof Loader
|
92
|
-
*/
|
93
|
-
static LoadServices(app: Koatty): void;
|
94
|
-
/**
|
95
|
-
* Load components
|
96
|
-
*
|
97
|
-
* @static
|
98
|
-
* @param {*} app
|
99
|
-
* @memberof Loader
|
100
|
-
*/
|
101
|
-
static LoadComponents(app: Koatty): void;
|
102
|
-
/**
|
103
|
-
* Load plugins
|
104
|
-
*
|
105
|
-
* @static
|
106
|
-
* @param {*} app
|
107
|
-
* @memberof Loader
|
108
|
-
*/
|
109
|
-
static LoadPlugins(app: Koatty): Promise<void>;
|
110
|
-
}
|