@expressots/core 2.9.1 → 2.11.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.
Files changed (95) hide show
  1. package/lib/CHANGELOG.md +145 -89
  2. package/lib/cjs/application/{app-container.js → application-container.js} +95 -94
  3. package/lib/cjs/application/application-factory.js +39 -74
  4. package/lib/cjs/application/index.js +7 -7
  5. package/lib/cjs/common/{color-service.provider.js → color-codes.js} +46 -47
  6. package/lib/cjs/common/index.js +2 -2
  7. package/lib/cjs/common/{package-resolver.provider.js → package-resolver.js} +35 -35
  8. package/lib/cjs/common/{project-config.provider.js → project-config.js} +2 -2
  9. package/lib/cjs/console/console.js +60 -61
  10. package/lib/cjs/console/index.js +5 -5
  11. package/lib/cjs/container-module/container-module.js +111 -111
  12. package/lib/cjs/container-module/index.js +6 -6
  13. package/lib/cjs/controller/base-controller.js +74 -75
  14. package/lib/cjs/controller/index.js +5 -5
  15. package/lib/cjs/decorator/index.js +17 -17
  16. package/lib/cjs/decorator/scope-binding.js +44 -44
  17. package/lib/cjs/error/app-error.js +26 -26
  18. package/lib/cjs/error/error-handler-middleware.js +28 -28
  19. package/lib/cjs/error/index.js +9 -9
  20. package/lib/cjs/error/report.js +53 -54
  21. package/lib/cjs/error/status-code.js +89 -89
  22. package/lib/cjs/index.js +26 -26
  23. package/lib/cjs/middleware/index.js +32 -32
  24. package/lib/cjs/middleware/interfaces/body-parser.interface.js +2 -2
  25. package/lib/cjs/middleware/interfaces/compression.interface.js +2 -2
  26. package/lib/cjs/middleware/interfaces/cookie-parser.interface.js +2 -2
  27. package/lib/cjs/middleware/interfaces/cookie-session/cookie-session.interface.js +2 -2
  28. package/lib/cjs/middleware/interfaces/cookie-session/keygrip.interface.js +2 -2
  29. package/lib/cjs/middleware/interfaces/cors.interface.js +2 -2
  30. package/lib/cjs/middleware/interfaces/express-rate-limit.interface.js +2 -2
  31. package/lib/cjs/middleware/interfaces/express-session.interface.js +2 -2
  32. package/lib/cjs/middleware/interfaces/helmet.interface.js +2 -2
  33. package/lib/cjs/middleware/interfaces/morgan.interface.js +2 -2
  34. package/lib/cjs/middleware/interfaces/multer.interface.js +2 -2
  35. package/lib/cjs/middleware/interfaces/serve-favicon.interface.js +2 -2
  36. package/lib/cjs/middleware/interfaces/serve-static.interface.js +2 -2
  37. package/lib/cjs/middleware/middleware-resolver.js +72 -72
  38. package/lib/cjs/middleware/middleware-service.js +480 -481
  39. package/lib/cjs/provider/db-in-memory/db-in-memory.provider.js +82 -82
  40. package/lib/cjs/provider/dto-validator/dto-validator.provider.js +53 -53
  41. package/lib/cjs/provider/environment/env-validator.provider.js +98 -98
  42. package/lib/cjs/provider/index.js +13 -13
  43. package/lib/cjs/provider/logger/logger.provider.js +117 -117
  44. package/lib/cjs/provider/provider-manager.js +49 -50
  45. package/lib/cjs/render/handlebars.interface.js +2 -2
  46. package/lib/cjs/render/index.js +2 -2
  47. package/lib/cjs/render/render.type.js +2 -2
  48. package/lib/cjs/types/application/{app-container.d.ts → application-container.d.ts} +64 -62
  49. package/lib/cjs/types/application/application-factory.d.ts +19 -34
  50. package/lib/cjs/types/application/index.d.ts +2 -2
  51. package/lib/cjs/types/common/{color-service.provider.d.ts → color-codes.d.ts} +29 -29
  52. package/lib/cjs/types/common/index.d.ts +1 -1
  53. package/lib/cjs/types/common/{package-resolver.provider.d.ts → package-resolver.d.ts} +8 -8
  54. package/lib/cjs/types/common/{project-config.provider.d.ts → project-config.d.ts} +56 -56
  55. package/lib/cjs/types/console/console.d.ts +27 -27
  56. package/lib/cjs/types/console/index.d.ts +1 -1
  57. package/lib/cjs/types/container-module/container-module.d.ts +28 -28
  58. package/lib/cjs/types/container-module/index.d.ts +1 -1
  59. package/lib/cjs/types/controller/base-controller.d.ts +48 -48
  60. package/lib/cjs/types/controller/index.d.ts +1 -1
  61. package/lib/cjs/types/decorator/index.d.ts +1 -1
  62. package/lib/cjs/types/decorator/scope-binding.d.ts +33 -33
  63. package/lib/cjs/types/error/app-error.d.ts +29 -29
  64. package/lib/cjs/types/error/error-handler-middleware.d.ts +11 -11
  65. package/lib/cjs/types/error/index.d.ts +3 -3
  66. package/lib/cjs/types/error/report.d.ts +25 -25
  67. package/lib/cjs/types/error/status-code.d.ts +136 -136
  68. package/lib/cjs/types/index.d.ts +10 -10
  69. package/lib/cjs/types/middleware/index.d.ts +13 -13
  70. package/lib/cjs/types/middleware/interfaces/body-parser.interface.d.ts +33 -33
  71. package/lib/cjs/types/middleware/interfaces/compression.interface.d.ts +98 -98
  72. package/lib/cjs/types/middleware/interfaces/cookie-parser.interface.d.ts +9 -9
  73. package/lib/cjs/types/middleware/interfaces/cookie-session/cookie-session.interface.d.ts +57 -57
  74. package/lib/cjs/types/middleware/interfaces/cookie-session/keygrip.interface.d.ts +27 -27
  75. package/lib/cjs/types/middleware/interfaces/cors.interface.d.ts +57 -57
  76. package/lib/cjs/types/middleware/interfaces/express-rate-limit.interface.d.ts +292 -292
  77. package/lib/cjs/types/middleware/interfaces/express-session.interface.d.ts +207 -207
  78. package/lib/cjs/types/middleware/interfaces/helmet.interface.d.ts +210 -210
  79. package/lib/cjs/types/middleware/interfaces/morgan.interface.d.ts +40 -40
  80. package/lib/cjs/types/middleware/interfaces/multer.interface.d.ts +255 -255
  81. package/lib/cjs/types/middleware/interfaces/serve-favicon.interface.d.ts +11 -11
  82. package/lib/cjs/types/middleware/interfaces/serve-static.interface.d.ts +70 -70
  83. package/lib/cjs/types/middleware/middleware-resolver.d.ts +11 -11
  84. package/lib/cjs/types/middleware/middleware-service.d.ts +368 -368
  85. package/lib/cjs/types/provider/db-in-memory/db-in-memory.provider.d.ts +43 -43
  86. package/lib/cjs/types/provider/dto-validator/dto-validator.provider.d.ts +11 -11
  87. package/lib/cjs/types/provider/environment/env-validator.provider.d.ts +35 -35
  88. package/lib/cjs/types/provider/index.d.ts +5 -5
  89. package/lib/cjs/types/provider/logger/logger.provider.d.ts +54 -54
  90. package/lib/cjs/types/provider/provider-manager.d.ts +16 -16
  91. package/lib/cjs/types/render/handlebars.interface.d.ts +46 -46
  92. package/lib/cjs/types/render/index.d.ts +2 -2
  93. package/lib/cjs/types/render/render.type.d.ts +12 -12
  94. package/lib/package.json +16 -17
  95. package/package.json +16 -17
