@hg-ts/http-controller 0.1.58

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 (106) hide show
  1. package/README.md +1 -0
  2. package/dist/decorators/decorators.d.ts +32 -0
  3. package/dist/decorators/decorators.d.ts.map +1 -0
  4. package/dist/decorators/decorators.js +168 -0
  5. package/dist/decorators/decorators.js.map +1 -0
  6. package/dist/decorators/index.d.ts +2 -0
  7. package/dist/decorators/index.d.ts.map +1 -0
  8. package/dist/decorators/index.js +5 -0
  9. package/dist/decorators/index.js.map +1 -0
  10. package/dist/example.d.ts +2 -0
  11. package/dist/example.d.ts.map +1 -0
  12. package/dist/example.js.map +1 -0
  13. package/dist/http-controller.module.d.ts +3 -0
  14. package/dist/http-controller.module.d.ts.map +1 -0
  15. package/dist/http-controller.module.js +15 -0
  16. package/dist/http-controller.module.js.map +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +2 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/middlewares/exception-handler.d.ts +8 -0
  22. package/dist/middlewares/exception-handler.d.ts.map +1 -0
  23. package/dist/middlewares/exception-handler.js +45 -0
  24. package/dist/middlewares/exception-handler.js.map +1 -0
  25. package/dist/middlewares/index.d.ts +3 -0
  26. package/dist/middlewares/index.d.ts.map +1 -0
  27. package/dist/middlewares/index.js +6 -0
  28. package/dist/middlewares/index.js.map +1 -0
  29. package/dist/middlewares/validation.pipe.d.ts +10 -0
  30. package/dist/middlewares/validation.pipe.d.ts.map +1 -0
  31. package/dist/middlewares/validation.pipe.js +28 -0
  32. package/dist/middlewares/validation.pipe.js.map +1 -0
  33. package/dist/services/index.d.ts +2 -0
  34. package/dist/services/index.d.ts.map +1 -0
  35. package/dist/services/index.js +5 -0
  36. package/dist/services/index.js.map +1 -0
  37. package/dist/services/swagger.service.d.ts +6 -0
  38. package/dist/services/swagger.service.d.ts.map +1 -0
  39. package/dist/services/swagger.service.js +22 -0
  40. package/dist/services/swagger.service.js.map +1 -0
  41. package/dist/tests/abstracts/base-controller-suite.d.ts +13 -0
  42. package/dist/tests/abstracts/base-controller-suite.d.ts.map +1 -0
  43. package/dist/tests/abstracts/base-controller-suite.js +35 -0
  44. package/dist/tests/abstracts/base-controller-suite.js.map +1 -0
  45. package/dist/tests/abstracts/index.d.ts +2 -0
  46. package/dist/tests/abstracts/index.d.ts.map +1 -0
  47. package/dist/tests/abstracts/index.js +5 -0
  48. package/dist/tests/abstracts/index.js.map +1 -0
  49. package/dist/tests/echo/controllers/dto/echo-get-field.query.d.ts +3 -0
  50. package/dist/tests/echo/controllers/dto/echo-get-field.query.d.ts.map +1 -0
  51. package/dist/tests/echo/controllers/dto/echo-get-field.query.js +6 -0
  52. package/dist/tests/echo/controllers/dto/echo-get-field.query.js.map +1 -0
  53. package/dist/tests/echo/controllers/dto/echo-get.body.d.ts +7 -0
  54. package/dist/tests/echo/controllers/dto/echo-get.body.d.ts.map +1 -0
  55. package/dist/tests/echo/controllers/dto/echo-get.body.js +9 -0
  56. package/dist/tests/echo/controllers/dto/echo-get.body.js.map +1 -0
  57. package/dist/tests/echo/controllers/dto/echo-get.query.d.ts +7 -0
  58. package/dist/tests/echo/controllers/dto/echo-get.query.d.ts.map +1 -0
  59. package/dist/tests/echo/controllers/dto/echo-get.query.js +9 -0
  60. package/dist/tests/echo/controllers/dto/echo-get.query.js.map +1 -0
  61. package/dist/tests/echo/controllers/dto/echo-post.body.d.ts +7 -0
  62. package/dist/tests/echo/controllers/dto/echo-post.body.d.ts.map +1 -0
  63. package/dist/tests/echo/controllers/dto/echo-post.body.js +9 -0
  64. package/dist/tests/echo/controllers/dto/echo-post.body.js.map +1 -0
  65. package/dist/tests/echo/controllers/dto/index.d.ts +4 -0
  66. package/dist/tests/echo/controllers/dto/index.d.ts.map +1 -0
  67. package/dist/tests/echo/controllers/dto/index.js +7 -0
  68. package/dist/tests/echo/controllers/dto/index.js.map +1 -0
  69. package/dist/tests/echo/controllers/echo.controller.d.ts +10 -0
  70. package/dist/tests/echo/controllers/echo.controller.d.ts.map +1 -0
  71. package/dist/tests/echo/controllers/echo.controller.js +76 -0
  72. package/dist/tests/echo/controllers/echo.controller.js.map +1 -0
  73. package/dist/tests/echo/controllers/index.d.ts +2 -0
  74. package/dist/tests/echo/controllers/index.d.ts.map +1 -0
  75. package/dist/tests/echo/controllers/index.js +5 -0
  76. package/dist/tests/echo/controllers/index.js.map +1 -0
  77. package/dist/tests/echo/echo.test.d.ts +14 -0
  78. package/dist/tests/echo/echo.test.d.ts.map +1 -0
  79. package/dist/tests/echo/echo.test.js +116 -0
  80. package/dist/tests/echo/echo.test.js.map +1 -0
  81. package/dist/tests/echo/echo.test.module.d.ts +3 -0
  82. package/dist/tests/echo/echo.test.module.d.ts.map +1 -0
  83. package/dist/tests/echo/echo.test.module.js +17 -0
  84. package/dist/tests/echo/echo.test.module.js.map +1 -0
  85. package/dist/tests/http-methods/controllers/empty-response.controller.d.ts +11 -0
  86. package/dist/tests/http-methods/controllers/empty-response.controller.d.ts.map +1 -0
  87. package/dist/tests/http-methods/controllers/empty-response.controller.js +91 -0
  88. package/dist/tests/http-methods/controllers/empty-response.controller.js.map +1 -0
  89. package/dist/tests/http-methods/controllers/index.d.ts +2 -0
  90. package/dist/tests/http-methods/controllers/index.d.ts.map +1 -0
  91. package/dist/tests/http-methods/controllers/index.js +5 -0
  92. package/dist/tests/http-methods/controllers/index.js.map +1 -0
  93. package/dist/tests/http-methods/http-methods.test.d.ts +15 -0
  94. package/dist/tests/http-methods/http-methods.test.d.ts.map +1 -0
  95. package/dist/tests/http-methods/http-methods.test.js +104 -0
  96. package/dist/tests/http-methods/http-methods.test.js.map +1 -0
  97. package/dist/tests/http-methods/http-methods.test.module.d.ts +3 -0
  98. package/dist/tests/http-methods/http-methods.test.module.d.ts.map +1 -0
  99. package/dist/tests/http-methods/http-methods.test.module.js +17 -0
  100. package/dist/tests/http-methods/http-methods.test.module.js.map +1 -0
  101. package/dist/types.d.ts +10 -0
  102. package/dist/types.d.ts.map +1 -0
  103. package/dist/types.js +14 -0
  104. package/dist/types.js.map +1 -0
  105. package/package.json +55 -0
  106. package/tsconfig.json +9 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo-get.query.d.ts","sourceRoot":"","sources":["../../../../../src/tests/echo/controllers/dto/echo-get.query.ts"],"names":[],"mappings":";;;AAIA,qBAAa,YAAa,SAAQ,iBAA4B;CAAG"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EchoGetQuery = void 0;
