@deepkit/http 1.0.1-alpha.102 → 1.0.1-alpha.108
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 +22 -0
- package/dist/cjs/src/controllers.js +1 -1
- package/dist/cjs/src/decorator.d.ts +7 -6
- package/dist/cjs/src/decorator.js +31 -15
- package/dist/cjs/src/decorator.js.map +1 -1
- package/dist/cjs/src/filter.js +4 -4
- package/dist/cjs/src/http-app.js +1 -1
- package/dist/cjs/src/http.d.ts +1 -1
- package/dist/cjs/src/http.js +39 -39
- package/dist/cjs/src/http.js.map +1 -1
- package/dist/cjs/src/kernel.js +2 -2
- package/dist/cjs/src/kernel.js.map +1 -1
- package/dist/cjs/src/logger.js +1 -1
- package/dist/cjs/src/middleware.d.ts +1 -1
- package/dist/cjs/src/middleware.js +5 -5
- package/dist/cjs/src/model.d.ts +16 -28
- package/dist/cjs/src/model.js +23 -21
- package/dist/cjs/src/model.js.map +1 -1
- package/dist/cjs/src/module.config.js +2 -2
- package/dist/cjs/src/module.js +1 -1
- package/dist/cjs/src/request-parser.js +1 -1
- package/dist/cjs/src/router.d.ts +1 -1
- package/dist/cjs/src/router.js +16 -16
- package/dist/cjs/src/router.js.map +1 -1
- package/dist/cjs/src/static-serving.js +3 -3
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/src/controllers.js +1 -1
- package/dist/esm/src/decorator.d.ts +7 -6
- package/dist/esm/src/decorator.js +29 -14
- package/dist/esm/src/decorator.js.map +1 -1
- package/dist/esm/src/filter.js +4 -4
- package/dist/esm/src/http-app.js +1 -1
- package/dist/esm/src/http.d.ts +1 -1
- package/dist/esm/src/http.js +39 -39
- package/dist/esm/src/http.js.map +1 -1
- package/dist/esm/src/kernel.js +2 -2
- package/dist/esm/src/kernel.js.map +1 -1
- package/dist/esm/src/logger.js +1 -1
- package/dist/esm/src/middleware.d.ts +1 -1
- package/dist/esm/src/middleware.js +5 -5
- package/dist/esm/src/model.d.ts +16 -28
- package/dist/esm/src/model.js +23 -21
- package/dist/esm/src/model.js.map +1 -1
- package/dist/esm/src/module.config.js +2 -2
- package/dist/esm/src/module.js +1 -1
- package/dist/esm/src/request-parser.js +1 -1
- package/dist/esm/src/router.d.ts +1 -1
- package/dist/esm/src/router.js +17 -17
- package/dist/esm/src/router.js.map +1 -1
- package/dist/esm/src/static-serving.js +3 -3
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/src/decorator.ts +20 -2
- package/src/http.ts +1 -1
- package/src/kernel.ts +1 -1
- package/src/model.ts +9 -9
- package/src/router.ts +16 -5
- package/tsconfig.json +5 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [1.0.1-alpha.108](https://github.com/deepkit/deepkit-framework/compare/v1.0.1-alpha.107...v1.0.1-alpha.108) (2023-11-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **http:** fix tests to reflect new error reporting ([1eb83ff](https://github.com/deepkit/deepkit-framework/commit/1eb83ff2ba669fc9410269023e23b863c44e4257))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.0.1-alpha.105](https://github.com/deepkit/deepkit-framework/compare/v1.0.1-alpha.103...v1.0.1-alpha.105) (2023-10-23)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **type:** do not interfere with type checking when intersecting multiple type annotations. ([af85f1f](https://github.com/deepkit/deepkit-framework/commit/af85f1ff48c4be9fbd9a2ecd46e7f97b0bbb28c7))
|
|
@@ -13,5 +13,5 @@ class HttpControllers {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
exports.HttpControllers = HttpControllers;
|
|
16
|
-
HttpControllers.__type = [() => __ΩClassType, 'controller', () => injector_1.InjectorModule, 'module', 'controllers', () => [], 'constructor', () => __ΩClassType, () => injector_1.InjectorModule, 'add', 'PPn!4"P"7#4$MF2%:9>&"0\'Pn(2"P"7)2$"0*
|
|
16
|
+
HttpControllers.__type = [() => __ΩClassType, 'controller', () => injector_1.InjectorModule, 'module', 'controllers', () => [], 'constructor', () => __ΩClassType, () => injector_1.InjectorModule, 'add', 'HttpControllers', 'PPn!4"P"7#4$MF2%:9>&"0\'Pn(2"P"7)2$"0*5w+'];
|
|
17
17
|
//# sourceMappingURL=controllers.js.map
|
|
@@ -2,7 +2,7 @@ import { ClassType } from '@deepkit/core';
|
|
|
2
2
|
import { ClassDecoratorResult, DecoratorAndFetchSignature, DualDecorator, ExtractApiDataType, ExtractClass, PropertyDecoratorFn, ReceiveType, SerializationOptions, Serializer, Type, UnionToIntersection } from '@deepkit/type';
|
|
3
3
|
import { RouteParameterResolver } from './router.js';
|
|
4
4
|
import { HttpMiddleware, HttpMiddlewareConfig, HttpMiddlewareFn } from './middleware.js';
|
|
5
|
-
|
|
5
|
+
type HttpActionMiddleware = (() => HttpMiddlewareConfig) | ClassType<HttpMiddleware> | HttpMiddlewareFn;
|
|
6
6
|
export declare class HttpController {
|
|
7
7
|
baseUrl: string;
|
|
8
8
|
actions: Set<HttpAction>;
|
|
@@ -103,6 +103,7 @@ export declare class HttpControllerDecorator {
|
|
|
103
103
|
setAction(action: HttpAction): void;
|
|
104
104
|
}
|
|
105
105
|
export declare const httpClass: ClassDecoratorResult<typeof HttpControllerDecorator>;
|
|
106
|
+
export declare function getActions(target: ClassType): HttpAction[];
|
|
106
107
|
export declare class HttpActionDecorator {
|
|
107
108
|
t: HttpAction;
|
|
108
109
|
onDecorator(target: ClassType, property: string | undefined, parameterIndexOrDescriptor?: any): void;
|
|
@@ -224,18 +225,18 @@ export declare class HttpActionDecorator {
|
|
|
224
225
|
*/
|
|
225
226
|
resolveParameterByName(name: string, resolver: ClassType<RouteParameterResolver>): void;
|
|
226
227
|
}
|
|
227
|
-
|
|
228
|
+
type HttpActionFluidDecorator<T, D extends Function> = {
|
|
228
229
|
[name in keyof T]: name extends 'response' ? <T2>(statusCode: number, description?: string, type?: ReceiveType<T2>) => D & HttpActionFluidDecorator<T, D> : T[name] extends (...args: infer K) => any ? (...args: K) => D & HttpActionFluidDecorator<T, D> : D & HttpActionFluidDecorator<T, D> & {
|
|
229
230
|
_data: ExtractApiDataType<T>;
|
|
230
231
|
};
|
|
231
232
|
};
|
|
232
|
-
|
|
233
|
+
type HttpActionPropertyDecoratorResult = HttpActionFluidDecorator<ExtractClass<typeof HttpActionDecorator>, PropertyDecoratorFn> & DecoratorAndFetchSignature<typeof HttpActionDecorator, PropertyDecoratorFn>;
|
|
233
234
|
export declare const httpAction: HttpActionPropertyDecoratorResult;
|
|
234
|
-
|
|
235
|
+
type HttpMerge<U> = {
|
|
235
236
|
[K in keyof U]: K extends 'response' ? <T2>(statusCode: number, description?: string, type?: ReceiveType<T2>) => PropertyDecoratorFn & U : U[K] extends ((...a: infer A) => infer R) ? R extends DualDecorator ? (...a: A) => PropertyDecoratorFn & R & U : (...a: A) => R : never;
|
|
236
237
|
};
|
|
237
|
-
|
|
238
|
-
export
|
|
238
|
+
type MergedHttp<T extends any[]> = HttpMerge<Omit<UnionToIntersection<T[number]>, '_fetch' | 't'>>;
|
|
239
|
+
export type HttpDecorator = PropertyDecoratorFn & HttpActionFluidDecorator<HttpActionDecorator, PropertyDecoratorFn>;
|
|
239
240
|
export declare const http: MergedHttp<[typeof httpClass, typeof httpAction]>;
|
|
240
241
|
export {};
|
|
241
242
|
export declare type __ΩHttpDecorator = any[];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.http = exports.__ΩHttpDecorator = exports.httpAction = exports.HttpActionDecorator = exports.httpClass = exports.HttpControllerDecorator = exports.HttpAction = exports.HttpActionParameter = exports.HttpController = void 0;
|
|
3
|
+
exports.http = exports.__ΩHttpDecorator = exports.httpAction = exports.HttpActionDecorator = exports.getActions = exports.httpClass = exports.HttpControllerDecorator = exports.HttpAction = exports.HttpActionParameter = exports.HttpController = void 0;
|
|
4
|
+
const __ΩOmit = ['T', 'K', () => __ΩPick, () => __ΩExclude, 'b!b"e!!e!!ge!"o$#o##y'];
|
|
5
|
+
const __ΩPick = ['T', 'K', 'l+e#!e"!fRb!b"Pde""N#!y'];
|
|
6
|
+
const __ΩExclude = ['T', 'U', 'l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)y'];
|
|
4
7
|
/*@ts-ignore*/
|
|
5
8
|
const { __ΩClassType } = require('@deepkit/core');
|
|
6
9
|
/*@ts-ignore*/
|
|
@@ -29,9 +32,6 @@ function __assignType(fn, args) {
|
|
|
29
32
|
fn.__type = args;
|
|
30
33
|
return fn;
|
|
31
34
|
}
|
|
32
|
-
const __ΩPick = ['T', 'K', 'l+e#!e"!fRb!b"Pde""N#!'];
|
|
33
|
-
const __ΩExclude = ['T', 'U', 'l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)'];
|
|
34
|
-
const __ΩOmit = ['T', 'K', () => __ΩPick, () => __ΩExclude, 'b!b"e!!e!!ge!"o$#o##'];
|
|
35
35
|
/*
|
|
36
36
|
* Deepkit Framework
|
|
37
37
|
* Copyright (C) 2021 Deepkit UG, Marc J. Schmidt
|
|
@@ -44,7 +44,7 @@ const __ΩOmit = ['T', 'K', () => __ΩPick, () => __ΩExclude, 'b!b"e!!e!!ge!"o$
|
|
|
44
44
|
const core_1 = require("@deepkit/core");
|
|
45
45
|
const type_1 = require("@deepkit/type");
|
|
46
46
|
const middleware_js_1 = require("./middleware.js");
|
|
47
|
-
const __ΩHttpActionMiddleware = [() => middleware_js_1.HttpMiddlewareConfig, '', () => __ΩClassType, () => __ΩHttpMiddleware, () => __ΩHttpMiddlewareFn, 'PPP7!/"n$o#"n%
|
|
47
|
+
const __ΩHttpActionMiddleware = [() => middleware_js_1.HttpMiddlewareConfig, '', () => __ΩClassType, () => __ΩHttpMiddleware, () => __ΩHttpMiddlewareFn, 'PPP7!/"n$o#"n%Jy'];
|
|
48
48
|
function isMiddlewareClassTypeOrFn(v) {
|
|
49
49
|
return (0, core_1.isClass)(v) || !(0, type_1.isDecoratorContext)(middleware_js_1.httpMiddleware, v);
|
|
50
50
|
}
|
|
@@ -91,7 +91,7 @@ class HttpController {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
exports.HttpController = HttpController;
|
|
94
|
-
HttpController.__type = ['baseUrl', function () { return ''; }, 'groups', function () { return []; }, () => middleware_js_1.HttpMiddlewareConfig, '', 'middlewares', function () { return []; }, () => __ΩClassType, 'resolverForToken', function () { return new Map(); }, () => __ΩClassType, 'resolverForParameterName', function () { return new Map(); }, () => HttpAction, 'action', 'getUrl', () => HttpAction, 'addAction', () => HttpAction, 'getActions', 'methodName', 'removeAction', () => HttpAction, 'getAction', '&3!>"&F3#>$PP7%/&F3\'>("n)E3*>+&n,E3->.PP7/20&01PP7220"03PP74D05P&26$07P&
|
|
94
|
+
HttpController.__type = ['baseUrl', function () { return ''; }, 'groups', function () { return []; }, () => middleware_js_1.HttpMiddlewareConfig, '', 'middlewares', function () { return []; }, () => __ΩClassType, 'resolverForToken', function () { return new Map(); }, () => __ΩClassType, 'resolverForParameterName', function () { return new Map(); }, () => HttpAction, 'action', 'getUrl', () => HttpAction, 'addAction', () => HttpAction, 'getActions', 'methodName', 'removeAction', () => HttpAction, 'getAction', 'HttpController', '&3!>"&F3#>$PP7%/&F3\'>("n)E3*>+&n,E3->.PP7/20&01PP7220"03PP74D05P&26$07P&26P78095w:'];
|
|
95
95
|
class HttpActionParameter {
|
|
96
96
|
constructor() {
|
|
97
97
|
this.name = '';
|
|
@@ -99,7 +99,7 @@ class HttpActionParameter {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
exports.HttpActionParameter = HttpActionParameter;
|
|
102
|
-
HttpActionParameter.__type = ['name', function () { return ''; }, "body", "query", "queries", 'type', 'typePath', 'optional', function () { return false; }, '&3!>"P.#.$.%J3&8&3\'8)3(>)
|
|
102
|
+
HttpActionParameter.__type = ['name', function () { return ''; }, "body", "query", "queries", 'type', 'typePath', 'optional', function () { return false; }, 'HttpActionParameter', '&3!>"P.#.$.%J3&8&3\'8)3(>)5w*'];
|
|
103
103
|
class HttpAction {
|
|
104
104
|
constructor() {
|
|
105
105
|
this.name = '';
|
|
@@ -120,7 +120,7 @@ class HttpAction {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
exports.HttpAction = HttpAction;
|
|
123
|
-
HttpAction.__type = ['name', function () { return ''; }, 'description', function () { return ''; }, 'category', function () { return ''; }, 'path', function () { return ''; }, 'httpMethods', function () { return []; }, 'methodName', function () { return ''; }, 'groups', function () { return []; }, () => type_1.Serializer, 'serializer', () => middleware_js_1.HttpMiddlewareConfig, '', 'middlewares', function () { return []; }, () => __ΩSerializationOptions, 'serializationOptions', () => __ΩClassType, 'resolverForToken', function () { return new Map(); }, () => __ΩClassType, 'resolverForParameterName', function () { return new Map(); }, 'statusCode', 'type', 'responses', function () { return []; }, '&3!>"&3#>$&3%>&&3\'>(&F3)>*&3+>,&F3->.P7/308PP71/2F33>4n5368"n7E38>9&n:E3;><P\'4=&4#"4>8MF3?>@
|
|
123
|
+
HttpAction.__type = ['name', function () { return ''; }, 'description', function () { return ''; }, 'category', function () { return ''; }, 'path', function () { return ''; }, 'httpMethods', function () { return []; }, 'methodName', function () { return ''; }, 'groups', function () { return []; }, () => type_1.Serializer, 'serializer', () => middleware_js_1.HttpMiddlewareConfig, '', 'middlewares', function () { return []; }, () => __ΩSerializationOptions, 'serializationOptions', () => __ΩClassType, 'resolverForToken', function () { return new Map(); }, () => __ΩClassType, 'resolverForParameterName', function () { return new Map(); }, 'statusCode', 'type', 'responses', function () { return []; }, 'HttpAction', '&3!>"&3#>$&3%>&&3\'>(&F3)>*&3+>,&F3->.P7/308PP71/2F33>4n5368"n7E38>9&n:E3;><P\'4=&4#"4>8MF3?>@5wA'];
|
|
124
124
|
class HttpControllerDecorator {
|
|
125
125
|
constructor() {
|
|
126
126
|
this.t = new HttpController;
|
|
@@ -189,8 +189,24 @@ class HttpControllerDecorator {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
exports.HttpControllerDecorator = HttpControllerDecorator;
|
|
192
|
-
HttpControllerDecorator.__type = ['baseUrl', () => "", 'controller', 'group', () => __ΩHttpActionMiddleware, 'middlewares', 'middleware', () => __ΩClassType, 'classType', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolver', 'resolveParameter', 'name', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolveParameterByName', () => HttpAction, 'action', 'setAction', 'P&2!>""0#P&@2$"0$Pn%@2&"0\'PPn(&"J2)n+o*"2,"0-P&2.n0o/"2,"01PP7223"
|
|
192
|
+
HttpControllerDecorator.__type = ['baseUrl', () => "", 'controller', 'group', () => __ΩHttpActionMiddleware, 'middlewares', 'middleware', () => __ΩClassType, 'classType', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolver', 'resolveParameter', 'name', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolveParameterByName', () => HttpAction, 'action', 'setAction', 'HttpControllerDecorator', 'P&2!>""0#P&@2$"0$Pn%@2&"0\'PPn(&"J2)n+o*"2,"0-P&2.n0o/"2,"01PP7223"045w5'];
|
|
193
193
|
exports.httpClass = (0, type_1.createClassDecoratorContext)(HttpControllerDecorator);
|
|
194
|
+
function getActions(target) {
|
|
195
|
+
const parent = Object.getPrototypeOf(target);
|
|
196
|
+
const results = parent ? getActions(parent) : [];
|
|
197
|
+
const config = exports.httpClass._fetch(target);
|
|
198
|
+
if (config) {
|
|
199
|
+
for (const action of config.getActions()) {
|
|
200
|
+
const existing = results.findIndex(__assignType(v => v.methodName === action.methodName, ['v', '', 'P"2!"/"']));
|
|
201
|
+
if (existing !== -1)
|
|
202
|
+
results.splice(existing, 1);
|
|
203
|
+
results.push(action);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return results;
|
|
207
|
+
}
|
|
208
|
+
exports.getActions = getActions;
|
|
209
|
+
getActions.__type = [() => __ΩClassType, 'target', () => HttpAction, 'getActions', 'Pn!2"P7#F/$'];
|
|
194
210
|
class HttpActionDecorator {
|
|
195
211
|
constructor() {
|
|
196
212
|
this.t = new HttpAction;
|
|
@@ -410,13 +426,13 @@ class HttpActionDecorator {
|
|
|
410
426
|
}
|
|
411
427
|
}
|
|
412
428
|
exports.HttpActionDecorator = HttpActionDecorator;
|
|
413
|
-
HttpActionDecorator.__type = [() => __ΩClassType, 'target', 'property', 'parameterIndexOrDescriptor', 'onDecorator', 'name', 'description', () => __ΩSerializationOptions, 'options', 'serialization', () => type_1.Serializer, 'serializer', () => __ΩHttpActionMiddleware, 'middlewares', 'middleware', () => HttpAction, 'action', '', 'use', 'value', 'data', 'category', 'group', 'path', () => "", 'GET', () => "", 'HEAD', () => "", 'POST', () => "", 'PUT', () => "", 'DELETE', () => "", 'OPTIONS', () => "", 'TRACE', () => "", 'PATCH', () => "", 'ANY', 'statusCode', () => "", () => __ΩReceiveType, 'type', 'response', () => __ΩClassType, 'classType', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolver', 'resolveParameter', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolveParameterByName', 'Pn!2"P&-J2#"2$8"0%P&2&"0&P&2\'"0\'Pn(2)"0*PP7+2,"0,Pn-@2."0/PPP7021$/223"03P&2&"24"05P&26"06P&@27"07P&28>9"0:P&28>;"0<P&28>="0>P&28>?"0@P&28>A"0BP&28>C"0DP&28>E"0FP&28>G"0HP&28>I"0JP\'2K&2\'>L"oM"2N8"0OPPnP&"J2QnSoR"2T"0UP&2&nWoV"2T"
|
|
414
|
-
const __ΩHttpActionFluidDecorator = ['T', 'D', "response", 'statusCode', 'description', () => __ΩReceiveType, 'type', () => __ΩHttpActionFluidDecorator, '', 'args', () => __ΩHttpActionFluidDecorator, () => __ΩHttpActionFluidDecorator, () => __ΩExtractApiDataType, '_data', 'l\u00A1P\'2$&2%8"o&"2\'8Pe)"e)!e)"o(#K/)RPe#!@2*Pe+"e+!e+"o+#K/)RPe*"e*!e*"o,#Pe+!o-"4.MKRPde(!e%!fPh"!@2*"/)qkC[QRPe#!.#qk#tQRPde#!p\u008DRb!b"Pde"!gN\u0099!'];
|
|
415
|
-
const __ΩHttpActionPropertyDecoratorResult = [() => __ΩHttpActionFluidDecorator, () => __ΩExtractClass, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, () => __ΩDecoratorAndFetchSignature, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, 'Pi#o""n$o!#i&n\'o%#
|
|
429
|
+
HttpActionDecorator.__type = [() => __ΩClassType, 'target', 'property', 'parameterIndexOrDescriptor', 'onDecorator', 'name', 'description', () => __ΩSerializationOptions, 'options', 'serialization', () => type_1.Serializer, 'serializer', () => __ΩHttpActionMiddleware, 'middlewares', 'middleware', () => HttpAction, 'action', '', 'use', 'value', 'data', 'category', 'group', 'path', () => "", 'GET', () => "", 'HEAD', () => "", 'POST', () => "", 'PUT', () => "", 'DELETE', () => "", 'OPTIONS', () => "", 'TRACE', () => "", 'PATCH', () => "", 'ANY', 'statusCode', () => "", () => __ΩReceiveType, 'type', 'response', () => __ΩClassType, 'classType', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolver', 'resolveParameter', () => __ΩClassType, () => __ΩRouteParameterResolver, 'resolveParameterByName', 'HttpActionDecorator', 'Pn!2"P&-J2#"2$8"0%P&2&"0&P&2\'"0\'Pn(2)"0*PP7+2,"0,Pn-@2."0/PPP7021$/223"03P&2&"24"05P&26"06P&@27"07P&28>9"0:P&28>;"0<P&28>="0>P&28>?"0@P&28>A"0BP&28>C"0DP&28>E"0FP&28>G"0HP&28>I"0JP\'2K&2\'>L"oM"2N8"0OPPnP&"J2QnSoR"2T"0UP&2&nWoV"2T"0X5wY'];
|
|
430
|
+
const __ΩHttpActionFluidDecorator = ['T', 'D', "response", 'statusCode', 'description', () => __ΩReceiveType, 'type', () => __ΩHttpActionFluidDecorator, '', 'args', () => __ΩHttpActionFluidDecorator, () => __ΩHttpActionFluidDecorator, () => __ΩExtractApiDataType, '_data', 'l\u00A1P\'2$&2%8"o&"2\'8Pe)"e)!e)"o(#K/)RPe#!@2*Pe+"e+!e+"o+#K/)RPe*"e*!e*"o,#Pe+!o-"4.MKRPde(!e%!fPh"!@2*"/)qkC[QRPe#!.#qk#tQRPde#!p\u008DRb!b"Pde"!gN\u0099!y'];
|
|
431
|
+
const __ΩHttpActionPropertyDecoratorResult = [() => __ΩHttpActionFluidDecorator, () => __ΩExtractClass, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, () => __ΩDecoratorAndFetchSignature, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, 'Pi#o""n$o!#i&n\'o%#Ky'];
|
|
416
432
|
exports.httpAction = (0, type_1.createPropertyDecoratorContext)(HttpActionDecorator);
|
|
417
|
-
const __ΩHttpMerge = ['U', "response", 'statusCode', 'description', () => __ΩReceiveType, 'type', () => __ΩPropertyDecoratorFn, '', 'a', () => __ΩDualDecorator, () => __ΩPropertyDecoratorFn, 'l\u00A3P\'2#&2$8"o%"2&8Pn\'e)!K/(RPe\'!@2)Pn+e&!e/!K/(RPe\'!@2)e%!/(RPe#!n*qk<PQRPde#"p]R!RPdde(!e%!fPh"!@2)h""/(qkiqQRPe#!."qk#sQRPde#!p\u008FRb!Pde"!gN\u009B!'];
|
|
418
|
-
const __ΩMergedHttp = ['T', () => __ΩHttpMerge, () => __ΩOmit, () => __ΩUnionToIntersection, "_fetch", "t", 'b!e!!\'fo$"P.%.&Jo##o""'];
|
|
419
|
-
const __ΩHttpDecorator = [() => __ΩPropertyDecoratorFn, () => __ΩHttpActionFluidDecorator, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, 'Pn!P7#n$o"#
|
|
433
|
+
const __ΩHttpMerge = ['U', "response", 'statusCode', 'description', () => __ΩReceiveType, 'type', () => __ΩPropertyDecoratorFn, '', 'a', () => __ΩDualDecorator, () => __ΩPropertyDecoratorFn, 'l\u00A3P\'2#&2$8"o%"2&8Pn\'e)!K/(RPe\'!@2)Pn+e&!e/!K/(RPe\'!@2)e%!/(RPe#!n*qk<PQRPde#"p]R!RPdde(!e%!fPh"!@2)h""/(qkiqQRPe#!."qk#sQRPde#!p\u008FRb!Pde"!gN\u009B!y'];
|
|
434
|
+
const __ΩMergedHttp = ['T', () => __ΩHttpMerge, () => __ΩOmit, () => __ΩUnionToIntersection, "_fetch", "t", 'b!e!!\'fo$"P.%.&Jo##o""y'];
|
|
435
|
+
const __ΩHttpDecorator = [() => __ΩPropertyDecoratorFn, () => __ΩHttpActionFluidDecorator, () => HttpActionDecorator, () => __ΩPropertyDecoratorFn, 'Pn!P7#n$o"#Ky'];
|
|
420
436
|
exports.__ΩHttpDecorator = __ΩHttpDecorator;
|
|
421
437
|
exports.http = (0, type_1.mergeDecorator)(exports.httpClass, exports.httpAction);
|
|
422
438
|
//# sourceMappingURL=decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/decorator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/decorator.ts"],"names":[],"mappings":";;;;;;;iCAU4C,eAAe;;4CAkBpD,eAAe;;8CACiB,aAAa;;mCAD7C,eAAe;;sCAEiE,iBAAiB;;wCAAjB,iBAAiB;;0CAFjG,eAAe;;oCAAf,eAAe;;2CAAf,eAAe;;kDAAf,eAAe;;qCAAf,eAAe;;2CAAf,eAAe;;;;;AA5BtB;;;;;;;;GAQG;AAEH,wCAA4D;AAC5D,wCAiBuB;AAEvB,mDAAyG;;AAIzG,SAAS,yB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B,IAAI,IAAI;YAAE,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;IACjC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,QAAQ,CAAI,UAAkB,EAAE,WAAwB,EAAE,IAAqB;;oCAA/C,EAAA,gBAAwB;6BAAE,EAAA;QAvB1D;;;;;;;;;;;;;;;;;;;;;;WAsBG;QACH,QAAQ,8CAAuE;aAA/E,QAAQ;QACJ,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAA,yBAAkB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;KACzG;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,gBAAgB,CAAC,SAAmC,EAAE,QAA2C;QAC7F,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBAAsB,CAAC,IAAY,EAAE,QAA2C;QAC5E,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;;AArML,kDAsMC;;;;AAYY,QAAA,UAAU,GAAsC,IAAA,qCAA8B,EAAC,mBAAmB,CAAC,CAAC;;;;;AAQpG,QAAA,IAAI,GAAsD,IAAA,qBAAc,EAAC,iBAAS,EAAE,kBAAU,CAA6D,CAAC"}
|
package/dist/cjs/src/filter.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.HttpRouteFilter = exports.HttpRouterFilterResolver = exports.HttpRouteFi
|
|
|
5
5
|
const { __ΩClassType } = require('@deepkit/core');
|
|
6
6
|
const app_1 = require("@deepkit/app");
|
|
7
7
|
const router_js_1 = require("./router.js");
|
|
8
|
-
const __ΩHttpRouteFilterRoute = ['path', 'pathRegExp', "GET", "HEAD", "POST", "PATCH", "PUT", "DELETE", "OPTIONS", "TRACE", 'httpMethod', 'category', 'group', 'P&4!8A4"8P.#.$.%.&.\'.(.).*J4+8&4,8&4-
|
|
8
|
+
const __ΩHttpRouteFilterRoute = ['path', 'pathRegExp', "GET", "HEAD", "POST", "PATCH", "PUT", "DELETE", "OPTIONS", "TRACE", 'httpMethod', 'category', 'group', 'P&4!8A4"8P.#.$.%.&.\'.(.).*J4+8&4,8&4-8My'];
|
|
9
9
|
exports.__ΩHttpRouteFilterRoute = __ΩHttpRouteFilterRoute;
|
|
10
10
|
class HttpRouteFilterModel {
|
|
11
11
|
constructor() {
|
|
@@ -32,7 +32,7 @@ class HttpRouteFilterModel {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
exports.HttpRouteFilterModel = HttpRouteFilterModel;
|
|
35
|
-
HttpRouteFilterModel.__type = [() => __ΩClassType, 'controllers', function () { return []; }, () => __ΩClassType, 'excludeControllers', function () { return []; }, () => __ΩHttpRouteFilterRoute, 'routes', function () { return []; }, () => __ΩHttpRouteFilterRoute, 'excludeRoutes', function () { return []; }, 'routeNames', function () { return []; }, 'excludeRouteNames', function () { return []; }, () => app_1.AppModule, 'modules', function () { return []; }, () => app_1.AppModule, 'excludeModules', function () { return []; }, () => __ΩClassType, () => app_1.AppModule, 'moduleClasses', function () { return []; }, () => __ΩClassType, () => app_1.AppModule, 'excludeModuleClasses', function () { return []; }, 'reset', 'n!F3">#n$F3%>&n\'F3(>)n*F3+>,&F3->.&F3/>0P"71F32>3P"74F35>6P"78o7"F39>:P"7<o;"F3=>>P"0?
|
|
35
|
+
HttpRouteFilterModel.__type = [() => __ΩClassType, 'controllers', function () { return []; }, () => __ΩClassType, 'excludeControllers', function () { return []; }, () => __ΩHttpRouteFilterRoute, 'routes', function () { return []; }, () => __ΩHttpRouteFilterRoute, 'excludeRoutes', function () { return []; }, 'routeNames', function () { return []; }, 'excludeRouteNames', function () { return []; }, () => app_1.AppModule, 'modules', function () { return []; }, () => app_1.AppModule, 'excludeModules', function () { return []; }, () => __ΩClassType, () => app_1.AppModule, 'moduleClasses', function () { return []; }, () => __ΩClassType, () => app_1.AppModule, 'excludeModuleClasses', function () { return []; }, 'reset', 'HttpRouteFilterModel', 'n!F3">#n$F3%>&n\'F3(>)n*F3+>,&F3->.&F3/>0P"71F32>3P"74F35>6P"78o7"F39>:P"7<o;"F3=>>P"0?5w@'];
|
|
36
36
|
function match(routeConfig, route) {
|
|
37
37
|
if (route.httpMethod && routeConfig.httpMethods.includes(route.httpMethod))
|
|
38
38
|
return true;
|
|
@@ -157,7 +157,7 @@ class HttpRouterFilterResolver {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
exports.HttpRouterFilterResolver = HttpRouterFilterResolver;
|
|
160
|
-
HttpRouterFilterResolver.__type = [() => router_js_1.HttpRouter, 'router', 'constructor', () => HttpRouteFilterModel, 'filter', () => router_js_1.RouteConfig, 'resolve', 'PP7!2"<"0#PP7$2%P7&F0\'
|
|
160
|
+
HttpRouterFilterResolver.__type = [() => router_js_1.HttpRouter, 'router', 'constructor', () => HttpRouteFilterModel, 'filter', () => router_js_1.RouteConfig, 'resolve', 'HttpRouterFilterResolver', 'PP7!2"<"0#PP7$2%P7&F0\'5w('];
|
|
161
161
|
/**
|
|
162
162
|
* A class to describe a filter for routes.
|
|
163
163
|
*/
|
|
@@ -211,5 +211,5 @@ class HttpRouteFilter {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
exports.HttpRouteFilter = HttpRouteFilter;
|
|
214
|
-
HttpRouteFilter.__type = ['reset', () => __ΩClassType, 'controllers', 'forControllers', () => __ΩClassType, 'excludeControllers', () => __ΩHttpRouteFilterRoute, 'routes', 'forRoutes', () => __ΩHttpRouteFilterRoute, 'excludeRoutes', 'names', 'forRouteNames', 'excludeRouteNames', () => app_1.AppModule, 'modules', 'forModules', () => app_1.AppModule, 'excludeModules', () => __ΩClassType, () => app_1.AppModule, 'moduleClasses', 'forModuleClasses', () => __ΩClassType, () => app_1.AppModule, 'excludeModuleClasses', 'P!0!Pn"@2#!0$Pn%@2#!0&Pn\'@2(!0)Pn*@2(!0+P&@2,!0-P&@2,!0.PP"7/@20!01PP"72@20!03PP"75o4"@26!07PP"79o8"@26!0:
|
|
214
|
+
HttpRouteFilter.__type = ['reset', () => __ΩClassType, 'controllers', 'forControllers', () => __ΩClassType, 'excludeControllers', () => __ΩHttpRouteFilterRoute, 'routes', 'forRoutes', () => __ΩHttpRouteFilterRoute, 'excludeRoutes', 'names', 'forRouteNames', 'excludeRouteNames', () => app_1.AppModule, 'modules', 'forModules', () => app_1.AppModule, 'excludeModules', () => __ΩClassType, () => app_1.AppModule, 'moduleClasses', 'forModuleClasses', () => __ΩClassType, () => app_1.AppModule, 'excludeModuleClasses', 'HttpRouteFilter', 'P!0!Pn"@2#!0$Pn%@2#!0&Pn\'@2(!0)Pn*@2(!0+P&@2,!0-P&@2,!0.PP"7/@20!01PP"72@20!03PP"75o4"@26!07PP"79o8"@26!0:5w;'];
|
|
215
215
|
//# sourceMappingURL=filter.js.map
|
package/dist/cjs/src/http-app.js
CHANGED
package/dist/cjs/src/http.d.ts
CHANGED
|
@@ -225,7 +225,7 @@ export declare class JSONResponse extends BaseResponse {
|
|
|
225
225
|
json: any;
|
|
226
226
|
constructor(json: any, statusCode?: number);
|
|
227
227
|
}
|
|
228
|
-
export
|
|
228
|
+
export type SupportedHttpResult = undefined | null | number | string | Response | JSONResponse | HtmlResponse | HttpResponse | ServerResponse | stream.Readable | Redirect | Uint8Array | Error;
|
|
229
229
|
export interface HttpResultFormatterContext {
|
|
230
230
|
request: HttpRequest;
|
|
231
231
|
response: HttpResponse;
|
package/dist/cjs/src/http.js
CHANGED
|
@@ -13,6 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.HttpListener = exports.HttpResultFormatter = exports.__ΩHttpResultFormatterContext = exports.__ΩSupportedHttpResult = exports.JSONResponse = exports.HtmlResponse = exports.Response = exports.BaseResponse = exports.httpWorkflow = exports.HttpControllerErrorEvent = exports.HttpResponseEvent = exports.HttpControllerEvent = exports.HttpResolveParametersEvent = exports.HttpAccessDeniedEvent = exports.HttpAuthEvent = exports.HttpRouteEvent = exports.HttpWorkflowEventWithRoute = exports.HttpRouteNotFoundEvent = exports.HttpRequestEvent = exports.HttpWorkflowEvent = exports.HttpNotImplementedError = exports.HttpInternalServerError = exports.HttpTooManyRequestsError = exports.HttpGoneError = exports.HttpConflictError = exports.HttpTimeoutError = exports.HttpNotAcceptableError = exports.HttpMethodNotAllowedError = exports.HttpNotFoundError = exports.HttpAccessDeniedError = exports.HttpUnauthorizedError = exports.HttpBadRequestError = exports.createHttpError = exports.HttpError = exports.Redirect = exports.isElementStruct = void 0;
|
|
16
|
+
const __ΩError = ['name', 'message', 'stack', 'P&4!&4"&4#8My'];
|
|
16
17
|
/*@ts-ignore*/
|
|
17
18
|
const { __ΩClassType } = require('@deepkit/core');
|
|
18
19
|
/*@ts-ignore*/
|
|
@@ -25,7 +26,6 @@ function __assignType(fn, args) {
|
|
|
25
26
|
fn.__type = args;
|
|
26
27
|
return fn;
|
|
27
28
|
}
|
|
28
|
-
const __ΩError = ['name', 'message', 'stack', 'P&4!&4"&4#8M'];
|
|
29
29
|
/*
|
|
30
30
|
* Deepkit Framework
|
|
31
31
|
* Copyright (C) 2021 Deepkit UG, Marc J. Schmidt
|
|
@@ -76,7 +76,7 @@ class Redirect {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
exports.Redirect = Redirect;
|
|
79
|
-
Redirect.__type = ['routeName', 'routeParameters', 'url', 'statusCode', () => 302, 'constructor', 'parameters', () => ({}), () => 302, () => Redirect, 'toRoute', () => 302, () => Redirect, 'toUrl', '&3!8P&"LM3"8&3#8P\'2$:>%"0&P&2!P&"LM2\'>(\'2$>)P7*0+sP&2#\'2$>,P7-0.
|
|
79
|
+
Redirect.__type = ['routeName', 'routeParameters', 'url', 'statusCode', () => 302, 'constructor', 'parameters', () => ({}), () => 302, () => Redirect, 'toRoute', () => 302, () => Redirect, 'toUrl', 'Redirect', '&3!8P&"LM3"8&3#8P\'2$:>%"0&P&2!P&"LM2\'>(\'2$>)P7*0+sP&2#\'2$>,P7-0.s5w/'];
|
|
80
80
|
class HttpError extends core_1.CustomError {
|
|
81
81
|
constructor(message, httpCode) {
|
|
82
82
|
super(message);
|
|
@@ -85,7 +85,7 @@ class HttpError extends core_1.CustomError {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
exports.HttpError = HttpError;
|
|
88
|
-
HttpError.__type = ['T', () => core_1.CustomError, 'message', 'httpCode', 'constructor', 'b!P7"P&2#:e"!2$:"0%
|
|
88
|
+
HttpError.__type = ['T', () => core_1.CustomError, 'message', 'httpCode', 'constructor', 'HttpError', 'b!P7"P&2#:e"!2$:"0%5w&'];
|
|
89
89
|
function createHttpError(code, defaultMessage = '') {
|
|
90
90
|
var _a;
|
|
91
91
|
return _a = class extends HttpError {
|
|
@@ -102,58 +102,52 @@ createHttpError.__type = ['code', 'defaultMessage', () => "", () => __ΩClassTyp
|
|
|
102
102
|
class HttpBadRequestError extends createHttpError(400, 'Bad request') {
|
|
103
103
|
}
|
|
104
104
|
exports.HttpBadRequestError = HttpBadRequestError;
|
|
105
|
-
HttpBadRequestError.__type = [() => createHttpError(400, "Bad request"), 'P7!
|
|
105
|
+
HttpBadRequestError.__type = [() => createHttpError(400, "Bad request"), 'HttpBadRequestError', 'P7!5w"'];
|
|
106
106
|
class HttpUnauthorizedError extends createHttpError(401, 'Unauthorized') {
|
|
107
107
|
}
|
|
108
108
|
exports.HttpUnauthorizedError = HttpUnauthorizedError;
|
|
109
|
-
HttpUnauthorizedError.__type = [() => createHttpError(401, "Unauthorized"), 'P7!
|
|
109
|
+
HttpUnauthorizedError.__type = [() => createHttpError(401, "Unauthorized"), 'HttpUnauthorizedError', 'P7!5w"'];
|
|
110
110
|
class HttpAccessDeniedError extends createHttpError(403, 'Access denied') {
|
|
111
111
|
}
|
|
112
112
|
exports.HttpAccessDeniedError = HttpAccessDeniedError;
|
|
113
|
-
HttpAccessDeniedError.__type = [() => createHttpError(403, "Access denied"), 'P7!
|
|
113
|
+
HttpAccessDeniedError.__type = [() => createHttpError(403, "Access denied"), 'HttpAccessDeniedError', 'P7!5w"'];
|
|
114
114
|
class HttpNotFoundError extends createHttpError(404, 'Not found') {
|
|
115
115
|
}
|
|
116
116
|
exports.HttpNotFoundError = HttpNotFoundError;
|
|
117
|
-
HttpNotFoundError.__type = [() => createHttpError(404, "Not found"), 'P7!
|
|
117
|
+
HttpNotFoundError.__type = [() => createHttpError(404, "Not found"), 'HttpNotFoundError', 'P7!5w"'];
|
|
118
118
|
class HttpMethodNotAllowedError extends createHttpError(405, 'Method not allowed') {
|
|
119
119
|
}
|
|
120
120
|
exports.HttpMethodNotAllowedError = HttpMethodNotAllowedError;
|
|
121
|
-
HttpMethodNotAllowedError.__type = [() => createHttpError(405, "Method not allowed"), 'P7!
|
|
121
|
+
HttpMethodNotAllowedError.__type = [() => createHttpError(405, "Method not allowed"), 'HttpMethodNotAllowedError', 'P7!5w"'];
|
|
122
122
|
class HttpNotAcceptableError extends createHttpError(406, 'Not acceptable') {
|
|
123
123
|
}
|
|
124
124
|
exports.HttpNotAcceptableError = HttpNotAcceptableError;
|
|
125
|
-
HttpNotAcceptableError.__type = [() => createHttpError(406, "Not acceptable"), 'P7!
|
|
125
|
+
HttpNotAcceptableError.__type = [() => createHttpError(406, "Not acceptable"), 'HttpNotAcceptableError', 'P7!5w"'];
|
|
126
126
|
class HttpTimeoutError extends createHttpError(408, 'Request timeout') {
|
|
127
127
|
}
|
|
128
128
|
exports.HttpTimeoutError = HttpTimeoutError;
|
|
129
|
-
HttpTimeoutError.__type = [() => createHttpError(408, "Request timeout"), 'P7!
|
|
129
|
+
HttpTimeoutError.__type = [() => createHttpError(408, "Request timeout"), 'HttpTimeoutError', 'P7!5w"'];
|
|
130
130
|
class HttpConflictError extends createHttpError(409, 'Conflict') {
|
|
131
131
|
}
|
|
132
132
|
exports.HttpConflictError = HttpConflictError;
|
|
133
|
-
HttpConflictError.__type = [() => createHttpError(409, "Conflict"), 'P7!
|
|
133
|
+
HttpConflictError.__type = [() => createHttpError(409, "Conflict"), 'HttpConflictError', 'P7!5w"'];
|
|
134
134
|
class HttpGoneError extends createHttpError(410, 'Gone') {
|
|
135
135
|
}
|
|
136
136
|
exports.HttpGoneError = HttpGoneError;
|
|
137
|
-
HttpGoneError.__type = [() => createHttpError(410, "Gone"), 'P7!
|
|
137
|
+
HttpGoneError.__type = [() => createHttpError(410, "Gone"), 'HttpGoneError', 'P7!5w"'];
|
|
138
138
|
class HttpTooManyRequestsError extends createHttpError(429, 'Too many requests') {
|
|
139
139
|
}
|
|
140
140
|
exports.HttpTooManyRequestsError = HttpTooManyRequestsError;
|
|
141
|
-
HttpTooManyRequestsError.__type = [() => createHttpError(429, "Too many requests"), 'P7!
|
|
141
|
+
HttpTooManyRequestsError.__type = [() => createHttpError(429, "Too many requests"), 'HttpTooManyRequestsError', 'P7!5w"'];
|
|
142
142
|
class HttpInternalServerError extends createHttpError(500, 'Internal server error') {
|
|
143
143
|
}
|
|
144
144
|
exports.HttpInternalServerError = HttpInternalServerError;
|
|
145
|
-
HttpInternalServerError.__type = [() => createHttpError(500, "Internal server error"), 'P7!
|
|
145
|
+
HttpInternalServerError.__type = [() => createHttpError(500, "Internal server error"), 'HttpInternalServerError', 'P7!5w"'];
|
|
146
146
|
class HttpNotImplementedError extends createHttpError(501, 'Not implemented') {
|
|
147
147
|
}
|
|
148
148
|
exports.HttpNotImplementedError = HttpNotImplementedError;
|
|
149
|
-
HttpNotImplementedError.__type = [() => createHttpError(501, "Not implemented"), 'P7!
|
|
149
|
+
HttpNotImplementedError.__type = [() => createHttpError(501, "Not implemented"), 'HttpNotImplementedError', 'P7!5w"'];
|
|
150
150
|
class HttpWorkflowEvent {
|
|
151
|
-
constructor(injectorContext, request, response) {
|
|
152
|
-
this.injectorContext = injectorContext;
|
|
153
|
-
this.request = request;
|
|
154
|
-
this.response = response;
|
|
155
|
-
this.propagationStopped = false;
|
|
156
|
-
}
|
|
157
151
|
stopPropagation() {
|
|
158
152
|
this.propagationStopped = true;
|
|
159
153
|
}
|
|
@@ -177,6 +171,12 @@ class HttpWorkflowEvent {
|
|
|
177
171
|
hasNext() {
|
|
178
172
|
return this.nextState !== undefined;
|
|
179
173
|
}
|
|
174
|
+
constructor(injectorContext, request, response) {
|
|
175
|
+
this.injectorContext = injectorContext;
|
|
176
|
+
this.request = request;
|
|
177
|
+
this.response = response;
|
|
178
|
+
this.propagationStopped = false;
|
|
179
|
+
}
|
|
180
180
|
get url() {
|
|
181
181
|
return this.request.url || '/';
|
|
182
182
|
}
|
|
@@ -191,7 +191,7 @@ class HttpWorkflowEvent {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
exports.HttpWorkflowEvent = HttpWorkflowEvent;
|
|
194
|
-
HttpWorkflowEvent.__type = ['stopPropagation', 'isPropagationStopped', 'nextState', 'nextStateEvent', 'clearNext', 'event', 'next', 'hasNext', () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', 'constructor', 'send', 'P"0!P"0""3#8"3$8P"0%P&2#"2&8"0\'P)0(PP7)2*:P7+2,:P7-2.:"0/!!P"2."
|
|
194
|
+
HttpWorkflowEvent.__type = ['stopPropagation', 'isPropagationStopped', 'nextState', 'nextStateEvent', 'clearNext', 'event', 'next', 'hasNext', () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', 'constructor', 'send', 'HttpWorkflowEvent', 'P"0!P"0""3#8"3$8P"0%P&2#"2&8"0\'P)0(PP7)2*:P7+2,:P7-2.:"0/!!P"2."005w1'];
|
|
195
195
|
exports.HttpRequestEvent = HttpWorkflowEvent;
|
|
196
196
|
exports.HttpRouteNotFoundEvent = HttpWorkflowEvent;
|
|
197
197
|
class HttpWorkflowEventWithRoute extends HttpWorkflowEvent {
|
|
@@ -210,7 +210,7 @@ class HttpWorkflowEventWithRoute extends HttpWorkflowEvent {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
exports.HttpWorkflowEventWithRoute = HttpWorkflowEventWithRoute;
|
|
213
|
-
HttpWorkflowEventWithRoute.__type = [() => HttpWorkflowEvent, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', 'constructor', 'send', () => __ΩError, 'error', 'accessDenied', 'P7!PP7"2#:P7$2%:P7&2\':P7(2):"0*P"2\'"0+Pn,2-8"0.
|
|
213
|
+
HttpWorkflowEventWithRoute.__type = [() => HttpWorkflowEvent, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', 'constructor', 'send', () => __ΩError, 'error', 'accessDenied', 'HttpWorkflowEventWithRoute', 'P7!PP7"2#:P7$2%:P7&2\':P7(2):"0*P"2\'"0+Pn,2-8"0.5w/'];
|
|
214
214
|
class HttpRouteEvent extends HttpWorkflowEvent {
|
|
215
215
|
constructor(injectorContext, request, response, parameterResolver, route) {
|
|
216
216
|
super(injectorContext, request, response);
|
|
@@ -229,7 +229,7 @@ class HttpRouteEvent extends HttpWorkflowEvent {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
exports.HttpRouteEvent = HttpRouteEvent;
|
|
232
|
-
HttpRouteEvent.__type = [() => HttpWorkflowEvent, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => __ΩRouteParameterResolverForInjector, 'parameterResolver', () => router_js_1.RouteConfig, 'route', 'constructor', () => router_js_1.RouteConfig, () => __ΩRouteParameterResolverForInjector, 'routeFound', 'notFound', 'P7!PP7"2#:P7$2%:P7&2\':n(2)8:P7*2+8:"0,PP7-2+n.2)"0/P"
|
|
232
|
+
HttpRouteEvent.__type = [() => HttpWorkflowEvent, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => __ΩRouteParameterResolverForInjector, 'parameterResolver', () => router_js_1.RouteConfig, 'route', 'constructor', () => router_js_1.RouteConfig, () => __ΩRouteParameterResolverForInjector, 'routeFound', 'notFound', 'HttpRouteEvent', 'P7!PP7"2#:P7$2%:P7&2\':n(2)8:P7*2+8:"0,PP7-2+n.2)"0/P"005w1'];
|
|
233
233
|
class HttpAuthEvent extends HttpWorkflowEventWithRoute {
|
|
234
234
|
constructor(injectorContext, request, response, route, parameterResolver) {
|
|
235
235
|
super(injectorContext, request, response, route);
|
|
@@ -244,7 +244,7 @@ class HttpAuthEvent extends HttpWorkflowEventWithRoute {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
exports.HttpAuthEvent = HttpAuthEvent;
|
|
247
|
-
HttpAuthEvent.__type = [() => HttpWorkflowEventWithRoute, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', () => __ΩRouteParameterResolverForInjector, 'parameterResolver', 'constructor', 'success', 'P7!PP7"2#:P7$2%:P7&2\':P7(2):n*2+:"0,P"0-
|
|
247
|
+
HttpAuthEvent.__type = [() => HttpWorkflowEventWithRoute, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', () => __ΩRouteParameterResolverForInjector, 'parameterResolver', 'constructor', 'success', 'HttpAuthEvent', 'P7!PP7"2#:P7$2%:P7&2\':P7(2):n*2+:"0,P"0-5w.'];
|
|
248
248
|
class HttpAccessDeniedEvent extends HttpWorkflowEvent {
|
|
249
249
|
constructor(injectorContext, request, response, route, error) {
|
|
250
250
|
super(injectorContext, request, response);
|
|
@@ -256,7 +256,7 @@ class HttpAccessDeniedEvent extends HttpWorkflowEvent {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
exports.HttpAccessDeniedEvent = HttpAccessDeniedEvent;
|
|
259
|
-
HttpAccessDeniedEvent.__type = [() => HttpWorkflowEvent, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', () => __ΩError, 'error', 'constructor', 'P7!PP7"2#:P7$2%:P7&2\':P7(2):n*2+8:"0,
|
|
259
|
+
HttpAccessDeniedEvent.__type = [() => HttpWorkflowEvent, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', () => __ΩError, 'error', 'constructor', 'HttpAccessDeniedEvent', 'P7!PP7"2#:P7$2%:P7&2\':P7(2):n*2+8:"0,5w-'];
|
|
260
260
|
class HttpResolveParametersEvent extends HttpWorkflowEventWithRoute {
|
|
261
261
|
constructor(injectorContext, request, response, parameterResolver, route) {
|
|
262
262
|
super(injectorContext, request, response, route);
|
|
@@ -272,7 +272,7 @@ class HttpResolveParametersEvent extends HttpWorkflowEventWithRoute {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
exports.HttpResolveParametersEvent = HttpResolveParametersEvent;
|
|
275
|
-
HttpResolveParametersEvent.__type = [() => HttpWorkflowEventWithRoute, () => __ΩHttpRequestPositionedParameters, 'parameters', function () { return { arguments: [], parameters: {} }; }, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => __ΩRouteParameterResolverForInjector, 'parameterResolver', () => router_js_1.RouteConfig, 'route', 'constructor', 'accessDenied', 'P7!n"3#>$PP7%2&:P7\'2(:P7)2*:n+2,:P7-2.:"0/P"
|
|
275
|
+
HttpResolveParametersEvent.__type = [() => HttpWorkflowEventWithRoute, () => __ΩHttpRequestPositionedParameters, 'parameters', function () { return { arguments: [], parameters: {} }; }, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => __ΩRouteParameterResolverForInjector, 'parameterResolver', () => router_js_1.RouteConfig, 'route', 'constructor', 'accessDenied', 'HttpResolveParametersEvent', 'P7!n"3#>$PP7%2&:P7\'2(:P7)2*:n+2,:P7-2.:"0/P"005w1'];
|
|
276
276
|
class HttpControllerEvent extends HttpWorkflowEventWithRoute {
|
|
277
277
|
constructor(injectorContext, request, response, parameters = { arguments: [], parameters: {} }, route) {
|
|
278
278
|
super(injectorContext, request, response, route);
|
|
@@ -284,7 +284,7 @@ class HttpControllerEvent extends HttpWorkflowEventWithRoute {
|
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
exports.HttpControllerEvent = HttpControllerEvent;
|
|
287
|
-
HttpControllerEvent.__type = [() => HttpWorkflowEventWithRoute, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => __ΩHttpRequestPositionedParameters, 'parameters', () => ({ arguments: [], parameters: {} }), () => router_js_1.RouteConfig, 'route', 'constructor', 'P7!PP7"2#:P7$2%:P7&2\':n(2):>*P7+2,:"0-
|
|
287
|
+
HttpControllerEvent.__type = [() => HttpWorkflowEventWithRoute, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => __ΩHttpRequestPositionedParameters, 'parameters', () => ({ arguments: [], parameters: {} }), () => router_js_1.RouteConfig, 'route', 'constructor', 'HttpControllerEvent', 'P7!PP7"2#:P7$2%:P7&2\':n(2):>*P7+2,:"0-5w.'];
|
|
288
288
|
class HttpResponseEvent extends workflow_1.WorkflowEvent {
|
|
289
289
|
constructor(injectorContext, request, response, result, route) {
|
|
290
290
|
super();
|
|
@@ -300,7 +300,7 @@ class HttpResponseEvent extends workflow_1.WorkflowEvent {
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
exports.HttpResponseEvent = HttpResponseEvent;
|
|
303
|
-
HttpResponseEvent.__type = [() => workflow_1.WorkflowEvent, 'controllerActionTime', function () { return 0; }, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', 'result', () => router_js_1.RouteConfig, 'route', 'constructor', 'P7!\'3">#PP7$2%:P7&2\':P7(2):"2*:P7+2,8:"0-
|
|
303
|
+
HttpResponseEvent.__type = [() => workflow_1.WorkflowEvent, 'controllerActionTime', function () { return 0; }, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', 'result', () => router_js_1.RouteConfig, 'route', 'constructor', 'HttpResponseEvent', 'P7!\'3">#PP7$2%:P7&2\':P7(2):"2*:P7+2,8:"0-5w.'];
|
|
304
304
|
class HttpControllerErrorEvent extends HttpWorkflowEventWithRoute {
|
|
305
305
|
constructor(injectorContext, request, response, route, error) {
|
|
306
306
|
super(injectorContext, request, response, route);
|
|
@@ -316,7 +316,7 @@ class HttpControllerErrorEvent extends HttpWorkflowEventWithRoute {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
exports.HttpControllerErrorEvent = HttpControllerErrorEvent;
|
|
319
|
-
HttpControllerErrorEvent.__type = [() => HttpWorkflowEventWithRoute, 'controllerActionTime', function () { return 0; }, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', () => __ΩError, 'error', 'constructor', 'P7!\'3">#PP7$2%:P7&2\':P7(2):P7*2+:n,2-:"0.
|
|
319
|
+
HttpControllerErrorEvent.__type = [() => HttpWorkflowEventWithRoute, 'controllerActionTime', function () { return 0; }, () => injector_1.InjectorContext, 'injectorContext', () => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', () => __ΩError, 'error', 'constructor', 'HttpControllerErrorEvent', 'P7!\'3">#PP7$2%:P7&2\':P7(2):P7*2+:n,2-:"0.5w/'];
|
|
320
320
|
exports.httpWorkflow = (0, workflow_1.createWorkflow)('http', {
|
|
321
321
|
start: workflow_1.WorkflowEvent,
|
|
322
322
|
request: exports.HttpRequestEvent,
|
|
@@ -373,7 +373,7 @@ class BaseResponse {
|
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
exports.BaseResponse = BaseResponse;
|
|
376
|
-
BaseResponse.__type = ['autoSerializing', function () { return true; }, '_statusCode', '_headers', () => ({}), 'constructor', 'code', 'status', 'disableAutoSerializing', 'name', 'value', 'header', 'headers', 'type', 'contentType', ')3!>"P\'2#8:!2$:>%"0&P\'2\'!0(P"0)P&2*P&\'J2+!0,P!2-!0-P&2.!0/
|
|
376
|
+
BaseResponse.__type = ['autoSerializing', function () { return true; }, '_statusCode', '_headers', () => ({}), 'constructor', 'code', 'status', 'disableAutoSerializing', 'name', 'value', 'header', 'headers', 'type', 'contentType', 'BaseResponse', ')3!>"P\'2#8:!2$:>%"0&P\'2\'!0(P"0)P&2*P&\'J2+!0,P!2-!0-P&2.!0/5w0'];
|
|
377
377
|
class Response extends BaseResponse {
|
|
378
378
|
constructor(content, contentType, statusCode) {
|
|
379
379
|
super(statusCode);
|
|
@@ -382,7 +382,7 @@ class Response extends BaseResponse {
|
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
exports.Response = Response;
|
|
385
|
-
Response.__type = [() => BaseResponse, 'content', 'contentType', 'statusCode', 'constructor', 'P7!PP&WJ2":&2#\'2$8"0%
|
|
385
|
+
Response.__type = [() => BaseResponse, 'content', 'contentType', 'statusCode', 'constructor', 'Response', 'P7!PP&WJ2":&2#\'2$8"0%5w&'];
|
|
386
386
|
class HtmlResponse extends BaseResponse {
|
|
387
387
|
constructor(html, statusCode) {
|
|
388
388
|
super(statusCode);
|
|
@@ -390,7 +390,7 @@ class HtmlResponse extends BaseResponse {
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
exports.HtmlResponse = HtmlResponse;
|
|
393
|
-
HtmlResponse.__type = [() => BaseResponse, 'html', 'statusCode', 'constructor', 'P7!P&2":\'2#8"0$
|
|
393
|
+
HtmlResponse.__type = [() => BaseResponse, 'html', 'statusCode', 'constructor', 'HtmlResponse', 'P7!P&2":\'2#8"0$5w%'];
|
|
394
394
|
class JSONResponse extends BaseResponse {
|
|
395
395
|
constructor(json, statusCode) {
|
|
396
396
|
super(statusCode);
|
|
@@ -398,10 +398,10 @@ class JSONResponse extends BaseResponse {
|
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
exports.JSONResponse = JSONResponse;
|
|
401
|
-
JSONResponse.__type = [() => BaseResponse, 'json', 'statusCode', 'constructor', 'P7!P"2":\'2#8"0$
|
|
402
|
-
const __ΩSupportedHttpResult = [() => Response, () => JSONResponse, () => HtmlResponse, () => model_js_1.HttpResponse, () => Redirect, () => __ΩError, 'P-,\'&P7!P7"P7#P7$!!P7%Wn&
|
|
401
|
+
JSONResponse.__type = [() => BaseResponse, 'json', 'statusCode', 'constructor', 'JSONResponse', 'P7!P"2":\'2#8"0$5w%'];
|
|
402
|
+
const __ΩSupportedHttpResult = [() => Response, () => JSONResponse, () => HtmlResponse, () => model_js_1.HttpResponse, () => Redirect, () => __ΩError, 'P-,\'&P7!P7"P7#P7$!!P7%Wn&Jy'];
|
|
403
403
|
exports.__ΩSupportedHttpResult = __ΩSupportedHttpResult;
|
|
404
|
-
const __ΩHttpResultFormatterContext = [() => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', 'PP7!4"P7#4$P7%4&
|
|
404
|
+
const __ΩHttpResultFormatterContext = [() => model_js_1.HttpRequest, 'request', () => model_js_1.HttpResponse, 'response', () => router_js_1.RouteConfig, 'route', 'PP7!4"P7#4$P7%4&8My'];
|
|
405
405
|
exports.__ΩHttpResultFormatterContext = __ΩHttpResultFormatterContext;
|
|
406
406
|
class HttpResultFormatter {
|
|
407
407
|
constructor(router) {
|
|
@@ -528,7 +528,7 @@ class HttpResultFormatter {
|
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
exports.HttpResultFormatter = HttpResultFormatter;
|
|
531
|
-
HttpResultFormatter.__type = ['jsonContentType', function () { return 'application/json; charset=utf-8'; }, 'htmlContentType', function () { return 'text/html; charset=utf-8'; }, () => router_js_1.HttpRouter, 'router', 'constructor', () => model_js_1.HttpResponse, 'response', 'contentType', 'setContentTypeIfNotSetAlready', () => __ΩError, 'error', () => __ΩHttpResultFormatterContext, 'context', 'handleError', 'result', () => __ΩHttpResultFormatterContext, 'handleUndefined', () => Redirect, () => __ΩHttpResultFormatterContext, 'handleRedirect', () => __ΩHttpResultFormatterContext, 'handleUnknown', () => HtmlResponse, () => __ΩHttpResultFormatterContext, 'handleHtmlResponse', () => Response, () => __ΩHttpResultFormatterContext, 'handleGenericResponse', () => JSONResponse, () => __ΩHttpResultFormatterContext, 'handleJSONResponse', () => __ΩClassType, 'classType', 'instance', () => __ΩHttpResultFormatterContext, () => router_js_1.RouteConfig, 'route', 'handleTypeEntity', 'type', () => __ΩHttpResultFormatterContext, () => router_js_1.RouteConfig, 'handleType', 'stream', () => __ΩHttpResultFormatterContext, 'handleStream', () => __ΩHttpResultFormatterContext, 'handleBinary', () => __ΩHttpResultFormatterContext, 'handleResponse', () => __ΩSupportedHttpResult, () => __ΩHttpResultFormatterContext, 'handle', '&3!<>"&3#<>$PP7%2&<"0\'PP7(2)&2*$0+<Pn,2-n.2/$00PP-,J21n22/$03PP7421n52/$06P"21n72/$08PP7921n:2/$0;PP7<21n=2/$0>PP7?21n@2/$0AP"oB"2C"2DnE2/P7F2G8$0HP"2I"2DnJ2/P7K2G8$0LP!2MnN2/$0OPW21nP2/$0QPnR2/"0SPnT21nU2/$
|
|
531
|
+
HttpResultFormatter.__type = ['jsonContentType', function () { return 'application/json; charset=utf-8'; }, 'htmlContentType', function () { return 'text/html; charset=utf-8'; }, () => router_js_1.HttpRouter, 'router', 'constructor', () => model_js_1.HttpResponse, 'response', 'contentType', 'setContentTypeIfNotSetAlready', () => __ΩError, 'error', () => __ΩHttpResultFormatterContext, 'context', 'handleError', 'result', () => __ΩHttpResultFormatterContext, 'handleUndefined', () => Redirect, () => __ΩHttpResultFormatterContext, 'handleRedirect', () => __ΩHttpResultFormatterContext, 'handleUnknown', () => HtmlResponse, () => __ΩHttpResultFormatterContext, 'handleHtmlResponse', () => Response, () => __ΩHttpResultFormatterContext, 'handleGenericResponse', () => JSONResponse, () => __ΩHttpResultFormatterContext, 'handleJSONResponse', () => __ΩClassType, 'classType', 'instance', () => __ΩHttpResultFormatterContext, () => router_js_1.RouteConfig, 'route', 'handleTypeEntity', 'type', () => __ΩHttpResultFormatterContext, () => router_js_1.RouteConfig, 'handleType', 'stream', () => __ΩHttpResultFormatterContext, 'handleStream', () => __ΩHttpResultFormatterContext, 'handleBinary', () => __ΩHttpResultFormatterContext, 'handleResponse', () => __ΩSupportedHttpResult, () => __ΩHttpResultFormatterContext, 'handle', 'HttpResultFormatter', '&3!<>"&3#<>$PP7%2&<"0\'PP7(2)&2*$0+<Pn,2-n.2/$00PP-,J21n22/$03PP7421n52/$06P"21n72/$08PP7921n:2/$0;PP7<21n=2/$0>PP7?21n@2/$0AP"oB"2C"2DnE2/P7F2G8$0HP"2I"2DnJ2/P7K2G8$0LP!2MnN2/$0OPW21nP2/$0QPnR2/"0SPnT21nU2/$0V5wW'];
|
|
532
532
|
class HttpListener {
|
|
533
533
|
constructor(router, logger, resultFormatter, stopwatch) {
|
|
534
534
|
this.router = router;
|
|
@@ -577,7 +577,7 @@ class HttpListener {
|
|
|
577
577
|
const timeout = middlewares[i].timeout;
|
|
578
578
|
if (timeout !== undefined && timeout > 0) {
|
|
579
579
|
lastTimer = setTimeout(() => {
|
|
580
|
-
logger.
|
|
580
|
+
logger.warn(`Middleware timed out. Increase the timeout or fix the middleware. (${middlewares[i].fn})`);
|
|
581
581
|
next();
|
|
582
582
|
}, timeout);
|
|
583
583
|
}
|
|
@@ -801,7 +801,7 @@ class HttpListener {
|
|
|
801
801
|
this.resultFormatter.handle(event.result, event);
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
HttpListener.__type = [() => router_js_1.HttpRouter, 'router', () => __ΩLoggerInterface, 'logger', () => HttpResultFormatter, 'resultFormatter', () => stopwatch_1.Stopwatch, 'stopwatch', 'constructor', () => exports.httpWorkflow.onRequest.event, 'event', 'onRequest', () => exports.httpWorkflow.onRoute.event, 'onRoute', () => exports.httpWorkflow.onRoute.event, 'onRouteForward', () => exports.httpWorkflow.onRouteNotFound.event, 'routeNotFound', () => exports.httpWorkflow.onAuth.event, 'onAuth', () => exports.httpWorkflow.onResolveParameters.event, 'onResolveParameters', () => exports.httpWorkflow.onAccessDenied.event, 'onAccessDenied', () => exports.httpWorkflow.onController.event, 'onController', () => exports.httpWorkflow.onParametersFailed.event, 'onParametersFailed', () => exports.httpWorkflow.onControllerError.event, 'onControllerError', () => exports.httpWorkflow.onResponse.event, 'onResultSerialization', () => exports.httpWorkflow.onResponse.event, 'onResponse', 'PP7!2"<n#2$<P7%2&<P7\'2(8<"0)Pi*2+$0,Pi-2+"0.Pi/2+"00Pi12+$`02Pi32+$04Pi52+"06Pi72+$08Pi92+"0:Pi;2+$0<Pi=2+$0>Pi?2+"0@PiA2+"
|
|
804
|
+
HttpListener.__type = [() => router_js_1.HttpRouter, 'router', () => __ΩLoggerInterface, 'logger', () => HttpResultFormatter, 'resultFormatter', () => stopwatch_1.Stopwatch, 'stopwatch', 'constructor', () => exports.httpWorkflow.onRequest.event, 'event', 'onRequest', () => exports.httpWorkflow.onRoute.event, 'onRoute', () => exports.httpWorkflow.onRoute.event, 'onRouteForward', () => exports.httpWorkflow.onRouteNotFound.event, 'routeNotFound', () => exports.httpWorkflow.onAuth.event, 'onAuth', () => exports.httpWorkflow.onResolveParameters.event, 'onResolveParameters', () => exports.httpWorkflow.onAccessDenied.event, 'onAccessDenied', () => exports.httpWorkflow.onController.event, 'onController', () => exports.httpWorkflow.onParametersFailed.event, 'onParametersFailed', () => exports.httpWorkflow.onControllerError.event, 'onControllerError', () => exports.httpWorkflow.onResponse.event, 'onResultSerialization', () => exports.httpWorkflow.onResponse.event, 'onResponse', 'HttpListener', 'PP7!2"<n#2$<P7%2&<P7\'2(8<"0)Pi*2+$0,Pi-2+"0.Pi/2+"00Pi12+$`02Pi32+$04Pi52+"06Pi72+$08Pi92+"0:Pi;2+$0<Pi=2+$0>Pi?2+"0@PiA2+"0B5wC'];
|
|
805
805
|
__decorate([
|
|
806
806
|
event_1.eventDispatcher.listen(exports.httpWorkflow.onRequest, 100),
|
|
807
807
|
__metadata("design:type", Function),
|