@tsed/platform-express 7.0.0-beta.13 → 7.0.0-beta.14

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.
Files changed (46) hide show
  1. package/lib/cjs/components/PlatformExpress.js +57 -54
  2. package/lib/cjs/components/PlatformExpress.js.map +1 -1
  3. package/lib/cjs/index.js +0 -7
  4. package/lib/cjs/index.js.map +1 -1
  5. package/lib/esm/components/PlatformExpress.js +58 -55
  6. package/lib/esm/components/PlatformExpress.js.map +1 -1
  7. package/lib/esm/index.js +0 -7
  8. package/lib/esm/index.js.map +1 -1
  9. package/lib/types/components/PlatformExpress.d.ts +11 -26
  10. package/lib/types/index.d.ts +0 -7
  11. package/package.json +13 -13
  12. package/lib/cjs/decorators/caseSensitive.js +0 -31
  13. package/lib/cjs/decorators/caseSensitive.js.map +0 -1
  14. package/lib/cjs/decorators/mergeParams.js +0 -31
  15. package/lib/cjs/decorators/mergeParams.js.map +0 -1
  16. package/lib/cjs/decorators/routerSettings.js +0 -32
  17. package/lib/cjs/decorators/routerSettings.js.map +0 -1
  18. package/lib/cjs/decorators/strict.js +0 -31
  19. package/lib/cjs/decorators/strict.js.map +0 -1
  20. package/lib/cjs/services/PlatformExpressHandler.js +0 -31
  21. package/lib/cjs/services/PlatformExpressHandler.js.map +0 -1
  22. package/lib/cjs/services/PlatformExpressRequest.js +0 -12
  23. package/lib/cjs/services/PlatformExpressRequest.js.map +0 -1
  24. package/lib/cjs/services/PlatformExpressResponse.js +0 -12
  25. package/lib/cjs/services/PlatformExpressResponse.js.map +0 -1
  26. package/lib/esm/decorators/caseSensitive.js +0 -27
  27. package/lib/esm/decorators/caseSensitive.js.map +0 -1
  28. package/lib/esm/decorators/mergeParams.js +0 -27
  29. package/lib/esm/decorators/mergeParams.js.map +0 -1
  30. package/lib/esm/decorators/routerSettings.js +0 -28
  31. package/lib/esm/decorators/routerSettings.js.map +0 -1
  32. package/lib/esm/decorators/strict.js +0 -27
  33. package/lib/esm/decorators/strict.js.map +0 -1
  34. package/lib/esm/services/PlatformExpressHandler.js +0 -27
  35. package/lib/esm/services/PlatformExpressHandler.js.map +0 -1
  36. package/lib/esm/services/PlatformExpressRequest.js +0 -8
  37. package/lib/esm/services/PlatformExpressRequest.js.map +0 -1
  38. package/lib/esm/services/PlatformExpressResponse.js +0 -8
  39. package/lib/esm/services/PlatformExpressResponse.js.map +0 -1
  40. package/lib/types/decorators/caseSensitive.d.ts +0 -23
  41. package/lib/types/decorators/mergeParams.d.ts +0 -23
  42. package/lib/types/decorators/routerSettings.d.ts +0 -24
  43. package/lib/types/decorators/strict.d.ts +0 -23
  44. package/lib/types/services/PlatformExpressHandler.d.ts +0 -9
  45. package/lib/types/services/PlatformExpressRequest.d.ts +0 -8
  46. package/lib/types/services/PlatformExpressResponse.d.ts +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/platform-express",
3
- "version": "7.0.0-beta.13",
3
+ "version": "7.0.0-beta.14",
4
4
  "description": "A TypeScript Framework on top of Express",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -57,11 +57,11 @@
57
57
  "tslib": "2.4.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@tsed/common": "7.0.0-beta.13",
