@galeh/chuka 1.0.12 → 1.1.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/index.d.ts +14 -14
- package/index.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -18,16 +18,16 @@ export declare class Controller {
|
|
|
18
18
|
constructor();
|
|
19
19
|
private [setControllerSymbol];
|
|
20
20
|
private [getRouterSymbol];
|
|
21
|
-
protected
|
|
22
|
-
protected
|
|
23
|
-
protected
|
|
24
|
-
protected
|
|
25
|
-
protected
|
|
26
|
-
protected
|
|
27
|
-
protected
|
|
28
|
-
protected
|
|
29
|
-
protected
|
|
30
|
-
protected
|
|
21
|
+
protected useWS<M0>(): MiniControllerWS<M0>;
|
|
22
|
+
protected useWS<M0>(middleware0: WSMiddleware<M0>): MiniControllerWS<M0>;
|
|
23
|
+
protected useWS<M0, M1>(middleware0: WSMiddleware<M0>, middleware1: WSMiddleware<M1>): MiniControllerWS<M0 & M1>;
|
|
24
|
+
protected useWS<M0, M1, M2>(middleware0: WSMiddleware<M0>, middleware1: WSMiddleware<M1>, middleware2: WSMiddleware<M2>): MiniControllerWS<M0 & M1 & M2>;
|
|
25
|
+
protected useWS<M0, M1, M2, M3>(middleware0: WSMiddleware<M0>, middleware1: WSMiddleware<M1>, middleware2: WSMiddleware<M2>, middleware3: WSMiddleware<M3>): MiniControllerWS<M0 & M1 & M2 & M3>;
|
|
26
|
+
protected use<M0>(): MiniController<M0>;
|
|
27
|
+
protected use<M0>(middleware0: RequestHandlerParams<M0>): MiniController<M0>;
|
|
28
|
+
protected use<M0, M1>(middleware0: RequestHandlerParams<M0>, middleware1: RequestHandlerParams<M1>): MiniController<M0 & M1>;
|
|
29
|
+
protected use<M0, M1, M2>(middleware0: RequestHandlerParams<M0>, middleware1: RequestHandlerParams<M1>, middleware2: RequestHandlerParams<M2>): MiniController<M0 & M1 & M2>;
|
|
30
|
+
protected use<M0, M1, M2, M3>(middleware0: RequestHandlerParams<M0>, middleware1: RequestHandlerParams<M1>, middleware2: RequestHandlerParams<M2>, middleware3: RequestHandlerParams<M3>): MiniController<M0 & M1 & M2 & M3>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export declare function createApp(config: ApplicationConfig): express.Application;
|
|
@@ -99,10 +99,10 @@ declare class MiniController<T> implements MiniControllerInterface<T> {
|
|
|
99
99
|
link: <Path extends string>(path: Path, handler: RequestHandler<T, RouteParameters<Path>>) => void;
|
|
100
100
|
unlink: <Path extends string>(path: Path, handler: RequestHandler<T, RouteParameters<Path>>) => void;
|
|
101
101
|
private methodImplementation;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
use<M0>(middleware0: RequestHandlerParams<M0>): MiniController<Merge<T, M0>>;
|
|
103
|
+
use<M0, M1>(middleware0: RequestHandlerParams<M0>, middleware1: RequestHandlerParams<M1>): MiniController<Merge<T, M0 & M1>>;
|
|
104
|
+
use<M0, M1, M2>(middleware0: RequestHandlerParams<M0>, middleware1: RequestHandlerParams<M1>, middleware2: RequestHandlerParams<M2>): MiniController<Merge<T, M0 & M1 & M2>>;
|
|
105
|
+
use<M0, M1, M2, M3>(middleware0: RequestHandlerParams<M0>, middleware1: RequestHandlerParams<M1>, middleware2: RequestHandlerParams<M2>, middleware3: RequestHandlerParams<M3>): MiniController<Merge<T, M0 & M1 & M2 & M3>>;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
declare interface MiniControllerInterface<T> {
|
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
24
24
|
\***************************/
|
|
25
25
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
26
26
|
|
|
27
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Controller: () => (/* binding */ Controller),\n/* harmony export */ getRouterSymbol: () => (/* binding */ getRouterSymbol),\n/* harmony export */ setControllerSymbol: () => (/* binding */ setControllerSymbol)\n/* harmony export */ });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"tslib\");\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tslib__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var express__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! express */ \"express\");\n/* harmony import */ var express__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(express__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! inversify */ \"inversify\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nconst getRouterSymbol = Symbol();\nconst setControllerSymbol = Symbol();\nlet Controller = class Controller {\n constructor() {\n this.router = (0,express__WEBPACK_IMPORTED_MODULE_1__.Router)();\n }\n [setControllerSymbol](path, subrouter) {\n this.router.use(path, subrouter[getRouterSymbol]());\n }\n [getRouterSymbol]() {\n return this.router;\n }\n
|
|
27
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Controller: () => (/* binding */ Controller),\n/* harmony export */ getRouterSymbol: () => (/* binding */ getRouterSymbol),\n/* harmony export */ setControllerSymbol: () => (/* binding */ setControllerSymbol)\n/* harmony export */ });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"tslib\");\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tslib__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var express__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! express */ \"express\");\n/* harmony import */ var express__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(express__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! inversify */ \"inversify\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nconst getRouterSymbol = Symbol();\nconst setControllerSymbol = Symbol();\nlet Controller = class Controller {\n constructor() {\n this.router = (0,express__WEBPACK_IMPORTED_MODULE_1__.Router)();\n }\n [setControllerSymbol](path, subrouter) {\n this.router.use(path, subrouter[getRouterSymbol]());\n }\n [getRouterSymbol]() {\n return this.router;\n }\n useWS(...middlewares) {\n return (handler) => {\n this.router.ws.apply(this.router, ['/', ...middlewares, handler]);\n };\n }\n use(...middlewares) {\n return new MiniController(this.router, middlewares);\n }\n};\nController = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([\n (0,inversify__WEBPACK_IMPORTED_MODULE_2__.injectable)()\n], Controller);\n\nclass MiniController {\n constructor(router, middlewares) {\n this.router = router;\n this.middlewares = middlewares;\n this.all = this.methodImplementation('all').bind(this);\n this.get = this.methodImplementation('get').bind(this);\n this.post = this.methodImplementation('post').bind(this);\n this.put = this.methodImplementation('put').bind(this);\n this.delete = this.methodImplementation('delete').bind(this);\n this.patch = this.methodImplementation('patch').bind(this);\n this.options = this.methodImplementation('options').bind(this);\n this.head = this.methodImplementation('head').bind(this);\n this.checkout = this.methodImplementation('checkout').bind(this);\n this.connect = this.methodImplementation('connect').bind(this);\n this.copy = this.methodImplementation('copy').bind(this);\n this.lock = this.methodImplementation('lock').bind(this);\n this.merge = this.methodImplementation('merge').bind(this);\n this.mkactivity = this.methodImplementation('mkactivity').bind(this);\n this.mkcol = this.methodImplementation('mkcol').bind(this);\n this.move = this.methodImplementation('move').bind(this);\n this['m-search'] = this.methodImplementation('m-search').bind(this);\n this.notify = this.methodImplementation('notify').bind(this);\n this.propfind = this.methodImplementation('propfind').bind(this);\n this.proppatch = this.methodImplementation('proppatch').bind(this);\n this.purge = this.methodImplementation('purge').bind(this);\n this.report = this.methodImplementation('report').bind(this);\n this.search = this.methodImplementation('search').bind(this);\n this.subscribe = this.methodImplementation('subscribe').bind(this);\n this.trace = this.methodImplementation('trace').bind(this);\n this.unlock = this.methodImplementation('unlock').bind(this);\n this.unsubscribe = this.methodImplementation('unsubscribe').bind(this);\n this.link = this.methodImplementation('link').bind(this);\n this.unlink = this.methodImplementation('unlink').bind(this);\n }\n methodImplementation(methodName) {\n return (path, handler) => {\n this.router[methodName].apply(this.router, [\n path,\n ...this.middlewares,\n (req, res, next) => {\n handler(req, res, next);\n }\n ]);\n };\n }\n use(...middlewares) {\n return new MiniController(this.router, this.middlewares.concat(middlewares));\n }\n}\n\n\n//# sourceURL=webpack://@galeh/chuka/./src/controller.ts?");
|
|
28
28
|
|
|
29
29
|
/***/ }),
|
|
30
30
|
|