4
+ const validation_1 = require("@hg-ts/validation");
5
+ const echoGetQuerySchema = validation_1.z.object({ test: validation_1.z.string() });
6
+ class EchoGetQuery extends echoGetQuerySchema.toClass() {
7
+ }
8
+ exports.EchoGetQuery = EchoGetQuery;
9
+ //# sourceMappingURL=echo-get.query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo-get.query.js","sourceRoot":"","sources":["../../../../../src/tests/echo/controllers/dto/echo-get.query.ts"],"names":[],"mappings":";;;AAAA,kDAAsC;AAEtC,MAAM,kBAAkB,GAAG,cAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE1D,MAAa,YAAa,SAAQ,kBAAkB,CAAC,OAAO,EAAE;CAAG;AAAjE,oCAAiE"}
@@ -0,0 +1,7 @@
1
+ declare const EchoPostBody_base: import("@hg-ts/validation").ZodDto<{
2
+ test: number;
3
+ }>;
4
+ export declare class EchoPostBody extends EchoPostBody_base {
5
+ }
6
+ export {};
7
+ //# sourceMappingURL=echo-post.body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo-post.body.d.ts","sourceRoot":"","sources":["../../../../../src/tests/echo/controllers/dto/echo-post.body.ts"],"names":[],"mappings":";;;AAIA,qBAAa,YAAa,SAAQ,iBAA4B;CAAG"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EchoPostBody = void 0;
4
+ const validation_1 = require("@hg-ts/validation");
5
+ const echoPostBodySchema = validation_1.z.object({ test: validation_1.z.number() });
6
+ class EchoPostBody extends echoPostBodySchema.toClass() {
7
+ }
8
+ exports.EchoPostBody = EchoPostBody;
9
+ //# sourceMappingURL=echo-post.body.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo-post.body.js","sourceRoot":"","sources":["../../../../../src/tests/echo/controllers/dto/echo-post.body.ts"],"names":[],"mappings":";;;AAAA,kDAAsC;AAEtC,MAAM,kBAAkB,GAAG,cAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE1D,MAAa,YAAa,SAAQ,kBAAkB,CAAC,OAAO,EAAE;CAAG;AAAjE,oCAAiE"}
@@ -0,0 +1,4 @@
1
+ export * from './echo-get.query';
2
+ export * from './echo-post.body';
3
+ export * from './echo-get-field.query';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tests/echo/controllers/dto/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./echo-get.query"), exports);
5
+ tslib_1.__exportStar(require("./echo-post.body"), exports);
6
+ tslib_1.__exportStar(require("./echo-get-field.query"), exports);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/tests/echo/controllers/dto/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,2DAAiC;AACjC,iEAAuC"}
@@ -0,0 +1,10 @@
1
+ import { EchoGetQuery, EchoPostBody } from './dto';
2
+ export declare class EchoController {
3
+ getEchoQuery(query: EchoGetQuery): Promise<EchoGetQuery>;
4
+ getEchoQueryField(query: number): Promise<number>;
5
+ getEchoParam(params: EchoGetQuery): Promise<EchoGetQuery>;
6
+ getEchoParamField(param: number): Promise<number>;
7
+ postEchoQuery(query: EchoGetQuery): Promise<EchoGetQuery>;
8
+ postEchoBody(body: EchoPostBody): Promise<EchoPostBody>;
9
+ }
10
+ //# sourceMappingURL=echo.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.controller.d.ts","sourceRoot":"","sources":["../../../../src/tests/echo/controllers/echo.controller.ts"],"names":[],"mappings":"AACA,OAAO,EACN,YAAY,EAEZ,YAAY,EACZ,MAAM,OAAO,CAAC;AAEf,qBAIa,cAAc;IAEb,YAAY,CACV,KAAK,EAAE,YAAY,GAC/B,OAAO,CAAC,YAAY,CAAC;IAKX,iBAAiB,CACW,KAAK,EAAE,MAAM,GACnD,OAAO,CAAC,MAAM,CAAC;IAKL,YAAY,CACV,MAAM,EAAE,YAAY,GAChC,OAAO,CAAC,YAAY,CAAC;IAKX,iBAAiB,CACW,KAAK,EAAE,MAAM,GACnD,OAAO,CAAC,MAAM,CAAC;IAKL,aAAa,CACX,KAAK,EAAE,YAAY,GAC/B,OAAO,CAAC,YAAY,CAAC;IAKX,YAAY,CACX,IAAI,EAAE,YAAY,GAC7B,OAAO,CAAC,YAAY,CAAC;CAGxB"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EchoController = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const decorators_1 = require("../../../decorators");
6
+ const dto_1 = require("./dto");
7
+ let EchoController = class EchoController {
8
+ async getEchoQuery(query) {
9
+ return query;
10
+ }
11
+ async getEchoQueryField(query) {
12
+ return query;
13
+ }
14
+ async getEchoParam(params) {
15
+ return params;
16
+ }
17
+ async getEchoParamField(param) {
18
+ return param;
19
+ }
20
+ async postEchoQuery(query) {
21
+ return query;
22
+ }
23
+ async postEchoBody(body) {
24
+ return body;
25
+ }
26
+ };
27
+ exports.EchoController = EchoController;
28
+ tslib_1.__decorate([
29
+ decorators_1.Http.Get('/query'),
30
+ tslib_1.__param(0, decorators_1.Http.Query()),
31
+ tslib_1.__metadata("design:type", Function),
32
+ tslib_1.__metadata("design:paramtypes", [dto_1.EchoGetQuery]),
33
+ tslib_1.__metadata("design:returntype", Promise)
34
+ ], EchoController.prototype, "getEchoQuery", null);
35
+ tslib_1.__decorate([
36
+ decorators_1.Http.Get('/query/field'),
37
+ tslib_1.__param(0, decorators_1.Http.Query('test', dto_1.echoGetQuerySchema)),
38
+ tslib_1.__metadata("design:type", Function),
39
+ tslib_1.__metadata("design:paramtypes", [Number]),
40
+ tslib_1.__metadata("design:returntype", Promise)
41
+ ], EchoController.prototype, "getEchoQueryField", null);
42
+ tslib_1.__decorate([
43
+ decorators_1.Http.Get('/param/:test'),
44
+ tslib_1.__param(0, decorators_1.Http.Param()),
45
+ tslib_1.__metadata("design:type", Function),
46
+ tslib_1.__metadata("design:paramtypes", [dto_1.EchoGetQuery]),
47
+ tslib_1.__metadata("design:returntype", Promise)
48
+ ], EchoController.prototype, "getEchoParam", null);
49
+ tslib_1.__decorate([
50
+ decorators_1.Http.Get('/param-field/:test'),
51
+ tslib_1.__param(0, decorators_1.Http.Param('test', dto_1.echoGetQuerySchema)),
52
+ tslib_1.__metadata("design:type", Function),
53
+ tslib_1.__metadata("design:paramtypes", [Number]),
54
+ tslib_1.__metadata("design:returntype", Promise)
55
+ ], EchoController.prototype, "getEchoParamField", null);
56
+ tslib_1.__decorate([
57
+ decorators_1.Http.Post('/query'),
58
+ tslib_1.__param(0, decorators_1.Http.Query()),
59
+ tslib_1.__metadata("design:type", Function),
60
+ tslib_1.__metadata("design:paramtypes", [dto_1.EchoGetQuery]),
61
+ tslib_1.__metadata("design:returntype", Promise)
62
+ ], EchoController.prototype, "postEchoQuery", null);
63
+ tslib_1.__decorate([
64
+ decorators_1.Http.Post('/body'),
65
+ tslib_1.__param(0, decorators_1.Http.Body()),
66
+ tslib_1.__metadata("design:type", Function),
67
+ tslib_1.__metadata("design:paramtypes", [dto_1.EchoPostBody]),
68
+ tslib_1.__metadata("design:returntype", Promise)
69
+ ], EchoController.prototype, "postEchoBody", null);
70
+ exports.EchoController = EchoController = tslib_1.__decorate([
71
+ decorators_1.Http.Controller({
72
+ path: '/echo',
73
+ tags: 'Echo',
74
+ })
75
+ ], EchoController);
76
+ //# sourceMappingURL=echo.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.controller.js","sourceRoot":"","sources":["../../../../src/tests/echo/controllers/echo.controller.ts"],"names":[],"mappings":";;;;AAAA,oDAA2C;AAC3C,+BAIe;AAMR,IAAM,cAAc,GAApB,MAAM,cAAc;IAEb,AAAN,KAAK,CAAC,YAAY,CACV,KAAmB;QAEjC,OAAO,KAAK,CAAC;IACd,CAAC;IAGY,AAAN,KAAK,CAAC,iBAAiB,CACW,KAAa;QAErD,OAAO,KAAK,CAAC;IACd,CAAC;IAGY,AAAN,KAAK,CAAC,YAAY,CACV,MAAoB;QAElC,OAAO,MAAM,CAAC;IACf,CAAC;IAGY,AAAN,KAAK,CAAC,iBAAiB,CACW,KAAa;QAErD,OAAO,KAAK,CAAC;IACd,CAAC;IAGY,AAAN,KAAK,CAAC,aAAa,CACX,KAAmB;QAEjC,OAAO,KAAK,CAAC;IACd,CAAC;IAGY,AAAN,KAAK,CAAC,YAAY,CACX,IAAkB;QAE/B,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AA1CY,wCAAc;AAEb;IADZ,iBAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;IAEjB,mBAAA,iBAAI,CAAC,KAAK,EAAE,CAAA;;6CAAQ,kBAAY;;kDAGjC;AAGY;IADZ,iBAAI,CAAC,GAAG,CAAC,cAAc,CAAC;IAEvB,mBAAA,iBAAI,CAAC,KAAK,CAAC,MAAM,EAAE,wBAAkB,CAAC,CAAA;;;;uDAGvC;AAGY;IADZ,iBAAI,CAAC,GAAG,CAAC,cAAc,CAAC;IAEvB,mBAAA,iBAAI,CAAC,KAAK,EAAE,CAAA;;6CAAS,kBAAY;;kDAGlC;AAGY;IADZ,iBAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC;IAE7B,mBAAA,iBAAI,CAAC,KAAK,CAAC,MAAM,EAAE,wBAAkB,CAAC,CAAA;;;;uDAGvC;AAGY;IADZ,iBAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;IAElB,mBAAA,iBAAI,CAAC,KAAK,EAAE,CAAA;;6CAAQ,kBAAY;;mDAGjC;AAGY;IADZ,iBAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAEjB,mBAAA,iBAAI,CAAC,IAAI,EAAE,CAAA;;6CAAO,kBAAY;;kDAG/B;yBAzCW,cAAc;IAJ1B,iBAAI,CAAC,UAAU,CAAC;QAChB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,MAAM;KACZ,CAAC;GACW,cAAc,CA0C1B"}
@@ -0,0 +1,2 @@
1
+ export * from './echo.controller';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tests/echo/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./echo.controller"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tests/echo/controllers/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
@@ -0,0 +1,14 @@
1
+ import { BaseControllerSuite } from '../abstracts';
2
+ export declare class EchoTest extends BaseControllerSuite {
3
+ constructor();
4
+ echoGet(): Promise<void>;
5
+ echoPostQuery(): Promise<void>;
6
+ echoPostBody(): Promise<void>;
7
+ echoGetParam(): Promise<void>;
8
+ echoGetParamField(): Promise<void>;
9
+ echoGetField(): Promise<void>;
10
+ echoGetInvalidQuery(): Promise<void>;
11
+ echoGetFieldInvalidQuery(): Promise<void>;
12
+ protected getFreePortIndex(): number;
13
+ }
14
+ //# sourceMappingURL=echo.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.test.d.ts","sourceRoot":"","sources":["../../../src/tests/echo/echo.test.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,qBACa,QAAS,SAAQ,mBAAmB;;IAMnC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IASxB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAS9B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAS7B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAS7B,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQlC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAW7B,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQpC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;cAMnC,gBAAgB,IAAI,MAAM;CAG7C"}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EchoTest = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const tests_1 = require("@hg-ts/tests");
6
+ const abstracts_1 = require("../abstracts");
7
+ const echo_test_module_1 = require("./echo.test.module");
8
+ let EchoTest = class EchoTest extends abstracts_1.BaseControllerSuite {
9
+ constructor() {
10
+ super(echo_test_module_1.EchoTestModule);
11
+ }
12
+ async echoGet() {
13
+ const value = '3.12';
14
+ const params = { test: value };
15
+ const response = await this.client.get('/echo/query', { params });
16
+ (0, tests_1.expect)(response.data).toMatchObject(params);
17
+ }
18
+ async echoPostQuery() {
19
+ const value = '3.12';
20
+ const params = { test: value };
21
+ const response = await this.client.post('/echo/query', null, { params });
22
+ (0, tests_1.expect)(response.data).toMatchObject(params);
23
+ }
24
+ async echoPostBody() {
25
+ const value = 3.12;
26
+ const data = { test: value };
27
+ const response = await this.client.post('/echo/body', data);
28
+ (0, tests_1.expect)(response.data).toMatchObject(data);
29
+ }
30
+ async echoGetParam() {
31
+ const value = '3.12';
32
+ const params = { test: value };
33
+ const response = await this.client.get(`/echo/param/${value}`);
34
+ (0, tests_1.expect)(response.data).toMatchObject(params);
35
+ }
36
+ async echoGetParamField() {
37
+ const value = 3.12;
38
+ const response = await this.client.get(`/echo/param-field/${value}`);
39
+ (0, tests_1.expect)(response.data).toBe(value);
40
+ }
41
+ async echoGetField() {
42
+ const value = '4.15';
43
+ const params = { test: value };
44
+ const response = await this.client.get('/echo/query/field', { params });
45
+ (0, tests_1.expect)(response.data).toBe(Number(value));
46
+ }
47
+ async echoGetInvalidQuery() {
48
+ const value = '5.16';
49
+ const params = { unknownKey: value };
50
+ await this.client.get('/echo/query', { params });
51
+ }
52
+ async echoGetFieldInvalidQuery() {
53
+ const value = '9.10 unknown text';
54
+ const params = { unknownField: value };
55
+ await this.client.get('/echo/query/field', { params });
56
+ }
57
+ getFreePortIndex() {
58
+ return 1;
59
+ }
60
+ };
61
+ exports.EchoTest = EchoTest;
62
+ tslib_1.__decorate([
63
+ (0, tests_1.Test)(),
64
+ tslib_1.__metadata("design:type", Function),
65
+ tslib_1.__metadata("design:paramtypes", []),
66
+ tslib_1.__metadata("design:returntype", Promise)
67
+ ], EchoTest.prototype, "echoGet", null);
68
+ tslib_1.__decorate([
69
+ (0, tests_1.Test)(),
70
+ tslib_1.__metadata("design:type", Function),
71
+ tslib_1.__metadata("design:paramtypes", []),
72
+ tslib_1.__metadata("design:returntype", Promise)
73
+ ], EchoTest.prototype, "echoPostQuery", null);
74
+ tslib_1.__decorate([
75
+ (0, tests_1.Test)(),
76
+ tslib_1.__metadata("design:type", Function),
77
+ tslib_1.__metadata("design:paramtypes", []),
78
+ tslib_1.__metadata("design:returntype", Promise)
79
+ ], EchoTest.prototype, "echoPostBody", null);
80
+ tslib_1.__decorate([
81
+ (0, tests_1.Test)(),
82
+ tslib_1.__metadata("design:type", Function),
83
+ tslib_1.__metadata("design:paramtypes", []),
84
+ tslib_1.__metadata("design:returntype", Promise)
85
+ ], EchoTest.prototype, "echoGetParam", null);
86
+ tslib_1.__decorate([
87
+ (0, tests_1.Test)(),
88
+ tslib_1.__metadata("design:type", Function),
89
+ tslib_1.__metadata("design:paramtypes", []),
90
+ tslib_1.__metadata("design:returntype", Promise)
91
+ ], EchoTest.prototype, "echoGetParamField", null);
92
+ tslib_1.__decorate([
93
+ (0, tests_1.Test)(),
94
+ tslib_1.__metadata("design:type", Function),
95
+ tslib_1.__metadata("design:paramtypes", []),
96
+ tslib_1.__metadata("design:returntype", Promise)
97
+ ], EchoTest.prototype, "echoGetField", null);
98
+ tslib_1.__decorate([
99
+ (0, tests_1.Test)(),
100
+ (0, tests_1.ExpectException)(),
101
+ tslib_1.__metadata("design:type", Function),
102
+ tslib_1.__metadata("design:paramtypes", []),
103
+ tslib_1.__metadata("design:returntype", Promise)
104
+ ], EchoTest.prototype, "echoGetInvalidQuery", null);
105
+ tslib_1.__decorate([
106
+ (0, tests_1.Test)(),
107
+ (0, tests_1.ExpectException)(),
108
+ tslib_1.__metadata("design:type", Function),
109
+ tslib_1.__metadata("design:paramtypes", []),
110
+ tslib_1.__metadata("design:returntype", Promise)
111
+ ], EchoTest.prototype, "echoGetFieldInvalidQuery", null);
112
+ exports.EchoTest = EchoTest = tslib_1.__decorate([
113
+ (0, tests_1.Describe)(),
114
+ tslib_1.__metadata("design:paramtypes", [])
115
+ ], EchoTest);
116
+ //# sourceMappingURL=echo.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.test.js","sourceRoot":"","sources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C,MAAM,MAAM,GAA4B,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;QAChE,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACxD,CAAC;IAEkB,gBAAgB;QAClC,OAAO,CAAC,CAAC;IACV,CAAC;CACD,CAAA;AA9EY,4BAAQ;AAMP;IADZ,IAAA,YAAI,GAAE;;;;uCAON;AAGY;IADZ,IAAA,YAAI,GAAE;;;;6CAON;AAGY;IADZ,IAAA,YAAI,GAAE;;;;4CAON;AAGY;IADZ,IAAA,YAAI,GAAE;;;;4CAON;AAGY;IADZ,IAAA,YAAI,GAAE;;;;iDAMN;AAGY;IADZ,IAAA,YAAI,GAAE;;;;4CAQN;AAIY;IAFZ,IAAA,YAAI,GAAE;IACN,IAAA,uBAAe,GAAE;;;;mDAKjB;AAIY;IAFZ,IAAA,YAAI,GAAE;IACN,IAAA,uBAAe,GAAE;;;;wDAKjB;mBAzEW,QAAQ;IADpB,IAAA,gBAAQ,GAAE;;GACE,QAAQ,CA8EpB"}
@@ -0,0 +1,3 @@
1
+ export declare class EchoTestModule {
2
+ }
3
+ //# sourceMappingURL=echo.test.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.test.module.d.ts","sourceRoot":"","sources":["../../../src/tests/echo/echo.test.module.ts"],"names":[],"mappings":"AAKA,qBAIa,cAAc;CAAG"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EchoTestModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ioc_1 = require("@hg-ts/ioc");
6
+ const http_controller_module_1 = require("../../http-controller.module");
7
+ const controllers_1 = require("./controllers");
8
+ let EchoTestModule = class EchoTestModule {
9
+ };
10
+ exports.EchoTestModule = EchoTestModule;
11
+ exports.EchoTestModule = EchoTestModule = tslib_1.__decorate([
12
+ (0, ioc_1.Module)({
13
+ imports: [http_controller_module_1.HttpControllerModule],
14
+ controllers: [controllers_1.EchoController],
15
+ })
16
+ ], EchoTestModule);
17
+ //# sourceMappingURL=echo.test.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echo.test.module.js","sourceRoot":"","sources":["../../../src/tests/echo/echo.test.module.ts"],"names":[],"mappings":";;;;AAAA,oCAAoC;AACpC,yEAAoE;AAEpE,+CAA+C;AAMxC,IAAM,cAAc,GAApB,MAAM,cAAc;CAAG,CAAA;AAAjB,wCAAc;yBAAd,cAAc;IAJ1B,IAAA,YAAM,EAAC;QACP,OAAO,EAAE,CAAC,6CAAoB,CAAC;QAC/B,WAAW,EAAE,CAAC,4BAAc,CAAC;KAC7B,CAAC;GACW,cAAc,CAAG"}
@@ -0,0 +1,11 @@
1
+ export declare class EmptyResponseController {
2
+ getEmptyReturn(): Promise<void>;
3
+ postEmptyReturn(): Promise<void>;
4
+ putEmptyReturn(): Promise<void>;
5
+ patchEmptyReturn(): Promise<void>;
6
+ optionsEmptyReturn(): Promise<void>;
7
+ deleteEmptyReturn(): Promise<void>;
8
+ searchEmptyReturn(): Promise<void>;
9
+ allEmptyReturn(): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=empty-response.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-response.controller.d.ts","sourceRoot":"","sources":["../../../../src/tests/http-methods/controllers/empty-response.controller.ts"],"names":[],"mappings":"AAIA,qBAIa,uBAAuB;IAEtB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAKhC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKnC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKlC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAQlC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5C"}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmptyResponseController = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const tests_1 = require("@hg-ts/tests");
6
+ const decorators_1 = require("../../../decorators");
7
+ let EmptyResponseController = class EmptyResponseController {
8
+ async getEmptyReturn() {
9
+ (0, tests_1.expect)(true).toBe(true);
10
+ }
11
+ async postEmptyReturn() {
12
+ (0, tests_1.expect)(true).toBe(true);
13
+ }
14
+ async putEmptyReturn() {
15
+ (0, tests_1.expect)(true).toBe(true);
16
+ }
17
+ async patchEmptyReturn() {
18
+ (0, tests_1.expect)(true).toBe(true);
19
+ }
20
+ async optionsEmptyReturn() {
21
+ (0, tests_1.expect)(true).toBe(true);
22
+ }
23
+ async deleteEmptyReturn() {
24
+ (0, tests_1.expect)(true).toBe(true);
25
+ }
26
+ async searchEmptyReturn() {
27
+ (0, tests_1.expect)(true).toBe(true);
28
+ }
29
+ async allEmptyReturn() {
30
+ (0, tests_1.expect)(true).toBe(true);
31
+ }
32
+ };
33
+ exports.EmptyResponseController = EmptyResponseController;
34
+ tslib_1.__decorate([
35
+ decorators_1.Http.Get(),
36
+ tslib_1.__metadata("design:type", Function),
37
+ tslib_1.__metadata("design:paramtypes", []),
38
+ tslib_1.__metadata("design:returntype", Promise)
39
+ ], EmptyResponseController.prototype, "getEmptyReturn", null);
40
+ tslib_1.__decorate([
41
+ decorators_1.Http.Post(),
42
+ tslib_1.__metadata("design:type", Function),
43
+ tslib_1.__metadata("design:paramtypes", []),
44
+ tslib_1.__metadata("design:returntype", Promise)
45
+ ], EmptyResponseController.prototype, "postEmptyReturn", null);
46
+ tslib_1.__decorate([
47
+ decorators_1.Http.Put(),
48
+ tslib_1.__metadata("design:type", Function),
49
+ tslib_1.__metadata("design:paramtypes", []),
50
+ tslib_1.__metadata("design:returntype", Promise)
51
+ ], EmptyResponseController.prototype, "putEmptyReturn", null);
52
+ tslib_1.__decorate([
53
+ decorators_1.Http.Patch(),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", []),
56
+ tslib_1.__metadata("design:returntype", Promise)
57
+ ], EmptyResponseController.prototype, "patchEmptyReturn", null);
58
+ tslib_1.__decorate([
59
+ decorators_1.Http.Options(),
60
+ tslib_1.__metadata("design:type", Function),
61
+ tslib_1.__metadata("design:paramtypes", []),
62
+ tslib_1.__metadata("design:returntype", Promise)
63
+ ], EmptyResponseController.prototype, "optionsEmptyReturn", null);
64
+ tslib_1.__decorate([
65
+ decorators_1.Http.Delete(),
66
+ tslib_1.__metadata("design:type", Function),
67
+ tslib_1.__metadata("design:paramtypes", []),
68
+ tslib_1.__metadata("design:returntype", Promise)
69
+ ], EmptyResponseController.prototype, "deleteEmptyReturn", null);
70
+ tslib_1.__decorate([
71
+ decorators_1.Http.Search(),
72
+ tslib_1.__metadata("design:type", Function),
73
+ tslib_1.__metadata("design:paramtypes", []),
74
+ tslib_1.__metadata("design:returntype", Promise)
75
+ ], EmptyResponseController.prototype, "searchEmptyReturn", null);
76
+ tslib_1.__decorate([
77
+ decorators_1.Http.All({
78
+ path: '/all',
79
+ tags: 'Empty Response All',
80
+ }),
81
+ tslib_1.__metadata("design:type", Function),
82
+ tslib_1.__metadata("design:paramtypes", []),
83
+ tslib_1.__metadata("design:returntype", Promise)
84
+ ], EmptyResponseController.prototype, "allEmptyReturn", null);
85
+ exports.EmptyResponseController = EmptyResponseController = tslib_1.__decorate([
86
+ decorators_1.Http.Controller({
87
+ path: '/empty-response',
88
+ tags: 'Empty Response',
89
+ })
90
+ ], EmptyResponseController);
91
+ //# sourceMappingURL=empty-response.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-response.controller.js","sourceRoot":"","sources":["../../../../src/tests/http-methods/controllers/empty-response.controller.ts"],"names":[],"mappings":";;;;AAAA,wCAAsC;AAEtC,oDAA2C;AAMpC,IAAM,uBAAu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Y;IADZ,iBAAI,CAAC,MAAM,EAAE;;;;gEAGb;AAGY;IADZ,iBAAI,CAAC,MAAM,EAAE;;;;gEAGb;AAMY;IAJZ,iBAAI,CAAC,GAAG,CAAC;QACT,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,oBAAoB;KAC1B,CAAC;;;;6DAGD;kCA1CW,uBAAuB;IAJnC,iBAAI,CAAC,UAAU,CAAC;QAChB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,gBAAgB;KACtB,CAAC;GACW,uBAAuB,CA2CnC"}
@@ -0,0 +1,2 @@
1
+ export * from './empty-response.controller';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tests/http-methods/controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./empty-response.controller"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tests/http-methods/controllers/index.ts"],"names":[],"mappings":";;;AAAA,sEAA4C"}
@@ -0,0 +1,15 @@
1
+ import { BaseControllerSuite } from '../abstracts';
2
+ export declare class HttpMethodsTest extends BaseControllerSuite {
3
+ constructor();
4
+ emptyGetTest(): Promise<void>;
5
+ emptyPostTest(): Promise<void>;
6
+ emptyPutTest(): Promise<void>;
7
+ emptyPatchTest(): Promise<void>;
8
+ emptyDeleteTest(): Promise<void>;
9
+ emptyOptionsTest(): Promise<void>;
10
+ emptySearchTest(): Promise<void>;
11
+ emptyAllTest(): Promise<void>;
12
+ protected getFreePortIndex(): number;
13
+ private testEmptyResponseTest;
14
+ }
15
+ //# sourceMappingURL=http-methods.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-methods.test.d.ts","sourceRoot":"","sources":["../../../src/tests/http-methods/http-methods.test.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,qBACa,eAAgB,SAAQ,mBAAmB;;IAM1C,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAKhC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAKhC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;cAQvB,gBAAgB,IAAI,MAAM;YAI/B,qBAAqB;CASnC"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpMethodsTest = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const tests_1 = require("@hg-ts/tests");
6
+ const types_1 = require("../../types");
7
+ const abstracts_1 = require("../abstracts");
8
+ const http_methods_test_module_1 = require("./http-methods.test.module");
9
+ let HttpMethodsTest = class HttpMethodsTest extends abstracts_1.BaseControllerSuite {
10
+ constructor() {
11
+ super(http_methods_test_module_1.HttpMethodsTestModule);
12
+ }
13
+ async emptyGetTest() {
14
+ await this.testEmptyResponseTest(types_1.HttpMethod.GET);
15
+ }
16
+ async emptyPostTest() {
17
+ await this.testEmptyResponseTest(types_1.HttpMethod.POST);
18
+ }
19
+ async emptyPutTest() {
20
+ await this.testEmptyResponseTest(types_1.HttpMethod.PUT);
21
+ }
22
+ async emptyPatchTest() {
23
+ await this.testEmptyResponseTest(types_1.HttpMethod.PATCH);
24
+ }
25
+ async emptyDeleteTest() {
26
+ await this.testEmptyResponseTest(types_1.HttpMethod.DELETE);
27
+ }
28
+ async emptyOptionsTest() {
29
+ await this.testEmptyResponseTest(types_1.HttpMethod.OPTIONS);
30
+ }
31
+ async emptySearchTest() {
32
+ await this.testEmptyResponseTest(types_1.HttpMethod.SEARCH);
33
+ }
34
+ async emptyAllTest() {
35
+ const methods = Object.values(types_1.HttpMethod);
36
+ await Promise.all(methods.map(async (method) => this.testEmptyResponseTest(method, '/all')));
37
+ tests_1.expect.assertions(methods.length * 2);
38
+ }
39
+ getFreePortIndex() {
40
+ return 0;
41
+ }
42
+ async testEmptyResponseTest(method, suffixPath = '') {
43
+ const response = await this.client.request({
44
+ method,
45
+ url: `/empty-response${suffixPath}`,
46
+ });
47
+ (0, tests_1.expect)(response.data).toBe('');
48
+ tests_1.expect.assertions(2);
49
+ }
50
+ };
51
+ exports.HttpMethodsTest = HttpMethodsTest;
52
+ tslib_1.__decorate([
53
+ (0, tests_1.Test)(),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", []),
56
+ tslib_1.__metadata("design:returntype", Promise)
57
+ ], HttpMethodsTest.prototype, "emptyGetTest", null);
58
+ tslib_1.__decorate([
59
+ (0, tests_1.Test)(),
60
+ tslib_1.__metadata("design:type", Function),
61
+ tslib_1.__metadata("design:paramtypes", []),
62
+ tslib_1.__metadata("design:returntype", Promise)
63
+ ], HttpMethodsTest.prototype, "emptyPostTest", null);
64
+ tslib_1.__decorate([
65
+ (0, tests_1.Test)(),
66
+ tslib_1.__metadata("design:type", Function),
67
+ tslib_1.__metadata("design:paramtypes", []),
68
+ tslib_1.__metadata("design:returntype", Promise)
69
+ ], HttpMethodsTest.prototype, "emptyPutTest", null);
70
+ tslib_1.__decorate([
71
+ (0, tests_1.Test)(),
72
+ tslib_1.__metadata("design:type", Function),
73
+ tslib_1.__metadata("design:paramtypes", []),
74
+ tslib_1.__metadata("design:returntype", Promise)
75
+ ], HttpMethodsTest.prototype, "emptyPatchTest", null);
76
+ tslib_1.__decorate([
77
+ (0, tests_1.Test)(),
78
+ tslib_1.__metadata("design:type", Function),
79
+ tslib_1.__metadata("design:paramtypes", []),
80
+ tslib_1.__metadata("design:returntype", Promise)
81
+ ], HttpMethodsTest.prototype, "emptyDeleteTest", null);
82
+ tslib_1.__decorate([
83
+ (0, tests_1.Test)(),
84
+ tslib_1.__metadata("design:type", Function),
85
+ tslib_1.__metadata("design:paramtypes", []),
86
+ tslib_1.__metadata("design:returntype", Promise)
87
+ ], HttpMethodsTest.prototype, "emptyOptionsTest", null);
88
+ tslib_1.__decorate([
89
+ (0, tests_1.Test)(),
90
+ tslib_1.__metadata("design:type", Function),
91
+ tslib_1.__metadata("design:paramtypes", []),
92
+ tslib_1.__metadata("design:returntype", Promise)
93
+ ], HttpMethodsTest.prototype, "emptySearchTest", null);
94
+ tslib_1.__decorate([
95
+ (0, tests_1.Test)(),
96
+ tslib_1.__metadata("design:type", Function),
97
+ tslib_1.__metadata("design:paramtypes", []),
98
+ tslib_1.__metadata("design:returntype", Promise)
99
+ ], HttpMethodsTest.prototype, "emptyAllTest", null);
100
+ exports.HttpMethodsTest = HttpMethodsTest = tslib_1.__decorate([
101
+ (0, tests_1.Describe)(),
102
+ tslib_1.__metadata("design:paramtypes", [])
103
+ ], HttpMethodsTest);
104
+ //# sourceMappingURL=http-methods.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-methods.test.js","sourceRoot":"","sources":["../../../src/tests/http-methods/http-methods.test.ts"],"names":[],"mappings":";;;;AAAA,wCAIsB;AAEtB,uCAAyC;AAEzC,4CAAmD;AACnD,yEAAmE;AAG5D,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,+BAAmB;IACvD;QACC,KAAK,CAAC,gDAAqB,CAAC,CAAC;IAC9B,CAAC;IAGY,AAAN,KAAK,CAAC,YAAY;QACxB,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAU,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;IAGY,AAAN,KAAK,CAAC,aAAa;QACzB,MAAM,IAAI,CAAC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AAA,cAAM,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/B,cAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;CACD,CAAA;AA9DY,0CAAe;AAMd;IADZ,IAAA,YAAI,GAAE;;;;mDAGN;AAGY;IADZ,IAAA,YAAI,GAAE;;;;oDAGN;AAGY;IADZ,IAAA,YAAI,GAAE;;;;mDAGN;AAGY;IADZ,IAAA,YAAI,GAAE;;;;qDAGN;AAGY;IADZ,IAAA,YAAI,GAAE;;;;sDAGN;AAGY;IADZ,IAAA,YAAI,GAAE;;;;uDAGN;AAGY;IADZ,IAAA,YAAI,GAAE;;;;sDAGN;AAGY;IADZ,IAAA,YAAI,GAAE;;;;mDAON;0BA/CW,eAAe;IAD3B,IAAA,gBAAQ,GAAE;;GACE,eAAe,CA8D3B"}
@@ -0,0 +1,3 @@
1
+ export declare class HttpMethodsTestModule {
2
+ }
3
+ //# sourceMappingURL=http-methods.test.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-methods.test.module.d.ts","sourceRoot":"","sources":["../../../src/tests/http-methods/http-methods.test.module.ts"],"names":[],"mappings":"AAMA,qBAIa,qBAAqB;CAAG"}