61
- "@tsed/core": "7.0.0-beta.13",
62
- "@tsed/di": "7.0.0-beta.13",
63
- "@tsed/platform-test-utils": "7.0.0-beta.13",
64
- "@tsed/platform-views": "7.0.0-beta.13",
60
+ "@tsed/common": "7.0.0-beta.14",
61
+ "@tsed/core": "7.0.0-beta.14",
62
+ "@tsed/di": "7.0.0-beta.14",
63
+ "@tsed/platform-test-utils": "7.0.0-beta.14",
64
+ "@tsed/platform-views": "7.0.0-beta.14",
65
65
  "@types/body-parser": "1.19.2",
66
66
  "@types/compression": "1.7.2",
67
67
  "@types/cookie-parser": "1.4.2",
@@ -77,14 +77,14 @@
77
77
  "method-override": "3.0.0"
78
78
  },
79
79
  "peerDependencies": {
80
- "@tsed/common": "^7.0.0-beta.13",
81
- "@tsed/core": "^7.0.0-beta.13",
82
- "@tsed/di": "^7.0.0-beta.13",
83
- "@tsed/json-mapper": "^7.0.0-beta.13",
80
+ "@tsed/common": "^7.0.0-beta.14",
81
+ "@tsed/core": "^7.0.0-beta.14",
82
+ "@tsed/di": "^7.0.0-beta.14",
83
+ "@tsed/json-mapper": "^7.0.0-beta.14",
84
84
  "@tsed/logger": ">=6.2.0",
85
- "@tsed/openspec": "^7.0.0-beta.13",
86
- "@tsed/platform-views": "^7.0.0-beta.13",
87
- "@tsed/schema": "^7.0.0-beta.13",
85
+ "@tsed/openspec": "^7.0.0-beta.14",
86
+ "@tsed/platform-views": "^7.0.0-beta.14",
87
+ "@tsed/schema": "^7.0.0-beta.14",
88
88
  "@types/multer": "^1.4.5",
89
89
  "body-parser": "^1.19.0",
90
90
  "multer": "^1.4.5-lts.1"
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CaseSensitive = void 0;
4
- const routerSettings_1 = require("./routerSettings");
5
- /**
6
- * Specify the behavior of the router controller.
7
- *
8
- * ```typescript
9
- * @Controller("/")
10
- * @CaseSensitive(true)
11
- * class MyCtrl {
12
- *
13
- * }
14
- * ```
15
- *
16
- * Property | Description | Default
17
- * ---|---|---
18
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
19
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
20
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
21
- *
22
- * @param caseSensitive
23
- * @returns {Function}
24
- * @decorator
25
- * @express
26
- */
27
- function CaseSensitive(caseSensitive) {
28
- return (0, routerSettings_1.RouterSettings)({ caseSensitive });
29
- }
30
- exports.CaseSensitive = CaseSensitive;
31
- //# sourceMappingURL=caseSensitive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"caseSensitive.js","sourceRoot":"","sources":["../../../src/decorators/caseSensitive.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,aAAa,CAAC,aAAsB;IAClD,OAAO,IAAA,+BAAc,EAAC,EAAC,aAAa,EAAC,CAAC,CAAC;AACzC,CAAC;AAFD,sCAEC","sourcesContent":["import {RouterSettings} from \"./routerSettings\";\n\n/**\n * Specify the behavior of the router controller.\n *\n * ```typescript\n * @Controller(\"/\")\n * @CaseSensitive(true)\n * class MyCtrl {\n *\n * }\n * ```\n *\n * Property | Description | Default\n * ---|---|---\n * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.\n * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false\n * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.\n *\n * @param caseSensitive\n * @returns {Function}\n * @decorator\n * @express\n */\nexport function CaseSensitive(caseSensitive: boolean) {\n return RouterSettings({caseSensitive});\n}\n"]}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MergeParams = void 0;
4
- const routerSettings_1 = require("./routerSettings");
5
- /**
6
- * Specify the behavior of the router controller.
7
- *
8
- * ```typescript
9
- * @Controller("/")
10
- * @MergeParams(true)
11
- * class MyCtrl {
12
- *
13
- * }
14
- * ```
15
- *
16
- * Property | Description | Default
17
- * ---|---|---
18
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
19
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
20
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
21
- *
22
- * @param mergeParams
23
- * @returns {Function}
24
- * @decorator
25
- * @express
26
- */
27
- function MergeParams(mergeParams = true) {
28
- return (0, routerSettings_1.RouterSettings)({ mergeParams });
29
- }
30
- exports.MergeParams = MergeParams;
31
- //# sourceMappingURL=mergeParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergeParams.js","sourceRoot":"","sources":["../../../src/decorators/mergeParams.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,WAAW,CAAC,cAAuB,IAAI;IACrD,OAAO,IAAA,+BAAc,EAAC,EAAC,WAAW,EAAC,CAAC,CAAC;AACvC,CAAC;AAFD,kCAEC","sourcesContent":["import {RouterSettings} from \"./routerSettings\";\n\n/**\n * Specify the behavior of the router controller.\n *\n * ```typescript\n * @Controller(\"/\")\n * @MergeParams(true)\n * class MyCtrl {\n *\n * }\n * ```\n *\n * Property | Description | Default\n * ---|---|---\n * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.\n * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false\n * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.\n *\n * @param mergeParams\n * @returns {Function}\n * @decorator\n * @express\n */\nexport function MergeParams(mergeParams: boolean = true) {\n return RouterSettings({mergeParams});\n}\n"]}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RouterSettings = void 0;
4
- const common_1 = require("@tsed/common");
5
- const core_1 = require("@tsed/core");
6
- /**
7
- * Specify the behavior of the router controller.
8
- *
9
- * ```typescript
10
- * @Controller("/")
11
- * @RouterSettings({mergeParams: true})
12
- * class MyCtrl {
13
- *
14
- * }
15
- * ```
16
- *
17
- * Property | Description | Default
18
- * ---|---|---
19
- * caseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
20
- * mergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
21
- * strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
22
- *
23
- * @returns {(target:any)=>void}
24
- * @decorator
25
- * @param routerOptions
26
- * @express
27
- */
28
- function RouterSettings(routerOptions) {
29
- return (0, core_1.StoreMerge)(common_1.ROUTER_OPTIONS, routerOptions);
30
- }
31
- exports.RouterSettings = RouterSettings;
32
- //# sourceMappingURL=routerSettings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routerSettings.js","sourceRoot":"","sources":["../../../src/decorators/routerSettings.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAC5C,qCAAsC;AAGtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,cAAc,CAAC,aAA4B;IACzD,OAAO,IAAA,iBAAU,EAAC,uBAAc,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC;AAFD,wCAEC","sourcesContent":["import {ROUTER_OPTIONS} from \"@tsed/common\";\nimport {StoreMerge} from \"@tsed/core\";\nimport {RouterOptions} from \"express\";\n\n/**\n * Specify the behavior of the router controller.\n *\n * ```typescript\n * @Controller(\"/\")\n * @RouterSettings({mergeParams: true})\n * class MyCtrl {\n *\n * }\n * ```\n *\n * Property | Description | Default\n * ---|---|---\n * caseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.\n * mergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false\n * strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.\n *\n * @returns {(target:any)=>void}\n * @decorator\n * @param routerOptions\n * @express\n */\nexport function RouterSettings(routerOptions: RouterOptions): Function {\n return StoreMerge(ROUTER_OPTIONS, routerOptions);\n}\n"]}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Strict = void 0;
4
- const routerSettings_1 = require("./routerSettings");
5
- /**
6
- * Specify the behavior of the router controller.
7
- *
8
- * ```typescript
9
- * @Controller("/")
10
- * @Strict(true)
11
- * class MyCtrl {
12
- *
13
- * }
14
- * ```
15
- *
16
- * Property | Description | Default
17
- * ---|---|---
18
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
19
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
20
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
21
- *
22
- * @param strict
23
- * @returns {Function}
24
- * @decorator
25
- * @express
26
- */
27
- function Strict(strict) {
28
- return (0, routerSettings_1.RouterSettings)({ strict });
29
- }
30
- exports.Strict = Strict;
31
- //# sourceMappingURL=strict.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strict.js","sourceRoot":"","sources":["../../../src/decorators/strict.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,MAAM,CAAC,MAAe;IACpC,OAAO,IAAA,+BAAc,EAAC,EAAC,MAAM,EAAC,CAAC,CAAC;AAClC,CAAC;AAFD,wBAEC","sourcesContent":["import {RouterSettings} from \"./routerSettings\";\n\n/**\n * Specify the behavior of the router controller.\n *\n * ```typescript\n * @Controller(\"/\")\n * @Strict(true)\n * class MyCtrl {\n *\n * }\n * ```\n *\n * Property | Description | Default\n * ---|---|---\n * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.\n * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false\n * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.\n *\n * @param strict\n * @returns {Function}\n * @decorator\n * @express\n */\nexport function Strict(strict: boolean) {\n return RouterSettings({strict});\n}\n"]}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformExpressHandler = void 0;
4
- const common_1 = require("@tsed/common");
5
- /**
6
- * @platform
7
- * @express
8
- */
9
- class PlatformExpressHandler extends common_1.PlatformHandler {
10
- createRawHandler(metadata) {
11
- if (metadata.type === common_1.HandlerType.ERR_MIDDLEWARE) {
12
- const handler = this.compileHandler(metadata);
13
- return async (err, req, res, next) => handler({
14
- err,
15
- next,
16
- $ctx: req.$ctx
17
- });
18
- }
19
- return super.createRawHandler(metadata);
20
- }
21
- async onCtxRequest(requestOptions) {
22
- try {
23
- return await super.onCtxRequest(requestOptions);
24
- }
25
- catch (er) {
26
- return this.onError(er, requestOptions);
27
- }
28
- }
29
- }
30
- exports.PlatformExpressHandler = PlatformExpressHandler;
31
- //# sourceMappingURL=PlatformExpressHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformExpressHandler.js","sourceRoot":"","sources":["../../../src/services/PlatformExpressHandler.ts"],"names":[],"mappings":";;;AAAA,yCAA6F;AAE7F;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,wBAAe;IAC/C,gBAAgB,CAAC,QAAyB;QAClD,IAAI,QAAQ,CAAC,IAAI,KAAK,oBAAW,CAAC,cAAc,EAAE;YAChD,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC9C,OAAO,KAAK,EAAE,GAAQ,EAAE,GAAQ,EAAE,GAAQ,EAAE,IAAS,EAAE,EAAE,CACvD,OAAO,CAAC;gBACN,GAAG;gBACH,IAAI;gBACJ,IAAI,EAAE,GAAG,CAAC,IAAI;aACf,CAAC,CAAC;SACN;QAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAES,KAAK,CAAC,YAAY,CAAC,cAAgC;QAC3D,IAAI;YACF,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;SACjD;QAAC,OAAO,EAAE,EAAE;YACX,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;SACzC;IACH,CAAC;CACF;AAtBD,wDAsBC","sourcesContent":["import {HandlerMetadata, HandlerType, OnRequestOptions, PlatformHandler} from \"@tsed/common\";\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpressHandler extends PlatformHandler {\n protected createRawHandler(metadata: HandlerMetadata): Function {\n if (metadata.type === HandlerType.ERR_MIDDLEWARE) {\n const handler = this.compileHandler(metadata);\n return async (err: any, req: any, res: any, next: any) =>\n handler({\n err,\n next,\n $ctx: req.$ctx\n });\n }\n\n return super.createRawHandler(metadata);\n }\n\n protected async onCtxRequest(requestOptions: OnRequestOptions): Promise<any> {\n try {\n return await super.onCtxRequest(requestOptions);\n } catch (er) {\n return this.onError(er, requestOptions);\n }\n }\n}\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformExpressRequest = void 0;
4
- const common_1 = require("@tsed/common");
5
- /**
6
- * @platform
7
- * @express
8
- */
9
- class PlatformExpressRequest extends common_1.PlatformRequest {
10
- }
11
- exports.PlatformExpressRequest = PlatformExpressRequest;
12
- //# sourceMappingURL=PlatformExpressRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformExpressRequest.js","sourceRoot":"","sources":["../../../src/services/PlatformExpressRequest.ts"],"names":[],"mappings":";;;AAAA,yCAA8D;AAG9D;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,wBAAgC;CAAG;AAA/E,wDAA+E","sourcesContent":["import {PlatformContext, PlatformRequest} from \"@tsed/common\";\nimport type Express from \"express\";\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpressRequest extends PlatformRequest<Express.Request> {}\n"]}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformExpressResponse = void 0;
4
- const common_1 = require("@tsed/common");
5
- /**
6
- * @platform
7
- * @express
8
- */
9
- class PlatformExpressResponse extends common_1.PlatformResponse {
10
- }
11
- exports.PlatformExpressResponse = PlatformExpressResponse;
12
- //# sourceMappingURL=PlatformExpressResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformExpressResponse.js","sourceRoot":"","sources":["../../../src/services/PlatformExpressResponse.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAS9C;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,yBAAkC;CAAG;AAAlF,0DAAkF","sourcesContent":["import {PlatformResponse} from \"@tsed/common\";\nimport type Express from \"express\";\n\ndeclare global {\n namespace TsED {\n export interface Response extends Express.Response {}\n }\n}\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpressResponse extends PlatformResponse<Express.Response> {}\n"]}
@@ -1,27 +0,0 @@
1
- import { RouterSettings } from "./routerSettings.js";
2
- /**
3
- * Specify the behavior of the router controller.
4
- *
5
- * ```typescript
6
- * @Controller("/")
7
- * @CaseSensitive(true)
8
- * class MyCtrl {
9
- *
10
- * }
11
- * ```
12
- *
13
- * Property | Description | Default
14
- * ---|---|---
15
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
16
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
17
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
18
- *
19
- * @param caseSensitive
20
- * @returns {Function}
21
- * @decorator
22
- * @express
23
- */
24
- export function CaseSensitive(caseSensitive) {
25
- return RouterSettings({ caseSensitive });
26
- }
27
- //# sourceMappingURL=caseSensitive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"caseSensitive.js","sourceRoot":"","sources":["../../../src/decorators/caseSensitive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,aAAa,CAAC,aAAsB;IAClD,OAAO,cAAc,CAAC,EAAC,aAAa,EAAC,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import {RouterSettings} from \"./routerSettings\";\n\n/**\n * Specify the behavior of the router controller.\n *\n * ```typescript\n * @Controller(\"/\")\n * @CaseSensitive(true)\n * class MyCtrl {\n *\n * }\n * ```\n *\n * Property | Description | Default\n * ---|---|---\n * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.\n * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false\n * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.\n *\n * @param caseSensitive\n * @returns {Function}\n * @decorator\n * @express\n */\nexport function CaseSensitive(caseSensitive: boolean) {\n return RouterSettings({caseSensitive});\n}\n"]}
@@ -1,27 +0,0 @@
1
- import { RouterSettings } from "./routerSettings.js";
2
- /**
3
- * Specify the behavior of the router controller.
4
- *
5
- * ```typescript
6
- * @Controller("/")
7
- * @MergeParams(true)
8
- * class MyCtrl {
9
- *
10
- * }
11
- * ```
12
- *
13
- * Property | Description | Default
14
- * ---|---|---
15
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
16
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
17
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
18
- *
19
- * @param mergeParams
20
- * @returns {Function}
21
- * @decorator
22
- * @express
23
- */
24
- export function MergeParams(mergeParams = true) {
25
- return RouterSettings({ mergeParams });
26
- }
27
- //# sourceMappingURL=mergeParams.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergeParams.js","sourceRoot":"","sources":["../../../src/decorators/mergeParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,WAAW,CAAC,cAAuB,IAAI;IACrD,OAAO,cAAc,CAAC,EAAC,WAAW,EAAC,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {RouterSettings} from \"./routerSettings\";\n\n/**\n * Specify the behavior of the router controller.\n *\n * ```typescript\n * @Controller(\"/\")\n * @MergeParams(true)\n * class MyCtrl {\n *\n * }\n * ```\n *\n * Property | Description | Default\n * ---|---|---\n * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.\n * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false\n * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.\n *\n * @param mergeParams\n * @returns {Function}\n * @decorator\n * @express\n */\nexport function MergeParams(mergeParams: boolean = true) {\n return RouterSettings({mergeParams});\n}\n"]}
@@ -1,28 +0,0 @@
1
- import { ROUTER_OPTIONS } from "@tsed/common";
2
- import { StoreMerge } from "@tsed/core";
3
- /**
4
- * Specify the behavior of the router controller.
5
- *
6
- * ```typescript
7
- * @Controller("/")
8
- * @RouterSettings({mergeParams: true})
9
- * class MyCtrl {
10
- *
11
- * }
12
- * ```
13
- *
14
- * Property | Description | Default
15
- * ---|---|---
16
- * caseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
17
- * mergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
18
- * strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
19
- *
20
- * @returns {(target:any)=>void}
21
- * @decorator
22
- * @param routerOptions
23
- * @express
24
- */
25
- export function RouterSettings(routerOptions) {
26
- return StoreMerge(ROUTER_OPTIONS, routerOptions);
27
- }
28
- //# sourceMappingURL=routerSettings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routerSettings.js","sourceRoot":"","sources":["../../../src/decorators/routerSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,cAAc,CAAC,aAA4B;IACzD,OAAO,UAAU,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import {ROUTER_OPTIONS} from \"@tsed/common\";\nimport {StoreMerge} from \"@tsed/core\";\nimport {RouterOptions} from \"express\";\n\n/**\n * Specify the behavior of the router controller.\n *\n * ```typescript\n * @Controller(\"/\")\n * @RouterSettings({mergeParams: true})\n * class MyCtrl {\n *\n * }\n * ```\n *\n * Property | Description | Default\n * ---|---|---\n * caseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.\n * mergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false\n * strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.\n *\n * @returns {(target:any)=>void}\n * @decorator\n * @param routerOptions\n * @express\n */\nexport function RouterSettings(routerOptions: RouterOptions): Function {\n return StoreMerge(ROUTER_OPTIONS, routerOptions);\n}\n"]}
@@ -1,27 +0,0 @@
1
- import { RouterSettings } from "./routerSettings.js";
2
- /**
3
- * Specify the behavior of the router controller.
4
- *
5
- * ```typescript
6
- * @Controller("/")
7
- * @Strict(true)
8
- * class MyCtrl {
9
- *
10
- * }
11
- * ```
12
- *
13
- * Property | Description | Default
14
- * ---|---|---
15
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
16
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
17
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
18
- *
19
- * @param strict
20
- * @returns {Function}
21
- * @decorator
22
- * @express
23
- */
24
- export function Strict(strict) {
25
- return RouterSettings({ strict });
26
- }
27
- //# sourceMappingURL=strict.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strict.js","sourceRoot":"","sources":["../../../src/decorators/strict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,MAAM,CAAC,MAAe;IACpC,OAAO,cAAc,CAAC,EAAC,MAAM,EAAC,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import {RouterSettings} from \"./routerSettings\";\n\n/**\n * Specify the behavior of the router controller.\n *\n * ```typescript\n * @Controller(\"/\")\n * @Strict(true)\n * class MyCtrl {\n *\n * }\n * ```\n *\n * Property | Description | Default\n * ---|---|---\n * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.\n * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false\n * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.\n *\n * @param strict\n * @returns {Function}\n * @decorator\n * @express\n */\nexport function Strict(strict: boolean) {\n return RouterSettings({strict});\n}\n"]}
@@ -1,27 +0,0 @@
1
- import { HandlerType, PlatformHandler } from "@tsed/common";
2
- /**
3
- * @platform
4
- * @express
5
- */
6
- export class PlatformExpressHandler extends PlatformHandler {
7
- createRawHandler(metadata) {
8
- if (metadata.type === HandlerType.ERR_MIDDLEWARE) {
9
- const handler = this.compileHandler(metadata);
10
- return async (err, req, res, next) => handler({
11
- err,
12
- next,
13
- $ctx: req.$ctx
14
- });
15
- }
16
- return super.createRawHandler(metadata);
17
- }
18
- async onCtxRequest(requestOptions) {
19
- try {
20
- return await super.onCtxRequest(requestOptions);
21
- }
22
- catch (er) {
23
- return this.onError(er, requestOptions);
24
- }
25
- }
26
- }
27
- //# sourceMappingURL=PlatformExpressHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformExpressHandler.js","sourceRoot":"","sources":["../../../src/services/PlatformExpressHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAoB,eAAe,EAAC,MAAM,cAAc,CAAC;AAE7F;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,eAAe;IAC/C,gBAAgB,CAAC,QAAyB;QAClD,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,CAAC,cAAc,EAAE;YAChD,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC9C,OAAO,KAAK,EAAE,GAAQ,EAAE,GAAQ,EAAE,GAAQ,EAAE,IAAS,EAAE,EAAE,CACvD,OAAO,CAAC;gBACN,GAAG;gBACH,IAAI;gBACJ,IAAI,EAAE,GAAG,CAAC,IAAI;aACf,CAAC,CAAC;SACN;QAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAES,KAAK,CAAC,YAAY,CAAC,cAAgC;QAC3D,IAAI;YACF,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;SACjD;QAAC,OAAO,EAAE,EAAE;YACX,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;SACzC;IACH,CAAC;CACF","sourcesContent":["import {HandlerMetadata, HandlerType, OnRequestOptions, PlatformHandler} from \"@tsed/common\";\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpressHandler extends PlatformHandler {\n protected createRawHandler(metadata: HandlerMetadata): Function {\n if (metadata.type === HandlerType.ERR_MIDDLEWARE) {\n const handler = this.compileHandler(metadata);\n return async (err: any, req: any, res: any, next: any) =>\n handler({\n err,\n next,\n $ctx: req.$ctx\n });\n }\n\n return super.createRawHandler(metadata);\n }\n\n protected async onCtxRequest(requestOptions: OnRequestOptions): Promise<any> {\n try {\n return await super.onCtxRequest(requestOptions);\n } catch (er) {\n return this.onError(er, requestOptions);\n }\n }\n}\n"]}
@@ -1,8 +0,0 @@
1
- import { PlatformRequest } from "@tsed/common";
2
- /**
3
- * @platform
4
- * @express
5
- */
6
- export class PlatformExpressRequest extends PlatformRequest {
7
- }
8
- //# sourceMappingURL=PlatformExpressRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformExpressRequest.js","sourceRoot":"","sources":["../../../src/services/PlatformExpressRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAC,MAAM,cAAc,CAAC;AAG9D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,eAAgC;CAAG","sourcesContent":["import {PlatformContext, PlatformRequest} from \"@tsed/common\";\nimport type Express from \"express\";\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpressRequest extends PlatformRequest<Express.Request> {}\n"]}
@@ -1,8 +0,0 @@
1
- import { PlatformResponse } from "@tsed/common";
2
- /**
3
- * @platform
4
- * @express
5
- */
6
- export class PlatformExpressResponse extends PlatformResponse {
7
- }
8
- //# sourceMappingURL=PlatformExpressResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformExpressResponse.js","sourceRoot":"","sources":["../../../src/services/PlatformExpressResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAS9C;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,gBAAkC;CAAG","sourcesContent":["import {PlatformResponse} from \"@tsed/common\";\nimport type Express from \"express\";\n\ndeclare global {\n namespace TsED {\n export interface Response extends Express.Response {}\n }\n}\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpressResponse extends PlatformResponse<Express.Response> {}\n"]}
@@ -1,23 +0,0 @@
1
- /**
2
- * Specify the behavior of the router controller.
3
- *
4
- * ```typescript
5
- * @Controller("/")
6
- * @CaseSensitive(true)
7
- * class MyCtrl {
8
- *
9
- * }
10
- * ```
11
- *
12
- * Property | Description | Default
13
- * ---|---|---
14
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
15
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
16
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
17
- *
18
- * @param caseSensitive
19
- * @returns {Function}
20
- * @decorator
21
- * @express
22
- */
23
- export declare function CaseSensitive(caseSensitive: boolean): Function;
@@ -1,23 +0,0 @@
1
- /**
2
- * Specify the behavior of the router controller.
3
- *
4
- * ```typescript
5
- * @Controller("/")
6
- * @MergeParams(true)
7
- * class MyCtrl {
8
- *
9
- * }
10
- * ```
11
- *
12
- * Property | Description | Default
13
- * ---|---|---
14
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
15
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
16
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
17
- *
18
- * @param mergeParams
19
- * @returns {Function}
20
- * @decorator
21
- * @express
22
- */
23
- export declare function MergeParams(mergeParams?: boolean): Function;
@@ -1,24 +0,0 @@
1
- import { RouterOptions } from "express";
2
- /**
3
- * Specify the behavior of the router controller.
4
- *
5
- * ```typescript
6
- * @Controller("/")
7
- * @RouterSettings({mergeParams: true})
8
- * class MyCtrl {
9
- *
10
- * }
11
- * ```
12
- *
13
- * Property | Description | Default
14
- * ---|---|---
15
- * caseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
16
- * mergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
17
- * strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
18
- *
19
- * @returns {(target:any)=>void}
20
- * @decorator
21
- * @param routerOptions
22
- * @express
23
- */
24
- export declare function RouterSettings(routerOptions: RouterOptions): Function;
@@ -1,23 +0,0 @@
1
- /**
2
- * Specify the behavior of the router controller.
3
- *
4
- * ```typescript
5
- * @Controller("/")
6
- * @Strict(true)
7
- * class MyCtrl {
8
- *
9
- * }
10
- * ```
11
- *
12
- * Property | Description | Default
13
- * ---|---|---
14
- * CaseSensitive | Enable case sensitivity. | Disabled by default, treating “/Foo” and “/foo” as the same.
15
- * MergeParams | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. | false
16
- * Strict | Enable strict routing. | Disabled by default, “/foo” and “/foo/” are treated the same by the router.
17
- *
18
- * @param strict
19
- * @returns {Function}
20
- * @decorator
21
- * @express
22
- */
23
- export declare function Strict(strict: boolean): Function;
@@ -1,9 +0,0 @@
1
- import { HandlerMetadata, OnRequestOptions, PlatformHandler } from "@tsed/common";
2
- /**
3
- * @platform
4
- * @express
5
- */
6
- export declare class PlatformExpressHandler extends PlatformHandler {
7
- protected createRawHandler(metadata: HandlerMetadata): Function;
8
- protected onCtxRequest(requestOptions: OnRequestOptions): Promise<any>;
9
- }
@@ -1,8 +0,0 @@
1
- import { PlatformRequest } from "@tsed/common";
2
- import type Express from "express";
3
- /**
4
- * @platform
5
- * @express
6
- */
7
- export declare class PlatformExpressRequest extends PlatformRequest<Express.Request> {
8
- }
@@ -1,14 +0,0 @@
1
- import { PlatformResponse } from "@tsed/common";
2
- import type Express from "express";
3
- declare global {
4
- namespace TsED {
5
- interface Response extends Express.Response {
6
- }
7
- }
8
- }
9
- /**
10
- * @platform
11
- * @express
12
- */
13
- export declare class PlatformExpressResponse extends PlatformResponse<Express.Response> {
14
- }