@deepkit/http 1.0.18 → 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/CHANGELOG.md +45 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/decorator.js +11 -7
- package/dist/cjs/src/decorator.js.map +1 -1
- package/dist/cjs/src/filter.js +1 -1
- package/dist/cjs/src/filter.js.map +1 -1
- package/dist/cjs/src/http.d.ts +5 -2
- package/dist/cjs/src/http.js +93 -67
- package/dist/cjs/src/http.js.map +1 -1
- package/dist/cjs/src/kernel.d.ts +2 -2
- package/dist/cjs/src/kernel.js +7 -14
- package/dist/cjs/src/kernel.js.map +1 -1
- package/dist/cjs/src/logger.js +0 -7
- package/dist/cjs/src/logger.js.map +1 -1
- package/dist/cjs/src/middleware.d.ts +2 -2
- package/dist/cjs/src/middleware.js +2 -2
- package/dist/cjs/src/mime.d.ts +19 -0
- package/dist/cjs/src/mime.js +147 -0
- package/dist/cjs/src/mime.js.map +1 -0
- package/dist/cjs/src/model.d.ts +7 -0
- package/dist/cjs/src/model.js +16 -7
- package/dist/cjs/src/model.js.map +1 -1
- package/dist/cjs/src/module.js +9 -5
- package/dist/cjs/src/module.js.map +1 -1
- package/dist/cjs/src/query-string.d.ts +6 -0
- package/dist/cjs/src/query-string.js +229 -0
- package/dist/cjs/src/query-string.js.map +1 -0
- package/dist/cjs/src/request-parser.js +12 -10
- package/dist/cjs/src/request-parser.js.map +1 -1
- package/dist/cjs/src/router.js +14 -15
- package/dist/cjs/src/router.js.map +1 -1
- package/dist/cjs/src/static-serving.d.ts +6 -0
- package/dist/cjs/src/static-serving.js +232 -28
- package/dist/cjs/src/static-serving.js.map +1 -1
- package/dist/cjs/src/utils.js +1 -1
- package/dist/cjs/src/utils.js.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/decorator.js +11 -7
- package/dist/esm/src/decorator.js.map +1 -1
- package/dist/esm/src/filter.js +1 -1
- package/dist/esm/src/filter.js.map +1 -1
- package/dist/esm/src/http.d.ts +5 -2
- package/dist/esm/src/http.js +58 -66
- package/dist/esm/src/http.js.map +1 -1
- package/dist/esm/src/kernel.d.ts +2 -2
- package/dist/esm/src/kernel.js +8 -15
- package/dist/esm/src/kernel.js.map +1 -1
- package/dist/esm/src/logger.js +0 -7
- package/dist/esm/src/logger.js.map +1 -1
- package/dist/esm/src/middleware.d.ts +2 -2
- package/dist/esm/src/middleware.js +2 -2
- package/dist/esm/src/mime.d.ts +19 -0
- package/dist/esm/src/mime.js +142 -0
- package/dist/esm/src/mime.js.map +1 -0
- package/dist/esm/src/model.d.ts +7 -0
- package/dist/esm/src/model.js +16 -7
- package/dist/esm/src/model.js.map +1 -1
- package/dist/esm/src/module.js +9 -5
- package/dist/esm/src/module.js.map +1 -1
- package/dist/esm/src/query-string.d.ts +6 -0
- package/dist/esm/src/query-string.js +226 -0
- package/dist/esm/src/query-string.js.map +1 -0
- package/dist/esm/src/request-parser.js +12 -10
- package/dist/esm/src/request-parser.js.map +1 -1
- package/dist/esm/src/router.js +14 -12
- package/dist/esm/src/router.js.map +1 -1
- package/dist/esm/src/static-serving.d.ts +6 -0
- package/dist/esm/src/static-serving.js +234 -27
- package/dist/esm/src/static-serving.js.map +1 -1
- package/dist/esm/src/utils.js +1 -1
- package/dist/esm/src/utils.js.map +1 -1
- package/index.ts +2 -0
- package/package.json +22 -25
- package/src/http.ts +43 -10
- package/src/kernel.ts +8 -21
- package/src/middleware.ts +2 -2
- package/src/mime.ts +141 -0
- package/src/model.ts +10 -2
- package/src/module.ts +4 -2
- package/src/query-string.ts +228 -0
- package/src/request-parser.ts +6 -4
- package/src/router.ts +3 -3
- package/src/static-serving.ts +221 -8
- package/tsconfig.json +3 -17
- package/tsconfig.spec.json +4 -1
- package/LICENSE +0 -21
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,56 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.1.0](https://github.com/deepkit/deepkit-framework/compare/v1.0.19...v1.1.0) (2026-10-31)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **deps:** `@deepkit/*` peer dependencies require the current version ([#574](https://github.com/deepkit/deepkit-framework/issues/574)) ([ee7546f](https://github.com/deepkit/deepkit-framework/commit/ee7546f4416b66546e146591a45d39094f49c1c6))
|
|
11
|
+
- **http:** don't reveal whether files outside of the static root exist ([52141c6](https://github.com/deepkit/deepkit-framework/commit/52141c6e8620a549c59d8d7f4765ce53be5f9aef))
|
|
12
|
+
- **http:** errors and timeouts of middlewares fail the request ([#439](https://github.com/deepkit/deepkit-framework/issues/439)) ([a953246](https://github.com/deepkit/deepkit-framework/commit/a95324651e4c242c509334ebfb31058fe187bb53))
|
|
13
|
+
- **http:** match header parameters case-insensitively ([#653](https://github.com/deepkit/deepkit-framework/issues/653)) ([beebd60](https://github.com/deepkit/deepkit-framework/commit/beebd60f1b3976afe5e5d2db940aa7a6cc80df2a))
|
|
14
|
+
- **http:** respond with the status code of an HttpError thrown in a middleware ([#589](https://github.com/deepkit/deepkit-framework/issues/589)) ([253fb8f](https://github.com/deepkit/deepkit-framework/commit/253fb8fb55d1d8dc25fc94e0619abd431303a546))
|
|
15
|
+
- **http:** trigger onResponse when a middleware ends the response ([#590](https://github.com/deepkit/deepkit-framework/issues/590)) ([7aa3d08](https://github.com/deepkit/deepkit-framework/commit/7aa3d084f1a57d5e4367d690713393909619c51e))
|
|
16
|
+
- **template,mongo,http,framework:** make the ESM builds loadable ([814ca04](https://github.com/deepkit/deepkit-framework/commit/814ca04b36765b7c62b79c787e84b86582ebca63))
|
|
17
|
+
- **type,orm,mongo,http,framework:** overridden references, optional Embedded, Mongo dot paths ([#704](https://github.com/deepkit/deepkit-framework/issues/704), [#254](https://github.com/deepkit/deepkit-framework/issues/254), [#697](https://github.com/deepkit/deepkit-framework/issues/697)) ([4a8a7a4](https://github.com/deepkit/deepkit-framework/commit/4a8a7a4b859024047dc86e5c9c941c17ae992bc9)), closes [#439](https://github.com/deepkit/deepkit-framework/issues/439) [#591](https://github.com/deepkit/deepkit-framework/issues/591) [#346](https://github.com/deepkit/deepkit-framework/issues/346) [#430](https://github.com/deepkit/deepkit-framework/issues/430) [#444](https://github.com/deepkit/deepkit-framework/issues/444) [#375](https://github.com/deepkit/deepkit-framework/issues/375)
|
|
18
|
+
- wrong InjectorContext scope set in HTTP, and wrong received in RPC ([#673](https://github.com/deepkit/deepkit-framework/issues/673)) ([a56b7dd](https://github.com/deepkit/deepkit-framework/commit/a56b7ddbaa50cdb901bb453ae10f867d4b86f563))
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- **bench:** benchmarks for all core packages, comparisons and a runner that tracks results ([b5abf6f](https://github.com/deepkit/deepkit-framework/commit/b5abf6f7139b7c31dd4997b7a1d084a1348c8136))
|
|
23
|
+
- enable isolatedModules ([#683](https://github.com/deepkit/deepkit-framework/issues/683)) ([c730cfc](https://github.com/deepkit/deepkit-framework/commit/c730cfcfadc898f632b3c64b90ca57fa6764af32))
|
|
24
|
+
- **website,http:** benchmarks over time, complete HTTP requests as benchmark ([add08b7](https://github.com/deepkit/deepkit-framework/commit/add08b7538beb44f75fc3147edd21b591b857061))
|
|
25
|
+
|
|
26
|
+
### Performance Improvements
|
|
27
|
+
|
|
28
|
+
- **type,http:** fast discriminated unions, no scoring outside unions, flat query strings ([d5ce462](https://github.com/deepkit/deepkit-framework/commit/d5ce4629c290722b4af76a356c70f53d645fd302))
|
|
29
|
+
|
|
30
|
+
### BREAKING CHANGES
|
|
31
|
+
|
|
32
|
+
- const enums converted to regular enums in:
|
|
33
|
+
- MappedModifier (type-spec)
|
|
34
|
+
- BinaryBigIntType (type)
|
|
35
|
+
- BrokerType (broker)
|
|
36
|
+
- RpcMessageRouteType (rpc)
|
|
37
|
+
- AuthMechanism (mongo)
|
|
38
|
+
|
|
39
|
+
## [1.0.19](https://github.com/deepkit/deepkit-framework/compare/v1.0.17...v1.0.19) (2025-09-22)
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
- **website:** resolving paths in prod build ([877698f](https://github.com/deepkit/deepkit-framework/commit/877698f8a2bddc1e955c5d0ca53d8819d0bd56a9))
|
|
44
|
+
- **workflow:** make stopwatch required, normalize frame name ([0168db0](https://github.com/deepkit/deepkit-framework/commit/0168db0e3510227209854c48c29c28b2e51d0895))
|
|
45
|
+
|
|
46
|
+
### Features
|
|
47
|
+
|
|
48
|
+
- **website:** add translations (chinese, korean, japanese, german) ([4ab7058](https://github.com/deepkit/deepkit-framework/commit/4ab7058edd72a376f856c617a7f8ee243c82cd8b))
|
|
49
|
+
|
|
6
50
|
## [1.0.18](https://github.com/deepkit/deepkit-framework/compare/v1.0.17...v1.0.18) (2025-09-22)
|
|
7
51
|
|
|
8
52
|
### Bug Fixes
|
|
9
53
|
|
|
10
54
|
- **website:** resolving paths in prod build ([877698f](https://github.com/deepkit/deepkit-framework/commit/877698f8a2bddc1e955c5d0ca53d8819d0bd56a9))
|
|
55
|
+
- **workflow:** make stopwatch required, normalize frame name ([0168db0](https://github.com/deepkit/deepkit-framework/commit/0168db0e3510227209854c48c29c28b2e51d0895))
|
|
11
56
|
|
|
12
57
|
### Features
|
|
13
58
|
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -28,4 +28,6 @@ __exportStar(require("./src/controllers.js"), exports);
|
|
|
28
28
|
__exportStar(require("./src/middleware.js"), exports);
|
|
29
29
|
__exportStar(require("./src/filter.js"), exports);
|
|
30
30
|
__exportStar(require("./src/utils.js"), exports);
|
|
31
|
+
__exportStar(require("./src/query-string.js"), exports);
|
|
32
|
+
__exportStar(require("./src/mime.js"), exports);
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,gDAA8B;AAC9B,oDAAkC;AAClC,iDAA+B;AAC/B,kDAAgC;AAChC,kDAAgC;AAChC,0DAAwC;AACxC,kDAAgC;AAChC,kDAAgC;AAChC,yDAAuC;AACvC,uDAAqC;AACrC,sDAAoC;AACpC,kDAAgC;AAChC,iDAA+B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,gDAA8B;AAC9B,oDAAkC;AAClC,iDAA+B;AAC/B,kDAAgC;AAChC,kDAAgC;AAChC,0DAAwC;AACxC,kDAAgC;AAChC,kDAAgC;AAChC,yDAAuC;AACvC,uDAAqC;AACrC,sDAAoC;AACpC,kDAAgC;AAChC,iDAA+B;AAC/B,wDAAsC;AACtC,gDAA8B"}
|
|
@@ -9,6 +9,12 @@ function __assignType(fn, args) {
|
|
|
9
9
|
fn.__type = args;
|
|
10
10
|
return fn;
|
|
11
11
|
}
|
|
12
|
+
isMiddlewareClassTypeOrFn.__type = [() => __ΩHttpActionMiddleware, 'v', 'isMiddlewareClassTypeOrFn', 'Pn!2"!/#'];
|
|
13
|
+
getActions.__type = [() => __ΩClassType, 'target', () => HttpAction, 'getActions', 'Pn!2"P7#F/$'];
|
|
14
|
+
const Ωt0 = [() => HttpAction, 'P7!'];
|
|
15
|
+
const Ωt1 = [() => HttpAction, 'P7!'];
|
|
16
|
+
const Ωt2 = ['"'];
|
|
17
|
+
const Ωt3 = ['"'];
|
|
12
18
|
/*@ts-ignore*/
|
|
13
19
|
var { __ΩClassType } = require('@deepkit/core');
|
|
14
20
|
/*
|
|
@@ -33,16 +39,15 @@ const __ΩHttpActionMiddleware = [() => middleware_js_1.HttpMiddlewareConfig, ''
|
|
|
33
39
|
function isMiddlewareClassTypeOrFn(v) {
|
|
34
40
|
return (0, core_1.isClass)(v) || !(0, type_1.isDecoratorContext)(middleware_js_1.httpMiddleware, v);
|
|
35
41
|
}
|
|
36
|
-
isMiddlewareClassTypeOrFn.__type = [() => __ΩHttpActionMiddleware, 'v', 'isMiddlewareClassTypeOrFn', 'Pn!2"!/#'];
|
|
37
42
|
class HttpController {
|
|
38
43
|
constructor() {
|
|
39
44
|
this.baseUrl = '';
|
|
40
|
-
this.actions = (Set.Ω = [
|
|
45
|
+
this.actions = (Set.Ω = [Ωt0], new Set());
|
|
41
46
|
this.groups = [];
|
|
42
47
|
this.middlewares = [];
|
|
43
48
|
this.resolverForToken = new Map();
|
|
44
49
|
this.resolverForParameterName = new Map();
|
|
45
|
-
this.actionsProcessed = (Set.Ω = [
|
|
50
|
+
this.actionsProcessed = (Set.Ω = [Ωt1], new Set());
|
|
46
51
|
}
|
|
47
52
|
getUrl(action) {
|
|
48
53
|
return (0, core_1.urlJoin)('/', this.baseUrl, action.path);
|
|
@@ -76,7 +81,7 @@ class HttpController {
|
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
exports.HttpController = HttpController;
|
|
79
|
-
HttpController.__type = ['baseUrl', function () { return ''; }, 'actions', function () { return (Set.Ω = [
|
|
84
|
+
HttpController.__type = ['baseUrl', function () { return ''; }, 'actions', function () { return (Set.Ω = [Ωt0], new Set()); }, 'groups', function () { return []; }, () => middleware_js_1.HttpMiddlewareConfig, '', 'middlewares', function () { return []; }, () => __ΩClassType, 'resolverForToken', function () { return new Map(); }, () => __ΩClassType, 'resolverForParameterName', function () { return new Map(); }, 'actionsProcessed', function () { return (Set.Ω = [Ωt1], new Set()); }, () => HttpAction, 'action', 'getUrl', () => HttpAction, 'addAction', () => HttpAction, 'getActions', 'methodName', 'removeAction', () => HttpAction, 'getAction', 'HttpController', '&3!>"!3#>$&F3%>&PP7\'/(F3)>*"n+E3,>-&n.E3/>0!31;>2PP7324&05PP7624"07PP78D09P&2:$0;P&2:P7<0=5w>'];
|
|
80
85
|
class HttpActionParameter {
|
|
81
86
|
constructor() {
|
|
82
87
|
this.name = '';
|
|
@@ -100,12 +105,12 @@ class HttpAction {
|
|
|
100
105
|
/**
|
|
101
106
|
* An arbitrary data container the user can use to store app specific settings/values.
|
|
102
107
|
*/
|
|
103
|
-
this.data = (Map.Ω = [
|
|
108
|
+
this.data = (Map.Ω = [Ωt2, Ωt3], new Map());
|
|
104
109
|
this.responses = [];
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
112
|
exports.HttpAction = HttpAction;
|
|
108
|
-
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(); }, 'data', function () { return (Map.Ω = [
|
|
113
|
+
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(); }, 'data', function () { return (Map.Ω = [Ωt2, Ωt3], new Map()); }, 'statusCode', 'Type', 'type', 'responses', function () { return []; }, 'HttpAction', '&3!>"&3#>$&3%>&&3\'>(&F3)>*&3+>,&F3->.P7/308PP71/2F33>4n5368"n7E38>9&n:E3;><!3=>>P\'4?&4#"w@4A8MF3B>C5wD'];
|
|
109
114
|
class HttpControllerDecorator {
|
|
110
115
|
constructor() {
|
|
111
116
|
this.t = new HttpController;
|
|
@@ -190,7 +195,6 @@ function getActions(target) {
|
|
|
190
195
|
}
|
|
191
196
|
return results;
|
|
192
197
|
}
|
|
193
|
-
getActions.__type = [() => __ΩClassType, 'target', () => HttpAction, 'getActions', 'Pn!2"P7#F/$'];
|
|
194
198
|
class HttpActionDecorator {
|
|
195
199
|
constructor() {
|
|
196
200
|
this.t = new HttpAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/decorator.ts"],"names":[],"mappings":";;;AAkMA,gCAcC
|
|
1
|
+
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../src/decorator.ts"],"names":[],"mappings":";;;AAkMA,gCAcC;;;;;;;;;;;;;;;+BAtM2C,eAAe;AAV3D;;;;;;;;GAQG;AAEH,wCAA4D;;mMAkBrD,eAAe;AAjBtB,wCAiBuB;;4CACgB,aAAa;;yDACmC,iBAAiB;AAAxG,mDAAyG;;AAIzG,SAAS,yBAAyB,CAAC,CAAuB;IACtD,OAAO,IAAA,cAAO,EAAC,CAAC,CAAC,IAAI,CAAC,IAAA,yBAAkB,EAAC,8BAAc,EAAE,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,MAAa,cAAc;IAA3B;QACI,YAAO,GAAW,EAAE,CAAC;QACrB,YAAO,IAAO,GAAG,YAAP,IAAI,GAAG,EAAc,EAAC;QAChC,WAAM,GAAa,EAAE,CAAC;QAEtB,gBAAW,GAAmC,EAAE,CAAC;QAEjD,qBAAgB,GAAwB,IAAI,GAAG,EAAE,CAAC;QAClD,6BAAwB,GAA2B,IAAI,GAAG,EAAE,CAAC;QAErD,qBAAgB,IAAO,GAAG,YAAP,I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,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;wDArMO,IAAI,UAAU;;;AAiNT,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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HttpRouteFilter = exports.HttpRouterFilterResolver = exports.HttpRouteFilterModel = exports.__ΩHttpRouteFilterRoute = void 0;
|
|
4
|
+
match.__type = [() => router_js_1.RouteConfig, 'routeConfig', () => __ΩHttpRouteFilterRoute, 'route', 'match', 'PP7!2"n#2$)/%'];
|
|
4
5
|
/*@ts-ignore*/
|
|
5
6
|
var { __ΩClassType } = require('@deepkit/core');
|
|
6
7
|
const app_1 = require("@deepkit/app");
|
|
@@ -48,7 +49,6 @@ function match(routeConfig, route) {
|
|
|
48
49
|
}
|
|
49
50
|
return false;
|
|
50
51
|
}
|
|
51
|
-
match.__type = [() => router_js_1.RouteConfig, 'routeConfig', () => __ΩHttpRouteFilterRoute, 'route', 'match', 'PP7!2"n#2$)/%'];
|
|
52
52
|
class HttpRouterFilterResolver {
|
|
53
53
|
constructor(router) {
|
|
54
54
|
this.router = router;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../src/filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../src/filter.ts"],"names":[],"mappings":";;;;;+BAA0B,eAAe;AACzC,sCAAyC;AACzC,2CAAsD;;;AAUtD,MAAa,oBAAoB;IAAjC;QACI,gBAAW,GAAgB,EAAE,CAAC;QAC9B,uBAAkB,GAAgB,EAAE,CAAC;QAErC,WAAM,GAA2B,EAAE,CAAC;QACpC,kBAAa,GAA2B,EAAE,CAAC;QAE3C,eAAU,GAAa,EAAE,CAAC;QAC1B,sBAAiB,GAAa,EAAE,CAAC;QAEjC,YAAO,GAAqB,EAAE,CAAC;QAC/B,mBAAc,GAAqB,EAAE,CAAC;QAEtC,kBAAa,GAAgC,EAAE,CAAC;QAChD,yBAAoB,GAAgC,EAAE,CAAC;KAe1D;IAbG,KAAK;QACD,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAE7B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QAExB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAE5B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;IAC5B,CAAC;;AA5BL,oDA6BC;uFA5B8B,EAAE,oEACK,EAAE,mEAEH,EAAE,0EACK,EAAE,wCAEnB,EAAE,+CACK,EAAE,4DAEJ,EAAE,mEACK,EA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9D,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IAChB,CAAC;;AAxDL,0CAyDC;wDAxDkB,IAAI,oBAAoB,EAAE"}
|
package/dist/cjs/src/http.d.ts
CHANGED
|
@@ -66,6 +66,9 @@ export declare class HttpInternalServerError extends HttpInternalServerError_bas
|
|
|
66
66
|
declare const HttpNotImplementedError_base: ClassType<HttpError<501>>;
|
|
67
67
|
export declare class HttpNotImplementedError extends HttpNotImplementedError_base {
|
|
68
68
|
}
|
|
69
|
+
declare const HttpGatewayTimeoutError_base: ClassType<HttpError<504>>;
|
|
70
|
+
export declare class HttpGatewayTimeoutError extends HttpGatewayTimeoutError_base {
|
|
71
|
+
}
|
|
69
72
|
export declare class HttpWorkflowEvent extends BaseEvent {
|
|
70
73
|
injectorContext: InjectorContext;
|
|
71
74
|
request: HttpRequest;
|
|
@@ -253,9 +256,9 @@ export declare class HttpListener {
|
|
|
253
256
|
protected logger: LoggerInterface;
|
|
254
257
|
protected resultFormatter: HttpResultFormatter;
|
|
255
258
|
protected injector: Injector;
|
|
256
|
-
protected stopwatch
|
|
259
|
+
protected stopwatch: Stopwatch;
|
|
257
260
|
protected setRouteConfig: Setter<RouteConfig>;
|
|
258
|
-
constructor(router: HttpRouter, logger: LoggerInterface, resultFormatter: HttpResultFormatter, injector: Injector, stopwatch
|
|
261
|
+
constructor(router: HttpRouter, logger: LoggerInterface, resultFormatter: HttpResultFormatter, injector: Injector, stopwatch: Stopwatch);
|
|
259
262
|
onRequest(event: typeof httpWorkflow.onRequest.event): void;
|
|
260
263
|
onRoute(event: typeof httpWorkflow.onRoute.event): Promise<void>;
|
|
261
264
|
onRouteForward(event: typeof httpWorkflow.onRoute.event): void;
|
package/dist/cjs/src/http.js
CHANGED
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
19
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
20
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
21
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
23
|
};
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
11
41
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
42
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
43
|
};
|
|
14
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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.HttpError = exports.Redirect = void 0;
|
|
45
|
+
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.HttpGatewayTimeoutError = 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.HttpError = exports.Redirect = void 0;
|
|
16
46
|
exports.isElementStruct = isElementStruct;
|
|
17
47
|
exports.createHttpError = createHttpError;
|
|
18
48
|
const __ΩError = ['name', 'message', 'stack', 'Error', 'P&4!&4"&4#8Mw$y'];
|
|
@@ -20,6 +50,9 @@ function __assignType(fn, args) {
|
|
|
20
50
|
fn.__type = args;
|
|
21
51
|
return fn;
|
|
22
52
|
}
|
|
53
|
+
isElementStruct.__type = ['v', 'isElementStruct', 'P"2!!/"'];
|
|
54
|
+
getTemplateRender.__type = [() => render, 'getTemplateRender', 'Pi!`/"'];
|
|
55
|
+
createHttpError.__type = ['code', 'defaultMessage', () => "", () => __ΩClassType, () => HttpError, 'createHttpError', 'P"2!&2">#P"7%o$"/&'];
|
|
23
56
|
/*@ts-ignore*/
|
|
24
57
|
var { __ΩClassType } = require('@deepkit/core');
|
|
25
58
|
/*
|
|
@@ -52,16 +85,15 @@ const stream_1 = __importDefault(require("stream"));
|
|
|
52
85
|
function isElementStruct(v) {
|
|
53
86
|
return (0, core_1.isObject)(v) && 'hasOwnProperty' in v && v.hasOwnProperty('render') && v.hasOwnProperty('attributes');
|
|
54
87
|
}
|
|
55
|
-
isElementStruct.__type = ['v', 'isElementStruct', 'P"2!!/"'];
|
|
56
88
|
let templateRender;
|
|
57
|
-
|
|
89
|
+
// @deepkit/template is optional, so it's only loaded when a controller returns a JSX element.
|
|
90
|
+
async function getTemplateRender() {
|
|
58
91
|
if (!templateRender) {
|
|
59
|
-
const template = require('@deepkit/template');
|
|
92
|
+
const template = await Promise.resolve().then(() => __importStar(require('@deepkit/template')));
|
|
60
93
|
templateRender = template.render;
|
|
61
94
|
}
|
|
62
95
|
return templateRender;
|
|
63
96
|
}
|
|
64
|
-
getTemplateRender.__type = [() => render, 'getTemplateRender', 'Pi!/"'];
|
|
65
97
|
class Redirect {
|
|
66
98
|
constructor(statusCode = 302) {
|
|
67
99
|
this.statusCode = statusCode;
|
|
@@ -100,7 +132,6 @@ function createHttpError(code, defaultMessage = '') {
|
|
|
100
132
|
_a.__type = [() => code, () => HttpError, 'message', () => defaultMessage, 'constructor', () => code, 'PPdi!h!!qe!!!j7"P&2#:>$"0%5Pdi&h!!qe!!!j6"'],
|
|
101
133
|
_a;
|
|
102
134
|
}
|
|
103
|
-
createHttpError.__type = ['code', 'defaultMessage', () => "", () => __ΩClassType, () => HttpError, 'createHttpError', 'P"2!&2">#P"7%o$"/&'];
|
|
104
135
|
class HttpBadRequestError extends createHttpError(400, 'Bad request') {
|
|
105
136
|
}
|
|
106
137
|
exports.HttpBadRequestError = HttpBadRequestError;
|
|
@@ -149,6 +180,10 @@ class HttpNotImplementedError extends createHttpError(501, 'Not implemented') {
|
|
|
149
180
|
}
|
|
150
181
|
exports.HttpNotImplementedError = HttpNotImplementedError;
|
|
151
182
|
HttpNotImplementedError.__type = [() => createHttpError(501, "Not implemented"), 'HttpNotImplementedError', 'P7!5w"'];
|
|
183
|
+
class HttpGatewayTimeoutError extends createHttpError(504, 'Gateway timeout') {
|
|
184
|
+
}
|
|
185
|
+
exports.HttpGatewayTimeoutError = HttpGatewayTimeoutError;
|
|
186
|
+
HttpGatewayTimeoutError.__type = [() => createHttpError(504, "Gateway timeout"), 'HttpGatewayTimeoutError', 'P7!5w"'];
|
|
152
187
|
class HttpWorkflowEvent extends event_1.BaseEvent {
|
|
153
188
|
clearNext() {
|
|
154
189
|
this.nextState = undefined;
|
|
@@ -334,7 +369,7 @@ exports.httpWorkflow = (0, workflow_1.createWorkflow)('http', {
|
|
|
334
369
|
}, {
|
|
335
370
|
start: 'request',
|
|
336
371
|
request: 'route',
|
|
337
|
-
route: ['auth', 'routeNotFound'],
|
|
372
|
+
route: ['auth', 'routeNotFound', 'response'],
|
|
338
373
|
auth: ['resolveParameters', 'accessDenied'],
|
|
339
374
|
resolveParameters: ['controller', 'parametersFailed'],
|
|
340
375
|
accessDenied: 'response',
|
|
@@ -538,7 +573,7 @@ class HttpListener {
|
|
|
538
573
|
this.resultFormatter = resultFormatter;
|
|
539
574
|
this.injector = injector;
|
|
540
575
|
this.stopwatch = stopwatch;
|
|
541
|
-
this.setRouteConfig = injector.createSetter(router_js_1.RouteConfig,
|
|
576
|
+
this.setRouteConfig = injector.createSetter(router_js_1.RouteConfig, 'http');
|
|
542
577
|
}
|
|
543
578
|
onRequest(event) {
|
|
544
579
|
if (event.sent)
|
|
@@ -553,6 +588,7 @@ class HttpListener {
|
|
|
553
588
|
if (event.hasNext())
|
|
554
589
|
return;
|
|
555
590
|
const logger = this.logger;
|
|
591
|
+
let inMiddleware = false;
|
|
556
592
|
try {
|
|
557
593
|
const resolved = this.router.resolveRequest(event.request);
|
|
558
594
|
if (resolved) {
|
|
@@ -561,6 +597,7 @@ class HttpListener {
|
|
|
561
597
|
if (resolved.middlewares) {
|
|
562
598
|
const middlewares = resolved.middlewares(event.injectorContext);
|
|
563
599
|
if (middlewares.length) {
|
|
600
|
+
inMiddleware = true;
|
|
564
601
|
await (0, core_1.asyncOperation)(__assignType(async (resolve, reject) => {
|
|
565
602
|
let lastTimer = undefined;
|
|
566
603
|
function finish() {
|
|
@@ -571,6 +608,7 @@ class HttpListener {
|
|
|
571
608
|
finish.__type = ['finish', 'P"/!'];
|
|
572
609
|
event.response.once('finish', finish);
|
|
573
610
|
let i = -1;
|
|
611
|
+
let timedOut = false;
|
|
574
612
|
async function next() {
|
|
575
613
|
i++;
|
|
576
614
|
if (i >= middlewares.length) {
|
|
@@ -581,14 +619,19 @@ class HttpListener {
|
|
|
581
619
|
const timeout = middlewares[i].timeout;
|
|
582
620
|
if (timeout !== undefined && timeout > 0) {
|
|
583
621
|
lastTimer = setTimeout(() => {
|
|
622
|
+
//a middleware that neither calls next() nor ends the response in time fails the request
|
|
623
|
+
timedOut = true;
|
|
584
624
|
logger.warn(`Middleware timed out. Increase the timeout or fix the middleware. (${middlewares[i].fn})`);
|
|
585
|
-
|
|
625
|
+
event.response.off('finish', finish);
|
|
626
|
+
reject(new HttpGatewayTimeoutError('Middleware timed out'));
|
|
586
627
|
}, timeout);
|
|
587
628
|
}
|
|
588
629
|
try {
|
|
589
630
|
await middlewares[i].fn(event.request, event.response, __assignType((error) => {
|
|
590
631
|
if (lastTimer)
|
|
591
632
|
clearTimeout(lastTimer);
|
|
633
|
+
if (timedOut)
|
|
634
|
+
return;
|
|
592
635
|
if (error) {
|
|
593
636
|
event.response.off('finish', finish);
|
|
594
637
|
reject(error);
|
|
@@ -599,19 +642,41 @@ class HttpListener {
|
|
|
599
642
|
}, ['error', '', 'P"2!8"/"']));
|
|
600
643
|
}
|
|
601
644
|
catch (error) {
|
|
645
|
+
event.response.off('finish', finish);
|
|
602
646
|
reject(error);
|
|
603
647
|
}
|
|
604
648
|
}
|
|
605
649
|
next.__type = ['next', 'P"/!'];
|
|
606
650
|
await next();
|
|
607
651
|
}, ['resolve', 'reject', '', 'P"2!"2""/#']));
|
|
652
|
+
inMiddleware = false;
|
|
608
653
|
}
|
|
609
654
|
}
|
|
655
|
+
if (event.sent) {
|
|
656
|
+
//a middleware ended the request, so we skip the controller but still trigger onResponse (e.g. for logging)
|
|
657
|
+
event.next('response', new HttpResponseEvent(event.injectorContext, event.request, event.response, undefined, resolved.routeConfig));
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
610
660
|
this.setRouteConfig(resolved.routeConfig, event.injectorContext.scope);
|
|
611
661
|
event.routeFound(resolved.routeConfig, resolved.parameters);
|
|
612
662
|
}
|
|
613
663
|
}
|
|
614
664
|
catch (error) {
|
|
665
|
+
if (error instanceof HttpError) {
|
|
666
|
+
if (event.request.throwErrorOnNotFound && error.httpCode === 404) {
|
|
667
|
+
throw error;
|
|
668
|
+
}
|
|
669
|
+
event.send(new JSONResponse({
|
|
670
|
+
message: error.message
|
|
671
|
+
}, error.httpCode).disableAutoSerializing());
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
if (inMiddleware) {
|
|
675
|
+
//like a failing controller, an error of a middleware is a server error (#439)
|
|
676
|
+
this.logger.error('Middleware error', error);
|
|
677
|
+
event.send(new HtmlResponse('Internal error', 500));
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
615
680
|
this.logger.error('Could not resolve request', error);
|
|
616
681
|
event.notFound();
|
|
617
682
|
}
|
|
@@ -673,7 +738,7 @@ class HttpListener {
|
|
|
673
738
|
const stopWatchLabel = event.route.action.type === 'controller'
|
|
674
739
|
? (0, core_1.getClassName)(event.route.action.controller) + '.' + event.route.action.methodName
|
|
675
740
|
: event.route.action.fn.name;
|
|
676
|
-
const frame = this.stopwatch
|
|
741
|
+
const frame = this.stopwatch.start(stopWatchLabel, stopwatch_1.FrameCategory.httpController);
|
|
677
742
|
try {
|
|
678
743
|
let result;
|
|
679
744
|
if (event.route.action.type === 'controller') {
|
|
@@ -685,7 +750,7 @@ class HttpListener {
|
|
|
685
750
|
result = await event.route.action.fn(...event.parameters.arguments);
|
|
686
751
|
}
|
|
687
752
|
if (isElementStruct(result)) {
|
|
688
|
-
const html = await getTemplateRender()(event.injectorContext.getRootInjector(), result, this.stopwatch ? this.stopwatch : undefined);
|
|
753
|
+
const html = await (await getTemplateRender())(event.injectorContext.getRootInjector(), result, this.stopwatch ? this.stopwatch : undefined);
|
|
689
754
|
result = new HtmlResponse(html, 200).header('Content-Type', 'text/html; charset=utf-8');
|
|
690
755
|
}
|
|
691
756
|
if (result instanceof stream_1.default.Readable) {
|
|
@@ -700,8 +765,6 @@ class HttpListener {
|
|
|
700
765
|
event.next('response', responseEvent);
|
|
701
766
|
}
|
|
702
767
|
catch (error) {
|
|
703
|
-
if (frame)
|
|
704
|
-
frame.end();
|
|
705
768
|
if (error instanceof HttpAccessDeniedError) {
|
|
706
769
|
event.next('accessDenied', new HttpAccessDeniedEvent(event.injectorContext, event.request, event.response, event.route, error));
|
|
707
770
|
}
|
|
@@ -712,8 +775,7 @@ class HttpListener {
|
|
|
712
775
|
}
|
|
713
776
|
}
|
|
714
777
|
finally {
|
|
715
|
-
|
|
716
|
-
frame.end();
|
|
778
|
+
frame.end();
|
|
717
779
|
}
|
|
718
780
|
}
|
|
719
781
|
onParametersFailed(event) {
|
|
@@ -814,77 +876,41 @@ class HttpListener {
|
|
|
814
876
|
}
|
|
815
877
|
}
|
|
816
878
|
exports.HttpListener = HttpListener;
|
|
817
|
-
HttpListener.__type = [() => __ΩSetter, () => router_js_1.RouteConfig, 'setRouteConfig', () => router_js_1.HttpRouter, 'router', () => __ΩLoggerInterface, 'logger', () => HttpResultFormatter, 'resultFormatter', () => injector_1.Injector, 'injector', () => 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', 'P7"o!"3#<PP7$2%<n&2\'<P7(2)<P7*2+<P7,2
|
|
879
|
+
HttpListener.__type = [() => __ΩSetter, () => router_js_1.RouteConfig, 'setRouteConfig', () => router_js_1.HttpRouter, 'router', () => __ΩLoggerInterface, 'logger', () => HttpResultFormatter, 'resultFormatter', () => injector_1.Injector, 'injector', () => 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', 'P7"o!"3#<PP7$2%<n&2\'<P7(2)<P7*2+<P7,2-<"0.Pi/20$01Pi220"03Pi420"05Pi620$`07Pi820$09Pi:20"0;Pi<20$0=Pi>20"0?Pi@20$0APiB20$0CPiD20"0EPiF20"0G5wH'];
|
|
818
880
|
__decorate([
|
|
819
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onRequest, 100)
|
|
820
|
-
__metadata("design:type", Function),
|
|
821
|
-
__metadata("design:paramtypes", [Object]),
|
|
822
|
-
__metadata("design:returntype", void 0)
|
|
881
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onRequest, 100)
|
|
823
882
|
], HttpListener.prototype, "onRequest", null);
|
|
824
883
|
__decorate([
|
|
825
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onRoute, 100)
|
|
826
|
-
__metadata("design:type", Function),
|
|
827
|
-
__metadata("design:paramtypes", [Object]),
|
|
828
|
-
__metadata("design:returntype", Promise)
|
|
884
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onRoute, 100)
|
|
829
885
|
], HttpListener.prototype, "onRoute", null);
|
|
830
886
|
__decorate([
|
|
831
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onRoute, 1000)
|
|
832
|
-
__metadata("design:type", Function),
|
|
833
|
-
__metadata("design:paramtypes", [Object]),
|
|
834
|
-
__metadata("design:returntype", void 0)
|
|
887
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onRoute, 1000)
|
|
835
888
|
], HttpListener.prototype, "onRouteForward", null);
|
|
836
889
|
__decorate([
|
|
837
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onRouteNotFound, 100)
|
|
838
|
-
__metadata("design:type", Function),
|
|
839
|
-
__metadata("design:paramtypes", [Object]),
|
|
840
|
-
__metadata("design:returntype", Promise)
|
|
890
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onRouteNotFound, 100)
|
|
841
891
|
], HttpListener.prototype, "routeNotFound", null);
|
|
842
892
|
__decorate([
|
|
843
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onAuth, 100)
|
|
844
|
-
__metadata("design:type", Function),
|
|
845
|
-
__metadata("design:paramtypes", [Object]),
|
|
846
|
-
__metadata("design:returntype", void 0)
|
|
893
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onAuth, 100)
|
|
847
894
|
], HttpListener.prototype, "onAuth", null);
|
|
848
895
|
__decorate([
|
|
849
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onResolveParameters, 100)
|
|
850
|
-
__metadata("design:type", Function),
|
|
851
|
-
__metadata("design:paramtypes", [Object]),
|
|
852
|
-
__metadata("design:returntype", Promise)
|
|
896
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onResolveParameters, 100)
|
|
853
897
|
], HttpListener.prototype, "onResolveParameters", null);
|
|
854
898
|
__decorate([
|
|
855
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onAccessDenied, 100)
|
|
856
|
-
__metadata("design:type", Function),
|
|
857
|
-
__metadata("design:paramtypes", [Object]),
|
|
858
|
-
__metadata("design:returntype", void 0)
|
|
899
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onAccessDenied, 100)
|
|
859
900
|
], HttpListener.prototype, "onAccessDenied", null);
|
|
860
901
|
__decorate([
|
|
861
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onController, 100)
|
|
862
|
-
__metadata("design:type", Function),
|
|
863
|
-
__metadata("design:paramtypes", [Object]),
|
|
864
|
-
__metadata("design:returntype", Promise)
|
|
902
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onController, 100)
|
|
865
903
|
], HttpListener.prototype, "onController", null);
|
|
866
904
|
__decorate([
|
|
867
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onParametersFailed, 100)
|
|
868
|
-
__metadata("design:type", Function),
|
|
869
|
-
__metadata("design:paramtypes", [Object]),
|
|
870
|
-
__metadata("design:returntype", void 0)
|
|
905
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onParametersFailed, 100)
|
|
871
906
|
], HttpListener.prototype, "onParametersFailed", null);
|
|
872
907
|
__decorate([
|
|
873
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onControllerError, 100)
|
|
874
|
-
__metadata("design:type", Function),
|
|
875
|
-
__metadata("design:paramtypes", [Object]),
|
|
876
|
-
__metadata("design:returntype", void 0)
|
|
908
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onControllerError, 100)
|
|
877
909
|
], HttpListener.prototype, "onControllerError", null);
|
|
878
910
|
__decorate([
|
|
879
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onResponse, -100)
|
|
880
|
-
__metadata("design:type", Function),
|
|
881
|
-
__metadata("design:paramtypes", [Object]),
|
|
882
|
-
__metadata("design:returntype", Promise)
|
|
911
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onResponse, -100)
|
|
883
912
|
], HttpListener.prototype, "onResultSerialization", null);
|
|
884
913
|
__decorate([
|
|
885
|
-
event_1.eventDispatcher.listen(exports.httpWorkflow.onResponse, 100)
|
|
886
|
-
__metadata("design:type", Function),
|
|
887
|
-
__metadata("design:paramtypes", [Object]),
|
|
888
|
-
__metadata("design:returntype", Promise)
|
|
914
|
+
event_1.eventDispatcher.listen(exports.httpWorkflow.onResponse, 100)
|
|
889
915
|
], HttpListener.prototype, "onResponse", null);
|
|
890
916
|
//# sourceMappingURL=http.js.map
|