package/lib/CHANGELOG.md CHANGED
@@ -1,123 +1,179 @@
1
1
 
2
2
 
3
- ## [2.9.1](https://github.com/expressots/expressots/compare/2.9.0...2.9.1) (2024-03-29)
3
+ ## [2.11.0](https://github.com/expressots/expressots/compare/2.10.0...2.11.0) (2024-04-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * bump @types/node from 20.12.2 to 20.12.3 ([430ada9](https://github.com/expressots/expressots/commit/430ada937b04ad12ca26dad1decabffe0b5299ab))
4
9
 
5
10
 
6
11
  ### Bug Fixes
7
12
 
8
- * add non opinionated scaffold schematics name change ([35cf0cb](https://github.com/expressots/expressots/commit/35cf0cb32c621d7b5112b0306b2001bb34c210ed))
13
+ * update adpater version to latest ([89c671d](https://github.com/expressots/expressots/commit/89c671d2905ceea8877ee5cc6c6fc8ddae262549))
14
+ * update console tests ([c639466](https://github.com/expressots/expressots/commit/c6394663749fe4ebda9ce0b54ccaa7e83593d0df))
15
+ * upgrade tsconfig-paths from 4.1.2 to 4.2.0 ([fc373a6](https://github.com/expressots/expressots/commit/fc373a64d41174351439a356afd3708aba0e8661))
16
+ * upgrade tsconfig-paths from 4.1.2 to 4.2.0 ([e8f0d68](https://github.com/expressots/expressots/commit/e8f0d68a02999d8bcf9936c1973b62a9c97119ac))
9
17
 
10
18
 
11
19
  ### Code Refactoring
12
20
 
13
- * add expressots project commands ([523cf19](https://github.com/expressots/expressots/commit/523cf1908f3ba36377738082bf24783e45117626))
14
- * adjust expressots build, dev, prod ([7be37a7](https://github.com/expressots/expressots/commit/7be37a7b8291ea88ab69ce72b4723780d278d405))
21
+ * appfactory class ([3fde40a](https://github.com/expressots/expressots/commit/3fde40a8754e22ad377e58d2c5a0b16fcf116dd0))
22
+ * rename items for standardization and improve doc ([d01f4d1](https://github.com/expressots/expressots/commit/d01f4d191a09716fde688404506ea7895efaf127))
15
23
 
16
- ## [2.9.0](https://github.com/expressots/expressots/compare/2.8.0...2.9.0) (2024-03-18)
24
+ ## [2.10.0](https://github.com/expressots/expressots/compare/2.9.1...2.10.0) (2024-03-31)
17
25
 
18
26
 
19
27
  ### Features
20
28
 
21
- * add plugin pattern on provider manager ([f56d5b3](https://github.com/expressots/expressots/commit/f56d5b3a2ebdcca8e61e91e831ce43e6e2a90c57))
29
+ * bump @commitlint/cli from 18.0.0 to 19.2.1 ([cbdf106](https://github.com/expressots/expressots/commit/cbdf106fc72605ecd8a66300cfe5951e50c3102c))
30
+ * bump @commitlint/config-conventional from 18.6.3 to 19.1.0 ([3e283c5](https://github.com/expressots/expressots/commit/3e283c5bc40ebaf1e4528e07a01fb10e552b33ab))
31
+ * bump @release-it/conventional-changelog from 7.0.1 to 7.0.2 ([5916d10](https://github.com/expressots/expressots/commit/5916d108e878b4104fbbede6f873e8c5ec533d81))
32
+ * bump @types/express from 4.17.17 to 4.17.21 ([9d3ce90](https://github.com/expressots/expressots/commit/9d3ce906b23918183df2f237fd5f2954564290d3))
33
+ * bump @types/node from 20.4.9 to 20.12.2 ([b62d698](https://github.com/expressots/expressots/commit/b62d698156fee5811eaa4b76f19786b36f476a8f))
34
+ * bump @typescript-eslint/eslint-plugin from 6.6.0 to 6.21.0 ([f03e326](https://github.com/expressots/expressots/commit/f03e326106777964229ed3b9fef3008a30751101))
35
+ * bump eslint from 8.48.0 to 8.57.0 ([c58c68b](https://github.com/expressots/expressots/commit/c58c68bc82b055b3a459b745b2906485d7968923))
36
+ * bump eslint-config-prettier from 9.0.0 to 9.1.0 ([6003fd9](https://github.com/expressots/expressots/commit/6003fd9c43d3b108cf23c2d5e882e85f9a86adb3))
37
+ * bump inversify from 6.0.1 to 6.0.2 ([dffffdd](https://github.com/expressots/expressots/commit/dffffddbf01181da7b117ffd37cf04324e65ac89))
38
+ * bump reflect-metadata from 0.2.1 to 0.2.2 ([eb606cd](https://github.com/expressots/expressots/commit/eb606cdb28bad0a62b1e88a906fbbba297518120))
39
+ * bump release-it from 16.1.5 to 16.3.0 ([ac94b32](https://github.com/expressots/expressots/commit/ac94b3274c9e1c0b6ffd3813bb3853f9b6648312))
40
+ * bump typescript from 4.9.5 to 5.4.3 ([2f7d8a3](https://github.com/expressots/expressots/commit/2f7d8a3c8640e91034b92dfdfc133006ac777155))
41
+ * bump vite from 4.5.0 to 5.2.7 ([c53a852](https://github.com/expressots/expressots/commit/c53a852d7701b49464deb0a5499faa17396bd5fc))
42
+ * bump vitest and @vitest/coverage-v8 ([dd561f8](https://github.com/expressots/expressots/commit/dd561f8b1caf163e453347d46ca7d40529bcd833))
22
43
 
23
44
 
24
45
  ### Bug Fixes
25
46
 
26
- * change expressots version to latest ([d42f0c9](https://github.com/expressots/expressots/commit/d42f0c9987ffa7a8ecc213500e39364182ba800e))
27
- * lock lib ver, add tsconfig to package ([298201c](https://github.com/expressots/expressots/commit/298201c1442821cf63f7ed788d7f76a6a7fe79e0))
28
- * lock versions, update to es2021 ([1ca53ca](https://github.com/expressots/expressots/commit/1ca53ca8ad6e52aea136fe48a99aab389456de93))
29
- * remove the appcontainer return dictionary method ([3dddb86](https://github.com/expressots/expressots/commit/3dddb86bf35e08e42f43c960e796756f2b938805))
30
- * rename logger-service to logger.provider ([3344717](https://github.com/expressots/expressots/commit/33447175665ed36c3581143bc451bf27fb4b778b))
47
+ * update inversify, reflect-metadata and express version, remove vulnerabilites ([62a7e92](https://github.com/expressots/expressots/commit/62a7e923c40145bf9a8899007292c02035348dad))
48
+ * update typescript to 5.2.2 rm conflict on eslin-tstree ([26e160d](https://github.com/expressots/expressots/commit/26e160ddc37e35ce5ef80af62ddf539409ee8f1c))
31
49
 
32
50
 
33
51
  ### Code Refactoring
34
52
 
35
- * adjust core op template and add full example ([ca5a843](https://github.com/expressots/expressots/commit/ca5a8436ae5a2afb57f426f6dc8b8efa0050f6b1))
36
- * non opinionated templated structure change ([8caf0d1](https://github.com/expressots/expressots/commit/8caf0d12b3751c61dfa16bb4a70722c64763ffcd))
37
- * update eslint config inferrable types ([845101f](https://github.com/expressots/expressots/commit/845101fa6472ab4874a220ef63ea4e8296fbd7a6))
38
-
39
-
40
- ### Continuous Integrations
41
-
53
+ * separate template tests from core ([57e6a98](https://github.com/expressots/expressots/commit/57e6a9863cc4a27039a6ba5978d9eda678fc920c))
54
+ * update app provider opinionated template ([9e45fcd](https://github.com/expressots/expressots/commit/9e45fcd01c8351cc931522e18a30434294aae695))
55
+ * update express types ([6a546d2](https://github.com/expressots/expressots/commit/6a546d2b4a4d12c6f807591a71c33887acebd29c))
56
+ * update non opinionated template ([77dd2cc](https://github.com/expressots/expressots/commit/77dd2cc00cff014a006dc56b7fa6f76dce9be25b))
57
+ * update non opinionated template ([f9d3b16](https://github.com/expressots/expressots/commit/f9d3b169f7db2d09223f8e94d19e082b544e35c9))
58
+
59
+ ## [2.9.1](https://github.com/expressots/expressots/compare/2.9.0...2.9.1) (2024-03-29)
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * add non opinionated scaffold schematics name change ([35cf0cb](https://github.com/expressots/expressots/commit/35cf0cb32c621d7b5112b0306b2001bb34c210ed))
65
+
66
+
67
+ ### Code Refactoring
68
+
69
+ * add expressots project commands ([523cf19](https://github.com/expressots/expressots/commit/523cf1908f3ba36377738082bf24783e45117626))
70
+ * adjust expressots build, dev, prod ([7be37a7](https://github.com/expressots/expressots/commit/7be37a7b8291ea88ab69ce72b4723780d278d405))
71
+
72
+ ## [2.9.0](https://github.com/expressots/expressots/compare/2.8.0...2.9.0) (2024-03-18)
73
+
74
+
75
+ ### Features
76
+
77
+ * add plugin pattern on provider manager ([f56d5b3](https://github.com/expressots/expressots/commit/f56d5b3a2ebdcca8e61e91e831ce43e6e2a90c57))
78
+
79
+
80
+ ### Bug Fixes
81
+
82
+ * change expressots version to latest ([d42f0c9](https://github.com/expressots/expressots/commit/d42f0c9987ffa7a8ecc213500e39364182ba800e))
83
+ * lock lib ver, add tsconfig to package ([298201c](https://github.com/expressots/expressots/commit/298201c1442821cf63f7ed788d7f76a6a7fe79e0))
84
+ * lock versions, update to es2021 ([1ca53ca](https://github.com/expressots/expressots/commit/1ca53ca8ad6e52aea136fe48a99aab389456de93))
85
+ * remove the appcontainer return dictionary method ([3dddb86](https://github.com/expressots/expressots/commit/3dddb86bf35e08e42f43c960e796756f2b938805))
86
+ * rename logger-service to logger.provider ([3344717](https://github.com/expressots/expressots/commit/33447175665ed36c3581143bc451bf27fb4b778b))
87
+
88
+
89
+ ### Code Refactoring
90
+
91
+ * adjust core op template and add full example ([ca5a843](https://github.com/expressots/expressots/commit/ca5a8436ae5a2afb57f426f6dc8b8efa0050f6b1))
92
+ * non opinionated templated structure change ([8caf0d1](https://github.com/expressots/expressots/commit/8caf0d12b3751c61dfa16bb4a70722c64763ffcd))
93
+ * update eslint config inferrable types ([845101f](https://github.com/expressots/expressots/commit/845101fa6472ab4874a220ef63ea4e8296fbd7a6))
94
+
95
+
96
+ ### Continuous Integrations
97
+
42
98
  * add prepublish script ([7b1478e](https://github.com/expressots/expressots/commit/7b1478e7cf1ec44b63e9f1a99354e49cb4ddaa7d))
43
99
 
44
- ## [2.8.0](https://github.com/expressots/expressots/compare/2.7.0...2.8.0) (2024-3-5)
45
-
46
-
47
- ### Features
48
-
49
- * add middleware handler, config and expresso ([df60183](https://github.com/expressots/expressots/commit/df601837a771662723f25f185622de8c912f6721))
50
- * add provide annotation to abstract class ExpressMiddleware ([49e762e](https://github.com/expressots/expressots/commit/49e762e035053d67a977d54d9f448334e931134b))
51
- * Added it into options wiring ([58e58c1](https://github.com/expressots/expressots/commit/58e58c11693d8dfc8e235bbc5b8d62aa35493ec9))
52
- * Added multer middleware for expressots ([522db5d](https://github.com/expressots/expressots/commit/522db5d58dd4521fd03528cf4178cbbc951a0537))
53
- * bump @commitlint/cli from 17.8.1 to 18.0.0 ([4ddcbd4](https://github.com/expressots/expressots/commit/4ddcbd49ffe65cfa7a15b253515bb7f3446046ee))
54
- * bump @commitlint/config-conventional from 17.8.1 to 18.0.0 ([91e1237](https://github.com/expressots/expressots/commit/91e12370f9736188805df20d4f7da378720ac43b))
55
- * bump husky from 8.0.3 to 9.0.11 ([#170](https://github.com/expressots/expressots/issues/170)) ([342983f](https://github.com/expressots/expressots/commit/342983fe59d6ccc409f887f7a1c8f65c9469a8d7))
56
- * bump prettier from 3.0.3 to 3.1.1 ([#145](https://github.com/expressots/expressots/issues/145)) ([2e7b812](https://github.com/expressots/expressots/commit/2e7b81226c65468edacae51407ce56c78c66a85b))
57
- * bump prettier from 3.1.1 to 3.2.5 ([#166](https://github.com/expressots/expressots/issues/166)) ([49c148c](https://github.com/expressots/expressots/commit/49c148c2fae6b4e0260650fbbcf559c69075d9bc))
58
- * bump reflect-metadata from 0.1.14 to 0.2.1 ([#148](https://github.com/expressots/expressots/issues/148)) ([f444982](https://github.com/expressots/expressots/commit/f444982ccbedb75f3c26b982a2a5d5d336857aae))
59
- * bump vite from 4.4.11 to 4.5.0 ([344161c](https://github.com/expressots/expressots/commit/344161cdf0cd7f54ffaa069023241aaea04d7c5d))
60
- * comments addressed ([8c3f55a](https://github.com/expressots/expressots/commit/8c3f55a901874c1e9c33d415157fa0a2beab9c56))
61
- * correct expresso middleware path ([0879c10](https://github.com/expressots/expressots/commit/0879c104810256f5143dcb2206579debaf0e6a97))
62
- * Include multer as resolver ([056d4d9](https://github.com/expressots/expressots/commit/056d4d99801f9f4af2932bcee333a1fa652b45a8))
63
- * remove getmiddleware pipeline from interface ([0577527](https://github.com/expressots/expressots/commit/057752754e257552eddebf031cf977f663b093ed))
64
- * Remove multer dependency / Added dynamic multer usage behavior ([6a4530b](https://github.com/expressots/expressots/commit/6a4530be243c961e5bfe50340d2c41742332e186))
65
- * Remove multer dependency with interface defined ([5a0acd2](https://github.com/expressots/expressots/commit/5a0acd228166efc2de8f4be7078c21ed6fd34634))
66
- * Remove multer dependency with interface defined ([8133621](https://github.com/expressots/expressots/commit/8133621108bb7f2017088d59ae6145da8606ebf7))
67
- * update reflect metadata on templates ([#152](https://github.com/expressots/expressots/issues/152)) ([75a3312](https://github.com/expressots/expressots/commit/75a33122e0f468b9e28040b8e7eb6747252e4c6b))
68
-
69
-
70
- ### Bug Fixes
71
-
72
- * interface types and middleware return multer ([b5223fd](https://github.com/expressots/expressots/commit/b5223fdc22eaaf1cb9b315b2aa77ad0e615e8ed3))
100
+ ## [2.8.0](https://github.com/expressots/expressots/compare/2.7.0...2.8.0) (2024-3-5)
101
+
102
+
103
+ ### Features
104
+
105
+ * add middleware handler, config and expresso ([df60183](https://github.com/expressots/expressots/commit/df601837a771662723f25f185622de8c912f6721))
106
+ * add provide annotation to abstract class ExpressMiddleware ([49e762e](https://github.com/expressots/expressots/commit/49e762e035053d67a977d54d9f448334e931134b))
107
+ * Added it into options wiring ([58e58c1](https://github.com/expressots/expressots/commit/58e58c11693d8dfc8e235bbc5b8d62aa35493ec9))
108
+ * Added multer middleware for expressots ([522db5d](https://github.com/expressots/expressots/commit/522db5d58dd4521fd03528cf4178cbbc951a0537))
109
+ * bump @commitlint/cli from 17.8.1 to 18.0.0 ([4ddcbd4](https://github.com/expressots/expressots/commit/4ddcbd49ffe65cfa7a15b253515bb7f3446046ee))
110
+ * bump @commitlint/config-conventional from 17.8.1 to 18.0.0 ([91e1237](https://github.com/expressots/expressots/commit/91e12370f9736188805df20d4f7da378720ac43b))
111
+ * bump husky from 8.0.3 to 9.0.11 ([#170](https://github.com/expressots/expressots/issues/170)) ([342983f](https://github.com/expressots/expressots/commit/342983fe59d6ccc409f887f7a1c8f65c9469a8d7))
112
+ * bump prettier from 3.0.3 to 3.1.1 ([#145](https://github.com/expressots/expressots/issues/145)) ([2e7b812](https://github.com/expressots/expressots/commit/2e7b81226c65468edacae51407ce56c78c66a85b))
113
+ * bump prettier from 3.1.1 to 3.2.5 ([#166](https://github.com/expressots/expressots/issues/166)) ([49c148c](https://github.com/expressots/expressots/commit/49c148c2fae6b4e0260650fbbcf559c69075d9bc))
114
+ * bump reflect-metadata from 0.1.14 to 0.2.1 ([#148](https://github.com/expressots/expressots/issues/148)) ([f444982](https://github.com/expressots/expressots/commit/f444982ccbedb75f3c26b982a2a5d5d336857aae))
115
+ * bump vite from 4.4.11 to 4.5.0 ([344161c](https://github.com/expressots/expressots/commit/344161cdf0cd7f54ffaa069023241aaea04d7c5d))
116
+ * comments addressed ([8c3f55a](https://github.com/expressots/expressots/commit/8c3f55a901874c1e9c33d415157fa0a2beab9c56))
117
+ * correct expresso middleware path ([0879c10](https://github.com/expressots/expressots/commit/0879c104810256f5143dcb2206579debaf0e6a97))
118
+ * Include multer as resolver ([056d4d9](https://github.com/expressots/expressots/commit/056d4d99801f9f4af2932bcee333a1fa652b45a8))
119
+ * remove getmiddleware pipeline from interface ([0577527](https://github.com/expressots/expressots/commit/057752754e257552eddebf031cf977f663b093ed))
120
+ * Remove multer dependency / Added dynamic multer usage behavior ([6a4530b](https://github.com/expressots/expressots/commit/6a4530be243c961e5bfe50340d2c41742332e186))
121
+ * Remove multer dependency with interface defined ([5a0acd2](https://github.com/expressots/expressots/commit/5a0acd228166efc2de8f4be7078c21ed6fd34634))
122
+ * Remove multer dependency with interface defined ([8133621](https://github.com/expressots/expressots/commit/8133621108bb7f2017088d59ae6145da8606ebf7))
123
+ * update reflect metadata on templates ([#152](https://github.com/expressots/expressots/issues/152)) ([75a3312](https://github.com/expressots/expressots/commit/75a33122e0f468b9e28040b8e7eb6747252e4c6b))
124
+
125
+
126
+ ### Bug Fixes
127
+
128
+ * interface types and middleware return multer ([b5223fd](https://github.com/expressots/expressots/commit/b5223fdc22eaaf1cb9b315b2aa77ad0e615e8ed3))
73
129
  * remove codesee build ([#177](https://github.com/expressots/expressots/issues/177)) ([812e06d](https://github.com/expressots/expressots/commit/812e06da1b91cc7a4b0685ec70b0f0de1bd4517b))
74
130
 
75
- ## [2.7.0](https://github.com/expressots/expressots/compare/2.6.0...2.7.0) (2023-10-17)
76
-
77
-
78
- ### Features
79
-
80
- * add db in memory as provider ([b656f22](https://github.com/expressots/expressots/commit/b656f2297e0e985dd5184c611f795edddf6c5b2d))
81
- * modify IMemoryDB interface name ([fd1d440](https://github.com/expressots/expressots/commit/fd1d440eb947f377955bfc2a969d3e7ca4ffaa3e))
82
-
83
-
84
- ### Bug Fixes
85
-
86
- * remove db in memory from template opinionated ([0516c8c](https://github.com/expressots/expressots/commit/0516c8c4e9c0e1a4b8aae3fab5842136a0565a39))
87
-
88
-
89
- ### Tests
90
-
131
+ ## [2.7.0](https://github.com/expressots/expressots/compare/2.6.0...2.7.0) (2023-10-17)
132
+
133
+
134
+ ### Features
135
+
136
+ * add db in memory as provider ([b656f22](https://github.com/expressots/expressots/commit/b656f2297e0e985dd5184c611f795edddf6c5b2d))
137
+ * modify IMemoryDB interface name ([fd1d440](https://github.com/expressots/expressots/commit/fd1d440eb947f377955bfc2a969d3e7ca4ffaa3e))
138
+
139
+
140
+ ### Bug Fixes
141
+
142
+ * remove db in memory from template opinionated ([0516c8c](https://github.com/expressots/expressots/commit/0516c8c4e9c0e1a4b8aae3fab5842136a0565a39))
143
+
144
+
145
+ ### Tests
146
+
91
147
  * improve collocation and fix console tests ([52bdf98](https://github.com/expressots/expressots/commit/52bdf98cfcbbffc58841b1b67c6ce2a1f6fe308b))
92
148
 
93
- ## [2.6.0](https://github.com/expressots/expressots/compare/2.5.0...2.6.0) (2023-10-09)
94
-
95
-
96
- ### Features
97
-
98
- * Added express-session middleware for expressots ([9d0c79f](https://github.com/expressots/expressots/commit/9d0c79f7c4b18cfcac17443c7f76c4384a563471))
99
- * bump vite from 4.4.10 to 4.4.11 ([45c8a80](https://github.com/expressots/expressots/commit/45c8a804e85875743cc18d95ec5441e19b7df7d3))
100
-
101
-
102
- ### Bug Fixes
103
-
104
- * Auto setup husky with project setup and installation ([dcdc279](https://github.com/expressots/expressots/commit/dcdc279f9dffe82e739396df763f494c97a3e914))
105
- * remove prepare husky install from lib ([ba9b536](https://github.com/expressots/expressots/commit/ba9b5363904a7d8981ec49705d5fbf22e20c8dbd))
149
+ ## [2.6.0](https://github.com/expressots/expressots/compare/2.5.0...2.6.0) (2023-10-09)
150
+
151
+
152
+ ### Features
153
+
154
+ * Added express-session middleware for expressots ([9d0c79f](https://github.com/expressots/expressots/commit/9d0c79f7c4b18cfcac17443c7f76c4384a563471))
155
+ * bump vite from 4.4.10 to 4.4.11 ([45c8a80](https://github.com/expressots/expressots/commit/45c8a804e85875743cc18d95ec5441e19b7df7d3))
156
+
157
+
158
+ ### Bug Fixes
159
+
160
+ * Auto setup husky with project setup and installation ([dcdc279](https://github.com/expressots/expressots/commit/dcdc279f9dffe82e739396df763f494c97a3e914))
161
+ * remove prepare husky install from lib ([ba9b536](https://github.com/expressots/expressots/commit/ba9b5363904a7d8981ec49705d5fbf22e20c8dbd))
106
162
  * typo ([079aad6](https://github.com/expressots/expressots/commit/079aad6c125fcd100cde5cf98ce84125e7381879))
107
163
 
108
- ## [2.5.0](https://github.com/expressots/expressots/compare/2.4.0...2.5.0) (2023-10-04)
109
-
110
-
111
- ### Features
112
-
113
- * bump vite from 4.4.9 to 4.4.10 ([5be4adc](https://github.com/expressots/expressots/commit/5be4adc18d84c3affa57d248dd07801bda4dd5b9))
114
- * bump vitest from 0.34.5 to 0.34.6 ([11ca77f](https://github.com/expressots/expressots/commit/11ca77f29d19d1de05b2ae2a56b9e306311621bf))
115
- * **core:** add helmet middleware ([7648afb](https://github.com/expressots/expressots/commit/7648afb68054c1e69990f7d33efe35ec4d99b464)), closes [#107](https://github.com/expressots/expressots/issues/107)
116
-
117
-
118
- ### Bug Fixes
119
-
120
- * adjust interface, remove duplicated helmet registry ([376c065](https://github.com/expressots/expressots/commit/376c0654d655ee8d29c0649d83ec6fb7cf860791))
164
+ ## [2.5.0](https://github.com/expressots/expressots/compare/2.4.0...2.5.0) (2023-10-04)
165
+
166
+
167
+ ### Features
168
+
169
+ * bump vite from 4.4.9 to 4.4.10 ([5be4adc](https://github.com/expressots/expressots/commit/5be4adc18d84c3affa57d248dd07801bda4dd5b9))
170
+ * bump vitest from 0.34.5 to 0.34.6 ([11ca77f](https://github.com/expressots/expressots/commit/11ca77f29d19d1de05b2ae2a56b9e306311621bf))
171
+ * **core:** add helmet middleware ([7648afb](https://github.com/expressots/expressots/commit/7648afb68054c1e69990f7d33efe35ec4d99b464)), closes [#107](https://github.com/expressots/expressots/issues/107)
172
+
173
+
174
+ ### Bug Fixes
175
+
176
+ * adjust interface, remove duplicated helmet registry ([376c065](https://github.com/expressots/expressots/commit/376c0654d655ee8d29c0649d83ec6fb7cf860791))
121
177
  * remove duplicate optionslhelmet interface ([93bfdea](https://github.com/expressots/expressots/commit/93bfdea0057614b0a2e449817fb095ed23112011))
122
178
 
123
179
  ## [2.4.0](https://github.com/expressots/expressots/compare/2.3.0...2.4.0) (2023-10-01)
@@ -1,94 +1,95 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- 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
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var AppContainer_1;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.AppContainer = void 0;
14
- const inversify_1 = require("inversify");
15
- const inversify_binding_decorators_1 = require("inversify-binding-decorators");
16
- /**
17
- * The AppContainer class provides a container for managing dependency injection.
18
- * It allows the creation of a container with custom options, including default binding scope
19
- * and the ability to skip base class checks. The container can be loaded with multiple
20
- * ContainerModule instances, facilitating modular and organized code.
21
- *
22
- * Usage:
23
- * const appContainer = new AppContainer(options);
24
- * const container = appContainer.create(modules);
25
- *
26
- * @provide AppContainer
27
- */
28
- let AppContainer = AppContainer_1 = class AppContainer {
29
- /**
30
- * Constructs the AppContainer instance.
31
- * @param options - The options for creating the container. Can include custom default scope and skip base class checks setting.
32
- */
33
- constructor(options) {
34
- this.options = {
35
- defaultScope: inversify_1.BindingScopeEnum.Request,
36
- ...options,
37
- };
38
- }
39
- /**
40
- * Creates and configures a new dependency injection container.
41
- * @param modules - An array of ContainerModule instances to load into the container.
42
- * @returns The configured dependency injection container.
43
- */
44
- create(modules) {
45
- const containerOptions = {
46
- autoBindInjectable: this.options.autoBindInjectable
47
- ? this.options.autoBindInjectable
48
- : true,
49
- ...this.options,
50
- };
51
- this.container = new inversify_1.Container(containerOptions);
52
- this.container.bind(inversify_1.Container).toConstantValue(this.container);
53
- this.container.load((0, inversify_binding_decorators_1.buildProviderModule)(), ...modules);
54
- return this.container;
55
- }
56
- /**
57
- * Retrieves the binding dictionary of the container.
58
- * @returns(void) Print table of the binding dictionary of the container.
59
- */
60
- viewContainerBindings() {
61
- const dictionary = this.container["_bindingDictionary"]._map;
62
- const entries = Array.from(dictionary.entries());
63
- const table = entries
64
- .map(([identifier, bindings]) => {
65
- return bindings.map((binding) => ({
66
- "Service Identifier": identifier,
67
- Scope: binding.scope,
68
- Type: binding.type,
69
- Cache: binding.cache !== null ? "Yes" : "No",
70
- }));
71
- })
72
- .flat();
73
- console.table(table);
74
- }
75
- /**
76
- * Retrieves the container options.
77
- * @returns The container options.
78
- */
79
- getContainerOptions() {
80
- return this.container.options;
81
- }
82
- /**
83
- * Retrieves the container.
84
- * @returns The container.
85
- */
86
- get Container() {
87
- return this.container;
88
- }
89
- };
90
- AppContainer = AppContainer_1 = __decorate([
91
- (0, inversify_binding_decorators_1.provide)(AppContainer_1),
92
- __metadata("design:paramtypes", [Object])
93
- ], AppContainer);
94
- exports.AppContainer = AppContainer;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AppContainer = void 0;
13
+ const inversify_1 = require("inversify");
14
+ const inversify_binding_decorators_1 = require("inversify-binding-decorators");
15
+ /**
16
+ * The AppContainer class provides a container for managing dependency injection.
17
+ * It allows the creation of a container with custom options, including default binding scope
18
+ * and the ability to skip base class checks. The container can be loaded with multiple
19
+ * ContainerModule instances, facilitating modular and organized code.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const container = new AppContainer();
24
+ * container.create([new MyModule()]);
25
+ */
26
+ let AppContainer = class AppContainer {
27
+ /**
28
+ * Constructs the AppContainer instance.
29
+ * @param options - The options for creating the container with default request scope.
30
+ * @option options.defaultScope - The default scope for bindings in the container.
31
+ * @option options.skipBaseClassChecks - Allows skipping of base class checks when working with derived classes.
32
+ * @option options.autoBindInjectable - Allows auto-binding of injectable classes.
33
+ */
34
+ constructor(options) {
35
+ this.options = {
36
+ defaultScope: inversify_1.BindingScopeEnum.Request,
37
+ ...options,
38
+ };
39
+ }
40
+ /**
41
+ * Creates and configures a new dependency injection container.
42
+ * @param modules - An array of ContainerModule instances to load into the container.
43
+ * @returns The configured dependency injection container.
44
+ */
45
+ create(modules) {
46
+ const containerOptions = {
47
+ autoBindInjectable: this.options.autoBindInjectable
48
+ ? this.options.autoBindInjectable
49
+ : true,
50
+ ...this.options,
51
+ };
52
+ this.container = new inversify_1.Container(containerOptions);
53
+ this.container.bind(inversify_1.Container).toConstantValue(this.container);
54
+ this.container.load((0, inversify_binding_decorators_1.buildProviderModule)(), ...modules);
55
+ return this.container;
56
+ }
57
+ /**
58
+ * Retrieves the binding dictionary of the container.
59
+ * @returns(void) Print table of the binding dictionary of the container.
60
+ */
61
+ viewContainerBindings() {
62
+ const dictionary = this.container["_bindingDictionary"]._map;
63
+ const entries = Array.from(dictionary.entries());
64
+ const table = entries
65
+ .map(([identifier, bindings]) => {
66
+ return bindings.map((binding) => ({
67
+ "Service Identifier": identifier,
68
+ Scope: binding.scope,
69
+ Type: binding.type,
70
+ Cache: binding.cache !== null ? "Yes" : "No",
71
+ }));
72
+ })
73
+ .flat();
74
+ console.table(table);
75
+ }
76
+ /**
77
+ * Retrieves the container options.
78
+ * @returns The container options.
79
+ */
80
+ getContainerOptions() {
81
+ return this.container.options;
82
+ }
83
+ /**
84
+ * Retrieves the container.
85
+ * @returns The container.
86
+ */
87
+ get Container() {
88
+ return this.container;
89
+ }
90
+ };
91
+ exports.AppContainer = AppContainer;
92
+ exports.AppContainer = AppContainer = __decorate([
93
+ (0, inversify_binding_decorators_1.provide)(AppContainer),
94
+ __metadata("design:paramtypes", [Object])
95
+ ], AppContainer);
@@ -1,74 +1,39 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppFactory = void 0;
4
- const logger_provider_1 = require("../provider/logger/logger.provider");
5
- const adapter_express_1 = require("@expressots/adapter-express");
6
- //import { AppFastify } from "./fastify/application-fastify";
7
- //import { IApplicationFastify } from "./fastify/application-fastify.interface";
8
- //import { Handler } from "@fastify/middie";
9
- /**
10
- * AppFactory Class
11
- *
12
- * Responsible for creating an instance of the Application,
13
- * either using a custom application type or with provided middlewares.
14
- */
15
- class AppFactory {
16
- /* public static async create(
17
- container: Container,
18
- middlewares: Array<express.RequestHandler>,
19
- httpServerFactory?: new () => AppFastify,
20
- ): Promise<AppFastify>; */
21
- /**
22
- * Implementation of the create method, handling both overloads.
23
- * @param container - InversifyJS container to resolve dependencies.
24
- * @param appTypeOrMiddlewares - Custom application class or array of middlewares.
25
- * @returns Instance of the application.
26
- */
27
- static async create(container, appTypeOrMiddlewares, httpServerFactory /*| AppFastify*/) {
28
- // Set the container for the application global access
29
- AppFactory.container = container;
30
- let app /*| AppFastify*/ = {}; /*| AppFastify*/
31
- if (this.isOpinionated(appTypeOrMiddlewares)) {
32
- switch (httpServerFactory) {
33
- case adapter_express_1.AppExpress:
34
- app = container.resolve(appTypeOrMiddlewares);
35
- app.create(container);
36
- return app;
37
- /* case AppFastify:
38
- app = container.resolve(appTypeOrMiddlewares as new () => AppFastify);
39
- await app.create(container);
40
- return app as IApplicationFastify; */
41
- default:
42
- app = container.resolve(appTypeOrMiddlewares);
43
- app.create(container);
44
- return app;
45
- }
46
- }
47
- else {
48
- switch (httpServerFactory) {
49
- case adapter_express_1.AppExpress:
50
- app = container.get(adapter_express_1.AppExpress);
51
- app.create(container, appTypeOrMiddlewares);
52
- return app;
53
- /* case AppFastify:
54
- app = container.get<AppFastify>(AppFastify);
55
- await app.create(container, appTypeOrMiddlewares as Array<Handler>);
56
- return app as AppFastify; */
57
- default:
58
- app = container.get(adapter_express_1.AppExpress);
59
- app.create(container, appTypeOrMiddlewares);
60
- return app;
61
- }
62
- }
63
- }
64
- /**
65
- * Checks if the provided parameter is a custom application type.
66
- * @param appTypeOrMiddlewares - Custom application class or array of middlewares.
67
- * @returns True if the provided parameter is a custom application type.
68
- */
69
- static isOpinionated(appTypeOrMiddlewares) {
70
- return typeof appTypeOrMiddlewares === "function";
71
- }
72
- }
73
- exports.AppFactory = AppFactory;
74
- AppFactory.logger = new logger_provider_1.Logger();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppFactory = void 0;
4
+ const logger_provider_1 = require("../provider/logger/logger.provider");
5
+ /**
6
+ * Type guard to check if input is a constructor type of IWebServer.
7
+ * @param input - Input to check.
8
+ * @returns True if input is a constructor type of IWebServer.
9
+ */
10
+ function isWebServerConstructor(input) {
11
+ return input && typeof input === "function";
12
+ }
13
+ /**
14
+ * AppFactory Class
15
+ *
16
+ * Responsible for creating an instance of the IWebServer implementation using a custom application type.
17
+ */
18
+ class AppFactory {
19
+ /**
20
+ * Create an instance of a web server.
21
+ * @param container - InversifyJS container to resolve dependencies.
22
+ * @param webServerType - Constructor of a class that implements IWebServer, or array of middlewares.
23
+ * @returns A promise that resolves to an instance of IWebServer.
24
+ */
25
+ static async create(container, webServerType) {
26
+ AppFactory.container = container;
27
+ if (isWebServerConstructor(webServerType)) {
28
+ const webServerInstance = new webServerType();
29
+ await webServerInstance.configure(container);
30
+ return webServerInstance;
31
+ }
32
+ else {
33
+ this.logger.error("Invalid web server type.", "app-factory:create");
34
+ throw new Error("Invalid web server type.");
35
+ }
36
+ }
37
+ }
38
+ exports.AppFactory = AppFactory;
39
+ AppFactory.logger = new logger_provider_1.Logger();
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppFactory = exports.AppContainer = void 0;
4
- var app_container_1 = require("./app-container");
5
- Object.defineProperty(exports, "AppContainer", { enumerable: true, get: function () { return app_container_1.AppContainer; } });
6
- var application_factory_1 = require("./application-factory");
7
- Object.defineProperty(exports, "AppFactory", { enumerable: true, get: function () { return application_factory_1.AppFactory; } });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppFactory = exports.AppContainer = void 0;
4
+ var application_container_1 = require("./application-container");
5
+ Object.defineProperty(exports, "AppContainer", { enumerable: true, get: function () { return application_container_1.AppContainer; } });
6
+ var application_factory_1 = require("./application-factory");
7
+ Object.defineProperty(exports, "AppFactory", { enumerable: true, get: function () { return application_factory_1.AppFactory; } });