@expressots/core 2.9.0 → 2.10.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 +133 -85
  2. package/lib/cjs/application/app-container.js +93 -94
  3. package/lib/cjs/application/application-factory.js +74 -74
  4. package/lib/cjs/application/index.js +7 -7
  5. package/lib/cjs/common/color-service.provider.js +46 -47
  6. package/lib/cjs/common/index.js +2 -2
  7. package/lib/cjs/common/package-resolver.provider.js +35 -35
  8. package/lib/cjs/common/project-config.provider.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 +62 -62
  49. package/lib/cjs/types/application/application-factory.d.ts +34 -34
  50. package/lib/cjs/types/application/index.d.ts +2 -2
  51. package/lib/cjs/types/common/color-service.provider.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 +8 -8
  54. package/lib/cjs/types/common/project-config.provider.d.ts +56 -47
  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,110 +1,158 @@
1
1
 
2
2
 
3
- ## [2.9.0](https://github.com/expressots/expressots/compare/2.8.0...2.9.0) (2024-03-18)
3
+ ## [2.10.0](https://github.com/expressots/expressots/compare/2.9.1...2.10.0) (2024-03-31)
4
4
 
5
5
 
6
6
  ### Features
7
7
 
8
- * add plugin pattern on provider manager ([f56d5b3](https://github.com/expressots/expressots/commit/f56d5b3a2ebdcca8e61e91e831ce43e6e2a90c57))
8
+ * bump @commitlint/cli from 18.0.0 to 19.2.1 ([cbdf106](https://github.com/expressots/expressots/commit/cbdf106fc72605ecd8a66300cfe5951e50c3102c))
9
+ * bump @commitlint/config-conventional from 18.6.3 to 19.1.0 ([3e283c5](https://github.com/expressots/expressots/commit/3e283c5bc40ebaf1e4528e07a01fb10e552b33ab))
10
+ * bump @release-it/conventional-changelog from 7.0.1 to 7.0.2 ([5916d10](https://github.com/expressots/expressots/commit/5916d108e878b4104fbbede6f873e8c5ec533d81))
11
+ * bump @types/express from 4.17.17 to 4.17.21 ([9d3ce90](https://github.com/expressots/expressots/commit/9d3ce906b23918183df2f237fd5f2954564290d3))
12
+ * bump @types/node from 20.4.9 to 20.12.2 ([b62d698](https://github.com/expressots/expressots/commit/b62d698156fee5811eaa4b76f19786b36f476a8f))
13
+ * bump @typescript-eslint/eslint-plugin from 6.6.0 to 6.21.0 ([f03e326](https://github.com/expressots/expressots/commit/f03e326106777964229ed3b9fef3008a30751101))
14
+ * bump eslint from 8.48.0 to 8.57.0 ([c58c68b](https://github.com/expressots/expressots/commit/c58c68bc82b055b3a459b745b2906485d7968923))
15
+ * bump eslint-config-prettier from 9.0.0 to 9.1.0 ([6003fd9](https://github.com/expressots/expressots/commit/6003fd9c43d3b108cf23c2d5e882e85f9a86adb3))
16
+ * bump inversify from 6.0.1 to 6.0.2 ([dffffdd](https://github.com/expressots/expressots/commit/dffffddbf01181da7b117ffd37cf04324e65ac89))
17
+ * bump reflect-metadata from 0.2.1 to 0.2.2 ([eb606cd](https://github.com/expressots/expressots/commit/eb606cdb28bad0a62b1e88a906fbbba297518120))
18
+ * bump release-it from 16.1.5 to 16.3.0 ([ac94b32](https://github.com/expressots/expressots/commit/ac94b3274c9e1c0b6ffd3813bb3853f9b6648312))
19
+ * bump typescript from 4.9.5 to 5.4.3 ([2f7d8a3](https://github.com/expressots/expressots/commit/2f7d8a3c8640e91034b92dfdfc133006ac777155))
20
+ * bump vite from 4.5.0 to 5.2.7 ([c53a852](https://github.com/expressots/expressots/commit/c53a852d7701b49464deb0a5499faa17396bd5fc))
21
+ * bump vitest and @vitest/coverage-v8 ([dd561f8](https://github.com/expressots/expressots/commit/dd561f8b1caf163e453347d46ca7d40529bcd833))
9
22
 
10
23
 
11
24
  ### Bug Fixes
12
25
 
13
- * change expressots version to latest ([d42f0c9](https://github.com/expressots/expressots/commit/d42f0c9987ffa7a8ecc213500e39364182ba800e))
14
- * lock lib ver, add tsconfig to package ([298201c](https://github.com/expressots/expressots/commit/298201c1442821cf63f7ed788d7f76a6a7fe79e0))
15
- * lock versions, update to es2021 ([1ca53ca](https://github.com/expressots/expressots/commit/1ca53ca8ad6e52aea136fe48a99aab389456de93))
16
- * remove the appcontainer return dictionary method ([3dddb86](https://github.com/expressots/expressots/commit/3dddb86bf35e08e42f43c960e796756f2b938805))
17
- * rename logger-service to logger.provider ([3344717](https://github.com/expressots/expressots/commit/33447175665ed36c3581143bc451bf27fb4b778b))
26
+ * update inversify, reflect-metadata and express version, remove vulnerabilites ([62a7e92](https://github.com/expressots/expressots/commit/62a7e923c40145bf9a8899007292c02035348dad))
27
+ * update typescript to 5.2.2 rm conflict on eslin-tstree ([26e160d](https://github.com/expressots/expressots/commit/26e160ddc37e35ce5ef80af62ddf539409ee8f1c))
18
28
 
19
29
 
20
30
  ### Code Refactoring
21
31
 
22
- * adjust core op template and add full example ([ca5a843](https://github.com/expressots/expressots/commit/ca5a8436ae5a2afb57f426f6dc8b8efa0050f6b1))
23
- * non opinionated templated structure change ([8caf0d1](https://github.com/expressots/expressots/commit/8caf0d12b3751c61dfa16bb4a70722c64763ffcd))
24
- * update eslint config inferrable types ([845101f](https://github.com/expressots/expressots/commit/845101fa6472ab4874a220ef63ea4e8296fbd7a6))
25
-
26
-
27
- ### Continuous Integrations
28
-
32
+ * separate template tests from core ([57e6a98](https://github.com/expressots/expressots/commit/57e6a9863cc4a27039a6ba5978d9eda678fc920c))
33
+ * update app provider opinionated template ([9e45fcd](https://github.com/expressots/expressots/commit/9e45fcd01c8351cc931522e18a30434294aae695))
34
+ * update express types ([6a546d2](https://github.com/expressots/expressots/commit/6a546d2b4a4d12c6f807591a71c33887acebd29c))
35
+ * update non opinionated template ([77dd2cc](https://github.com/expressots/expressots/commit/77dd2cc00cff014a006dc56b7fa6f76dce9be25b))
36
+ * update non opinionated template ([f9d3b16](https://github.com/expressots/expressots/commit/f9d3b169f7db2d09223f8e94d19e082b544e35c9))
37
+
38
+ ## [2.9.1](https://github.com/expressots/expressots/compare/2.9.0...2.9.1) (2024-03-29)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * add non opinionated scaffold schematics name change ([35cf0cb](https://github.com/expressots/expressots/commit/35cf0cb32c621d7b5112b0306b2001bb34c210ed))
44
+
45
+
46
+ ### Code Refactoring
47
+
48
+ * add expressots project commands ([523cf19](https://github.com/expressots/expressots/commit/523cf1908f3ba36377738082bf24783e45117626))
49
+ * adjust expressots build, dev, prod ([7be37a7](https://github.com/expressots/expressots/commit/7be37a7b8291ea88ab69ce72b4723780d278d405))
50
+
51
+ ## [2.9.0](https://github.com/expressots/expressots/compare/2.8.0...2.9.0) (2024-03-18)
52
+
53
+
54
+ ### Features
55
+
56
+ * add plugin pattern on provider manager ([f56d5b3](https://github.com/expressots/expressots/commit/f56d5b3a2ebdcca8e61e91e831ce43e6e2a90c57))
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * change expressots version to latest ([d42f0c9](https://github.com/expressots/expressots/commit/d42f0c9987ffa7a8ecc213500e39364182ba800e))
62
+ * lock lib ver, add tsconfig to package ([298201c](https://github.com/expressots/expressots/commit/298201c1442821cf63f7ed788d7f76a6a7fe79e0))
63
+ * lock versions, update to es2021 ([1ca53ca](https://github.com/expressots/expressots/commit/1ca53ca8ad6e52aea136fe48a99aab389456de93))
64
+ * remove the appcontainer return dictionary method ([3dddb86](https://github.com/expressots/expressots/commit/3dddb86bf35e08e42f43c960e796756f2b938805))
65
+ * rename logger-service to logger.provider ([3344717](https://github.com/expressots/expressots/commit/33447175665ed36c3581143bc451bf27fb4b778b))
66
+
67
+
68
+ ### Code Refactoring
69
+
70
+ * adjust core op template and add full example ([ca5a843](https://github.com/expressots/expressots/commit/ca5a8436ae5a2afb57f426f6dc8b8efa0050f6b1))
71
+ * non opinionated templated structure change ([8caf0d1](https://github.com/expressots/expressots/commit/8caf0d12b3751c61dfa16bb4a70722c64763ffcd))
72
+ * update eslint config inferrable types ([845101f](https://github.com/expressots/expressots/commit/845101fa6472ab4874a220ef63ea4e8296fbd7a6))
73
+
74
+
75
+ ### Continuous Integrations
76
+
29
77
  * add prepublish script ([7b1478e](https://github.com/expressots/expressots/commit/7b1478e7cf1ec44b63e9f1a99354e49cb4ddaa7d))
30
78
 
31
- ## [2.8.0](https://github.com/expressots/expressots/compare/2.7.0...2.8.0) (2024-3-5)
32
-
33
-
34
- ### Features
35
-
36
- * add middleware handler, config and expresso ([df60183](https://github.com/expressots/expressots/commit/df601837a771662723f25f185622de8c912f6721))
37
- * add provide annotation to abstract class ExpressMiddleware ([49e762e](https://github.com/expressots/expressots/commit/49e762e035053d67a977d54d9f448334e931134b))
38
- * Added it into options wiring ([58e58c1](https://github.com/expressots/expressots/commit/58e58c11693d8dfc8e235bbc5b8d62aa35493ec9))
39
- * Added multer middleware for expressots ([522db5d](https://github.com/expressots/expressots/commit/522db5d58dd4521fd03528cf4178cbbc951a0537))
40
- * bump @commitlint/cli from 17.8.1 to 18.0.0 ([4ddcbd4](https://github.com/expressots/expressots/commit/4ddcbd49ffe65cfa7a15b253515bb7f3446046ee))
41
- * bump @commitlint/config-conventional from 17.8.1 to 18.0.0 ([91e1237](https://github.com/expressots/expressots/commit/91e12370f9736188805df20d4f7da378720ac43b))
42
- * 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))
43
- * 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))
44
- * 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))
45
- * 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))
46
- * bump vite from 4.4.11 to 4.5.0 ([344161c](https://github.com/expressots/expressots/commit/344161cdf0cd7f54ffaa069023241aaea04d7c5d))
47
- * comments addressed ([8c3f55a](https://github.com/expressots/expressots/commit/8c3f55a901874c1e9c33d415157fa0a2beab9c56))
48
- * correct expresso middleware path ([0879c10](https://github.com/expressots/expressots/commit/0879c104810256f5143dcb2206579debaf0e6a97))
49
- * Include multer as resolver ([056d4d9](https://github.com/expressots/expressots/commit/056d4d99801f9f4af2932bcee333a1fa652b45a8))
50
- * remove getmiddleware pipeline from interface ([0577527](https://github.com/expressots/expressots/commit/057752754e257552eddebf031cf977f663b093ed))
51
- * Remove multer dependency / Added dynamic multer usage behavior ([6a4530b](https://github.com/expressots/expressots/commit/6a4530be243c961e5bfe50340d2c41742332e186))
52
- * Remove multer dependency with interface defined ([5a0acd2](https://github.com/expressots/expressots/commit/5a0acd228166efc2de8f4be7078c21ed6fd34634))
53
- * Remove multer dependency with interface defined ([8133621](https://github.com/expressots/expressots/commit/8133621108bb7f2017088d59ae6145da8606ebf7))
54
- * update reflect metadata on templates ([#152](https://github.com/expressots/expressots/issues/152)) ([75a3312](https://github.com/expressots/expressots/commit/75a33122e0f468b9e28040b8e7eb6747252e4c6b))
55
-
56
-
57
- ### Bug Fixes
58
-
59
- * interface types and middleware return multer ([b5223fd](https://github.com/expressots/expressots/commit/b5223fdc22eaaf1cb9b315b2aa77ad0e615e8ed3))
79
+ ## [2.8.0](https://github.com/expressots/expressots/compare/2.7.0...2.8.0) (2024-3-5)
80
+
81
+
82
+ ### Features
83
+
84
+ * add middleware handler, config and expresso ([df60183](https://github.com/expressots/expressots/commit/df601837a771662723f25f185622de8c912f6721))
85
+ * add provide annotation to abstract class ExpressMiddleware ([49e762e](https://github.com/expressots/expressots/commit/49e762e035053d67a977d54d9f448334e931134b))
86
+ * Added it into options wiring ([58e58c1](https://github.com/expressots/expressots/commit/58e58c11693d8dfc8e235bbc5b8d62aa35493ec9))
87
+ * Added multer middleware for expressots ([522db5d](https://github.com/expressots/expressots/commit/522db5d58dd4521fd03528cf4178cbbc951a0537))
88
+ * bump @commitlint/cli from 17.8.1 to 18.0.0 ([4ddcbd4](https://github.com/expressots/expressots/commit/4ddcbd49ffe65cfa7a15b253515bb7f3446046ee))
89
+ * bump @commitlint/config-conventional from 17.8.1 to 18.0.0 ([91e1237](https://github.com/expressots/expressots/commit/91e12370f9736188805df20d4f7da378720ac43b))
90
+ * 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))
91
+ * 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))
92
+ * 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))
93
+ * 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))
94
+ * bump vite from 4.4.11 to 4.5.0 ([344161c](https://github.com/expressots/expressots/commit/344161cdf0cd7f54ffaa069023241aaea04d7c5d))
95
+ * comments addressed ([8c3f55a](https://github.com/expressots/expressots/commit/8c3f55a901874c1e9c33d415157fa0a2beab9c56))
96
+ * correct expresso middleware path ([0879c10](https://github.com/expressots/expressots/commit/0879c104810256f5143dcb2206579debaf0e6a97))
97
+ * Include multer as resolver ([056d4d9](https://github.com/expressots/expressots/commit/056d4d99801f9f4af2932bcee333a1fa652b45a8))
98
+ * remove getmiddleware pipeline from interface ([0577527](https://github.com/expressots/expressots/commit/057752754e257552eddebf031cf977f663b093ed))
99
+ * Remove multer dependency / Added dynamic multer usage behavior ([6a4530b](https://github.com/expressots/expressots/commit/6a4530be243c961e5bfe50340d2c41742332e186))
100
+ * Remove multer dependency with interface defined ([5a0acd2](https://github.com/expressots/expressots/commit/5a0acd228166efc2de8f4be7078c21ed6fd34634))
101
+ * Remove multer dependency with interface defined ([8133621](https://github.com/expressots/expressots/commit/8133621108bb7f2017088d59ae6145da8606ebf7))
102
+ * update reflect metadata on templates ([#152](https://github.com/expressots/expressots/issues/152)) ([75a3312](https://github.com/expressots/expressots/commit/75a33122e0f468b9e28040b8e7eb6747252e4c6b))
103
+
104
+
105
+ ### Bug Fixes
106
+
107
+ * interface types and middleware return multer ([b5223fd](https://github.com/expressots/expressots/commit/b5223fdc22eaaf1cb9b315b2aa77ad0e615e8ed3))
60
108
  * remove codesee build ([#177](https://github.com/expressots/expressots/issues/177)) ([812e06d](https://github.com/expressots/expressots/commit/812e06da1b91cc7a4b0685ec70b0f0de1bd4517b))
61
109
 
62
- ## [2.7.0](https://github.com/expressots/expressots/compare/2.6.0...2.7.0) (2023-10-17)
63
-
64
-
65
- ### Features
66
-
67
- * add db in memory as provider ([b656f22](https://github.com/expressots/expressots/commit/b656f2297e0e985dd5184c611f795edddf6c5b2d))
68
- * modify IMemoryDB interface name ([fd1d440](https://github.com/expressots/expressots/commit/fd1d440eb947f377955bfc2a969d3e7ca4ffaa3e))
69
-
70
-
71
- ### Bug Fixes
72
-
73
- * remove db in memory from template opinionated ([0516c8c](https://github.com/expressots/expressots/commit/0516c8c4e9c0e1a4b8aae3fab5842136a0565a39))
74
-
75
-
76
- ### Tests
77
-
110
+ ## [2.7.0](https://github.com/expressots/expressots/compare/2.6.0...2.7.0) (2023-10-17)
111
+
112
+
113
+ ### Features
114
+
115
+ * add db in memory as provider ([b656f22](https://github.com/expressots/expressots/commit/b656f2297e0e985dd5184c611f795edddf6c5b2d))
116
+ * modify IMemoryDB interface name ([fd1d440](https://github.com/expressots/expressots/commit/fd1d440eb947f377955bfc2a969d3e7ca4ffaa3e))
117
+
118
+
119
+ ### Bug Fixes
120
+
121
+ * remove db in memory from template opinionated ([0516c8c](https://github.com/expressots/expressots/commit/0516c8c4e9c0e1a4b8aae3fab5842136a0565a39))
122
+
123
+
124
+ ### Tests
125
+
78
126
  * improve collocation and fix console tests ([52bdf98](https://github.com/expressots/expressots/commit/52bdf98cfcbbffc58841b1b67c6ce2a1f6fe308b))
79
127
 
80
- ## [2.6.0](https://github.com/expressots/expressots/compare/2.5.0...2.6.0) (2023-10-09)
81
-
82
-
83
- ### Features
84
-
85
- * Added express-session middleware for expressots ([9d0c79f](https://github.com/expressots/expressots/commit/9d0c79f7c4b18cfcac17443c7f76c4384a563471))
86
- * bump vite from 4.4.10 to 4.4.11 ([45c8a80](https://github.com/expressots/expressots/commit/45c8a804e85875743cc18d95ec5441e19b7df7d3))
87
-
88
-
89
- ### Bug Fixes
90
-
91
- * Auto setup husky with project setup and installation ([dcdc279](https://github.com/expressots/expressots/commit/dcdc279f9dffe82e739396df763f494c97a3e914))
92
- * remove prepare husky install from lib ([ba9b536](https://github.com/expressots/expressots/commit/ba9b5363904a7d8981ec49705d5fbf22e20c8dbd))
128
+ ## [2.6.0](https://github.com/expressots/expressots/compare/2.5.0...2.6.0) (2023-10-09)
129
+
130
+
131
+ ### Features
132
+
133
+ * Added express-session middleware for expressots ([9d0c79f](https://github.com/expressots/expressots/commit/9d0c79f7c4b18cfcac17443c7f76c4384a563471))
134
+ * bump vite from 4.4.10 to 4.4.11 ([45c8a80](https://github.com/expressots/expressots/commit/45c8a804e85875743cc18d95ec5441e19b7df7d3))
135
+
136
+
137
+ ### Bug Fixes
138
+
139
+ * Auto setup husky with project setup and installation ([dcdc279](https://github.com/expressots/expressots/commit/dcdc279f9dffe82e739396df763f494c97a3e914))
140
+ * remove prepare husky install from lib ([ba9b536](https://github.com/expressots/expressots/commit/ba9b5363904a7d8981ec49705d5fbf22e20c8dbd))
93
141
  * typo ([079aad6](https://github.com/expressots/expressots/commit/079aad6c125fcd100cde5cf98ce84125e7381879))
94
142
 
95
- ## [2.5.0](https://github.com/expressots/expressots/compare/2.4.0...2.5.0) (2023-10-04)
96
-
97
-
98
- ### Features
99
-
100
- * bump vite from 4.4.9 to 4.4.10 ([5be4adc](https://github.com/expressots/expressots/commit/5be4adc18d84c3affa57d248dd07801bda4dd5b9))
101
- * bump vitest from 0.34.5 to 0.34.6 ([11ca77f](https://github.com/expressots/expressots/commit/11ca77f29d19d1de05b2ae2a56b9e306311621bf))
102
- * **core:** add helmet middleware ([7648afb](https://github.com/expressots/expressots/commit/7648afb68054c1e69990f7d33efe35ec4d99b464)), closes [#107](https://github.com/expressots/expressots/issues/107)
103
-
104
-
105
- ### Bug Fixes
106
-
107
- * adjust interface, remove duplicated helmet registry ([376c065](https://github.com/expressots/expressots/commit/376c0654d655ee8d29c0649d83ec6fb7cf860791))
143
+ ## [2.5.0](https://github.com/expressots/expressots/compare/2.4.0...2.5.0) (2023-10-04)
144
+
145
+
146
+ ### Features
147
+
148
+ * bump vite from 4.4.9 to 4.4.10 ([5be4adc](https://github.com/expressots/expressots/commit/5be4adc18d84c3affa57d248dd07801bda4dd5b9))
149
+ * bump vitest from 0.34.5 to 0.34.6 ([11ca77f](https://github.com/expressots/expressots/commit/11ca77f29d19d1de05b2ae2a56b9e306311621bf))
150
+ * **core:** add helmet middleware ([7648afb](https://github.com/expressots/expressots/commit/7648afb68054c1e69990f7d33efe35ec4d99b464)), closes [#107](https://github.com/expressots/expressots/issues/107)
151
+
152
+
153
+ ### Bug Fixes
154
+
155
+ * adjust interface, remove duplicated helmet registry ([376c065](https://github.com/expressots/expressots/commit/376c0654d655ee8d29c0649d83ec6fb7cf860791))
108
156
  * remove duplicate optionslhelmet interface ([93bfdea](https://github.com/expressots/expressots/commit/93bfdea0057614b0a2e449817fb095ed23112011))
109
157
 
110
158
  ## [2.4.0](https://github.com/expressots/expressots/compare/2.3.0...2.4.0) (2023-10-01)
@@ -1,94 +1,93 @@
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
+ * Usage:
22
+ * const appContainer = new AppContainer(options);
23
+ * const container = appContainer.create(modules);
24
+ *
25
+ * @provide AppContainer
26
+ */
27
+ let AppContainer = class AppContainer {
28
+ /**
29
+ * Constructs the AppContainer instance.
30
+ * @param options - The options for creating the container. Can include custom default scope and skip base class checks setting.
31
+ */
32
+ constructor(options) {
33
+ this.options = {
34
+ defaultScope: inversify_1.BindingScopeEnum.Request,
35
+ ...options,
36
+ };
37
+ }
38
+ /**
39
+ * Creates and configures a new dependency injection container.
40
+ * @param modules - An array of ContainerModule instances to load into the container.
41
+ * @returns The configured dependency injection container.
42
+ */
43
+ create(modules) {
44
+ const containerOptions = {
45
+ autoBindInjectable: this.options.autoBindInjectable
46
+ ? this.options.autoBindInjectable
47
+ : true,
48
+ ...this.options,
49
+ };
50
+ this.container = new inversify_1.Container(containerOptions);
51
+ this.container.bind(inversify_1.Container).toConstantValue(this.container);
52
+ this.container.load((0, inversify_binding_decorators_1.buildProviderModule)(), ...modules);
53
+ return this.container;
54
+ }
55
+ /**
56
+ * Retrieves the binding dictionary of the container.
57
+ * @returns(void) Print table of the binding dictionary of the container.
58
+ */
59
+ viewContainerBindings() {
60
+ const dictionary = this.container["_bindingDictionary"]._map;
61
+ const entries = Array.from(dictionary.entries());
62
+ const table = entries
63
+ .map(([identifier, bindings]) => {
64
+ return bindings.map((binding) => ({
65
+ "Service Identifier": identifier,
66
+ Scope: binding.scope,
67
+ Type: binding.type,
68
+ Cache: binding.cache !== null ? "Yes" : "No",
69
+ }));
70
+ })
71
+ .flat();
72
+ console.table(table);
73
+ }
74
+ /**
75
+ * Retrieves the container options.
76
+ * @returns The container options.
77
+ */
78
+ getContainerOptions() {
79
+ return this.container.options;
80
+ }
81
+ /**
82
+ * Retrieves the container.
83
+ * @returns The container.
84
+ */
85
+ get Container() {
86
+ return this.container;
87
+ }
88
+ };
89
+ exports.AppContainer = AppContainer;
90
+ exports.AppContainer = AppContainer = __decorate([
91
+ (0, inversify_binding_decorators_1.provide)(AppContainer),
92
+ __metadata("design:paramtypes", [Object])
93
+ ], AppContainer);
@@ -1,74 +1,74 @@
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
+ 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,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 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; } });