@adaptivestone/framework 5.0.0-beta.4 → 5.0.0-beta.40

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 (298) hide show
  1. package/CHANGELOG.md +1107 -528
  2. package/LICENCE +1 -1
  3. package/dist/Cli.d.ts +7 -0
  4. package/dist/Cli.js +19 -0
  5. package/dist/Cli.js.map +1 -0
  6. package/dist/cluster.d.ts +1 -0
  7. package/dist/cluster.js +18 -0
  8. package/dist/cluster.js.map +1 -0
  9. package/dist/commands/CreateUser.d.ts +32 -0
  10. package/dist/commands/CreateUser.js +83 -0
  11. package/dist/commands/CreateUser.js.map +1 -0
  12. package/dist/commands/Documentation.d.ts +5 -0
  13. package/dist/commands/Documentation.js +15 -0
  14. package/dist/commands/Documentation.js.map +1 -0
  15. package/dist/commands/DropIndex.d.ts +16 -0
  16. package/dist/commands/DropIndex.js +30 -0
  17. package/dist/commands/DropIndex.js.map +1 -0
  18. package/dist/commands/GenerateRandomBytes.d.ts +7 -0
  19. package/dist/commands/GenerateRandomBytes.js +18 -0
  20. package/dist/commands/GenerateRandomBytes.js.map +1 -0
  21. package/dist/commands/GenerateTypes.d.ts +11 -0
  22. package/dist/commands/GenerateTypes.js +52 -0
  23. package/dist/commands/GenerateTypes.js.map +1 -0
  24. package/dist/commands/GetOpenApiJson.d.ts +17 -0
  25. package/dist/commands/GetOpenApiJson.js +272 -0
  26. package/dist/commands/GetOpenApiJson.js.map +1 -0
  27. package/dist/commands/SyncIndexes.d.ts +6 -0
  28. package/dist/commands/SyncIndexes.js +31 -0
  29. package/dist/commands/SyncIndexes.js.map +1 -0
  30. package/dist/commands/migration/Create.d.ts +18 -0
  31. package/dist/commands/migration/Create.js +57 -0
  32. package/dist/commands/migration/Create.js.map +1 -0
  33. package/dist/commands/migration/Migrate.d.ts +6 -0
  34. package/dist/commands/migration/Migrate.js +43 -0
  35. package/dist/commands/migration/Migrate.js.map +1 -0
  36. package/dist/config/auth.d.ts +6 -0
  37. package/dist/config/auth.js +7 -0
  38. package/dist/config/auth.js.map +1 -0
  39. package/dist/config/http.d.ts +8 -0
  40. package/dist/config/http.js +10 -0
  41. package/dist/config/http.js.map +1 -0
  42. package/dist/config/i18n.d.ts +13 -0
  43. package/dist/config/i18n.js +13 -0
  44. package/dist/config/i18n.js.map +1 -0
  45. package/dist/config/ipDetector.d.ts +5 -0
  46. package/dist/config/ipDetector.js +15 -0
  47. package/dist/config/ipDetector.js.map +1 -0
  48. package/dist/config/log.d.ts +11 -0
  49. package/dist/config/log.js +20 -0
  50. package/dist/config/log.js.map +1 -0
  51. package/dist/config/mongo.d.ts +4 -0
  52. package/dist/config/mongo.js +4 -0
  53. package/dist/config/mongo.js.map +1 -0
  54. package/dist/config/rateLimiter.d.ts +13 -0
  55. package/dist/config/rateLimiter.js +17 -0
  56. package/dist/config/rateLimiter.js.map +1 -0
  57. package/dist/config/redis.d.ts +5 -0
  58. package/dist/config/redis.js +5 -0
  59. package/dist/config/redis.js.map +1 -0
  60. package/dist/config/validate.d.ts +4 -0
  61. package/dist/config/validate.js +4 -0
  62. package/dist/config/validate.js.map +1 -0
  63. package/dist/controllers/Auth.d.ts +131 -0
  64. package/dist/controllers/Auth.js +186 -0
  65. package/dist/controllers/Auth.js.map +1 -0
  66. package/dist/controllers/Home.d.ts +15 -0
  67. package/dist/controllers/Home.js +22 -0
  68. package/dist/controllers/Home.js.map +1 -0
  69. package/dist/controllers/index.d.ts +16 -0
  70. package/dist/controllers/index.js +59 -0
  71. package/dist/controllers/index.js.map +1 -0
  72. package/dist/folderConfig.d.ts +34 -0
  73. package/dist/folderConfig.js +14 -0
  74. package/dist/folderConfig.js.map +1 -0
  75. package/dist/helpers/appInstance.d.ts +3 -0
  76. package/dist/helpers/appInstance.js +8 -0
  77. package/dist/helpers/appInstance.js.map +1 -0
  78. package/dist/helpers/crypto.d.ts +3 -0
  79. package/dist/helpers/crypto.js +17 -0
  80. package/dist/helpers/crypto.js.map +1 -0
  81. package/dist/helpers/files.d.ts +16 -0
  82. package/dist/helpers/files.js +76 -0
  83. package/dist/helpers/files.js.map +1 -0
  84. package/dist/helpers/logger.d.ts +4 -0
  85. package/dist/helpers/logger.js +20 -0
  86. package/dist/helpers/logger.js.map +1 -0
  87. package/dist/helpers/redis/clearNamespace.d.ts +2 -0
  88. package/dist/helpers/redis/clearNamespace.js +14 -0
  89. package/dist/helpers/redis/clearNamespace.js.map +1 -0
  90. package/dist/helpers/yup.d.ts +13 -0
  91. package/dist/helpers/yup.js +21 -0
  92. package/dist/helpers/yup.js.map +1 -0
  93. package/dist/index.d.ts +1 -0
  94. package/dist/index.js +7 -0
  95. package/dist/index.js.map +1 -0
  96. package/dist/models/Lock.d.ts +90 -0
  97. package/dist/models/Lock.js +97 -0
  98. package/dist/models/Lock.js.map +1 -0
  99. package/dist/models/Migration.d.ts +13 -0
  100. package/dist/models/Migration.js +14 -0
  101. package/dist/models/Migration.js.map +1 -0
  102. package/dist/models/Sequence.d.ts +28 -0
  103. package/dist/models/Sequence.js +19 -0
  104. package/dist/models/Sequence.js.map +1 -0
  105. package/dist/models/User.d.ts +656 -0
  106. package/dist/models/User.js +291 -0
  107. package/dist/models/User.js.map +1 -0
  108. package/dist/models/UserOld.d.ts +179 -0
  109. package/dist/models/UserOld.js +230 -0
  110. package/dist/models/UserOld.js.map +1 -0
  111. package/dist/modules/AbstractCommand.d.ts +51 -0
  112. package/dist/modules/AbstractCommand.js +60 -0
  113. package/dist/modules/AbstractCommand.js.map +1 -0
  114. package/dist/modules/AbstractConnector.d.ts +5 -0
  115. package/dist/modules/AbstractConnector.js +8 -0
  116. package/dist/modules/AbstractConnector.js.map +1 -0
  117. package/dist/modules/AbstractController.d.ts +94 -0
  118. package/dist/modules/AbstractController.js +323 -0
  119. package/dist/modules/AbstractController.js.map +1 -0
  120. package/dist/modules/AbstractModel.d.ts +29 -0
  121. package/dist/modules/AbstractModel.js +42 -0
  122. package/dist/modules/AbstractModel.js.map +1 -0
  123. package/dist/modules/Base.d.ts +29 -0
  124. package/dist/modules/Base.js +58 -0
  125. package/dist/modules/Base.js.map +1 -0
  126. package/dist/modules/BaseCli.d.ts +25 -0
  127. package/dist/modules/BaseCli.js +147 -0
  128. package/dist/modules/BaseCli.js.map +1 -0
  129. package/dist/modules/BaseModel.d.ts +55 -0
  130. package/dist/modules/BaseModel.js +37 -0
  131. package/dist/modules/BaseModel.js.map +1 -0
  132. package/dist/server.d.ts +123 -0
  133. package/dist/server.js +468 -0
  134. package/dist/server.js.map +1 -0
  135. package/dist/services/cache/Cache.d.ts +31 -0
  136. package/dist/services/cache/Cache.js +113 -0
  137. package/dist/services/cache/Cache.js.map +1 -0
  138. package/dist/services/documentation/DocumentationGenerator.d.ts +11 -0
  139. package/dist/services/documentation/DocumentationGenerator.js +130 -0
  140. package/dist/services/documentation/DocumentationGenerator.js.map +1 -0
  141. package/dist/services/http/HttpServer.d.ts +35 -0
  142. package/dist/services/http/HttpServer.js +70 -0
  143. package/dist/services/http/HttpServer.js.map +1 -0
  144. package/dist/services/http/middleware/AbstractMiddleware.d.ts +25 -0
  145. package/dist/services/http/middleware/AbstractMiddleware.js +41 -0
  146. package/dist/services/http/middleware/AbstractMiddleware.js.map +1 -0
  147. package/dist/services/http/middleware/Auth.d.ts +9 -0
  148. package/dist/services/http/middleware/Auth.js +18 -0
  149. package/dist/services/http/middleware/Auth.js.map +1 -0
  150. package/dist/services/http/middleware/Cors.d.ts +12 -0
  151. package/dist/services/http/middleware/Cors.js +36 -0
  152. package/dist/services/http/middleware/Cors.js.map +1 -0
  153. package/dist/services/http/middleware/GetUserByToken.d.ts +20 -0
  154. package/dist/services/http/middleware/GetUserByToken.js +39 -0
  155. package/dist/services/http/middleware/GetUserByToken.js.map +1 -0
  156. package/dist/services/http/middleware/I18n.d.ts +23 -0
  157. package/dist/services/http/middleware/I18n.js +61 -0
  158. package/dist/services/http/middleware/I18n.js.map +1 -0
  159. package/dist/services/http/middleware/IpDetector.d.ts +14 -0
  160. package/dist/services/http/middleware/IpDetector.js +55 -0
  161. package/dist/services/http/middleware/IpDetector.js.map +1 -0
  162. package/dist/services/http/middleware/Pagination.d.ts +27 -0
  163. package/dist/services/http/middleware/Pagination.js +46 -0
  164. package/dist/services/http/middleware/Pagination.js.map +1 -0
  165. package/dist/services/http/middleware/PrepareAppInfo.d.ts +8 -0
  166. package/dist/services/http/middleware/PrepareAppInfo.js +17 -0
  167. package/dist/services/http/middleware/PrepareAppInfo.js.map +1 -0
  168. package/dist/services/http/middleware/RateLimiter.d.ts +26 -0
  169. package/dist/services/http/middleware/RateLimiter.js +118 -0
  170. package/dist/services/http/middleware/RateLimiter.js.map +1 -0
  171. package/dist/services/http/middleware/RequestLogger.d.ts +8 -0
  172. package/dist/services/http/middleware/RequestLogger.js +18 -0
  173. package/dist/services/http/middleware/RequestLogger.js.map +1 -0
  174. package/dist/services/http/middleware/RequestParser.d.ts +8 -0
  175. package/dist/services/http/middleware/RequestParser.js +35 -0
  176. package/dist/services/http/middleware/RequestParser.js.map +1 -0
  177. package/dist/services/http/middleware/Role.d.ts +12 -0
  178. package/dist/services/http/middleware/Role.js +24 -0
  179. package/dist/services/http/middleware/Role.js.map +1 -0
  180. package/dist/services/i18n/I18n.d.ts +15 -0
  181. package/dist/services/i18n/I18n.js +58 -0
  182. package/dist/services/i18n/I18n.js.map +1 -0
  183. package/dist/services/logging/SentryTransport.d.ts +14 -0
  184. package/dist/services/logging/SentryTransport.js +57 -0
  185. package/dist/services/logging/SentryTransport.js.map +1 -0
  186. package/dist/services/validate/ValidateService.d.ts +31 -0
  187. package/dist/services/validate/ValidateService.js +95 -0
  188. package/dist/services/validate/ValidateService.js.map +1 -0
  189. package/dist/services/validate/drivers/AbstractValidator.d.ts +14 -0
  190. package/dist/services/validate/drivers/AbstractValidator.js +29 -0
  191. package/dist/services/validate/drivers/AbstractValidator.js.map +1 -0
  192. package/dist/services/validate/drivers/CustomValidator.d.ts +14 -0
  193. package/dist/services/validate/drivers/CustomValidator.js +48 -0
  194. package/dist/services/validate/drivers/CustomValidator.js.map +1 -0
  195. package/dist/services/validate/drivers/YupValidator.d.ts +13 -0
  196. package/dist/services/validate/drivers/YupValidator.js +86 -0
  197. package/dist/services/validate/drivers/YupValidator.js.map +1 -0
  198. package/dist/tests/frameworkVitestSetup.d.ts +1 -0
  199. package/dist/tests/frameworkVitestSetup.js +9 -0
  200. package/dist/tests/frameworkVitestSetup.js.map +1 -0
  201. package/dist/tests/globalSetupVitest.d.ts +3 -0
  202. package/dist/tests/globalSetupVitest.js +29 -0
  203. package/dist/tests/globalSetupVitest.js.map +1 -0
  204. package/dist/tests/setupVitest.d.ts +1 -0
  205. package/dist/tests/setupVitest.js +91 -0
  206. package/dist/tests/setupVitest.js.map +1 -0
  207. package/dist/tests/testHelpers.d.ts +340 -0
  208. package/dist/tests/testHelpers.js +48 -0
  209. package/dist/tests/testHelpers.js.map +1 -0
  210. package/package.json +45 -39
  211. package/Cli.js +0 -22
  212. package/cluster.js +0 -27
  213. package/commands/CreateUser.js +0 -75
  214. package/commands/Documentation.js +0 -17
  215. package/commands/DropIndex.js +0 -29
  216. package/commands/GenerateRandomBytes.js +0 -21
  217. package/commands/GetOpenApiJson.js +0 -325
  218. package/commands/SyncIndexes.js +0 -39
  219. package/commands/migration/Create.js +0 -61
  220. package/commands/migration/Migrate.js +0 -55
  221. package/config/auth.js +0 -9
  222. package/config/http.js +0 -9
  223. package/config/i18n.js +0 -12
  224. package/config/ipDetector.js +0 -14
  225. package/config/log.js +0 -22
  226. package/config/mail.js +0 -29
  227. package/config/mongo.js +0 -3
  228. package/config/rateLimiter.js +0 -16
  229. package/config/redis.js +0 -4
  230. package/config/validate.js +0 -3
  231. package/controllers/Auth.js +0 -210
  232. package/controllers/Home.js +0 -28
  233. package/controllers/index.js +0 -60
  234. package/folderConfig.js +0 -14
  235. package/helpers/files.js +0 -79
  236. package/helpers/logger.js +0 -17
  237. package/helpers/redis/clearNamespace.js +0 -14
  238. package/helpers/yup.js +0 -24
  239. package/index.js +0 -8
  240. package/jsconfig.json +0 -9
  241. package/locales/en/translation.json +0 -27
  242. package/locales/ru/translation.json +0 -27
  243. package/migrations/.gitkeep +0 -0
  244. package/models/Migration.js +0 -15
  245. package/models/Sequence.js +0 -22
  246. package/models/User.js +0 -263
  247. package/modules/AbstractCommand.js +0 -43
  248. package/modules/AbstractConnector.js +0 -9
  249. package/modules/AbstractController.js +0 -413
  250. package/modules/AbstractModel.d.ts +0 -48
  251. package/modules/AbstractModel.js +0 -92
  252. package/modules/Base.d.ts +0 -37
  253. package/modules/Base.js +0 -63
  254. package/modules/BaseCli.js +0 -97
  255. package/server.d.ts +0 -98
  256. package/server.js +0 -438
  257. package/services/cache/Cache.d.ts +0 -35
  258. package/services/cache/Cache.js +0 -124
  259. package/services/documentation/DocumentationGenerator.js +0 -169
  260. package/services/http/HttpServer.js +0 -96
  261. package/services/http/middleware/AbstractMiddleware.js +0 -51
  262. package/services/http/middleware/Auth.js +0 -20
  263. package/services/http/middleware/Cors.js +0 -46
  264. package/services/http/middleware/GetUserByToken.js +0 -47
  265. package/services/http/middleware/I18n.js +0 -117
  266. package/services/http/middleware/IpDetector.js +0 -59
  267. package/services/http/middleware/Pagination.js +0 -57
  268. package/services/http/middleware/PrepareAppInfo.js +0 -18
  269. package/services/http/middleware/RateLimiter.js +0 -134
  270. package/services/http/middleware/RequestLogger.js +0 -22
  271. package/services/http/middleware/RequestParser.js +0 -40
  272. package/services/http/middleware/Role.js +0 -29
  273. package/services/messaging/email/index.js +0 -217
  274. package/services/messaging/email/resources/.gitkeep +0 -1
  275. package/services/messaging/email/templates/emptyTemplate/html.pug +0 -9
  276. package/services/messaging/email/templates/emptyTemplate/subject.pug +0 -1
  277. package/services/messaging/email/templates/emptyTemplate/text.pug +0 -1
  278. package/services/messaging/email/templates/recovery/html.pug +0 -8
  279. package/services/messaging/email/templates/recovery/subject.pug +0 -2
  280. package/services/messaging/email/templates/recovery/text.pug +0 -3
  281. package/services/messaging/email/templates/verification/html.pug +0 -10
  282. package/services/messaging/email/templates/verification/subject.pug +0 -1
  283. package/services/messaging/email/templates/verification/text.pug +0 -1
  284. package/services/messaging/index.js +0 -3
  285. package/services/validate/ValidateService.js +0 -157
  286. package/services/validate/drivers/AbstractValidator.js +0 -37
  287. package/services/validate/drivers/CustomValidator.js +0 -51
  288. package/services/validate/drivers/YupValidator.js +0 -103
  289. package/tests/globalSetupVitest.js +0 -35
  290. package/tests/setup.js +0 -118
  291. package/tests/setupVitest.js +0 -109
  292. package/types/Expand.d.ts +0 -11
  293. package/types/TFoldersConfig.d.ts +0 -17
  294. package/views/404.pug +0 -3
  295. package/views/home.pug +0 -3
  296. package/views/layouts/base.pug +0 -39
  297. package/vitest.config.js +0 -16
  298. /package/{commands → dist/migrations}/.gitkeep +0 -0
package/CHANGELOG.md CHANGED
@@ -1,522 +1,980 @@
1
- ### 5.0.0-beta.4
1
+ # Changelog
2
2
 
3
- [NEW] on shutdown event now after timeout we are forcing to shutdown
3
+ All notable changes to this project will be documented in this file.
4
4
 
5
- ### 5.0.0-beta.2
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
7
 
7
- [UPDATE] update deps
8
- [NEW] add ability to skip mongo model init in CLI env
9
- [NEW] now each mongo connection on CLI have own name and inslude command name there too (getMongoConnectionName in command)
8
+ ## [5.0.0-next]
10
9
 
11
- ### 5.0.0-beta.1
10
+ This is a big release that contains a lot of new features and breaking changes.
11
+ Main feature of that release is full TypeScript support insluding mongoose models.
12
12
 
13
- [UPDATE] update deps
14
- [BREAKING] vitest v3 https://vitest.dev/guide/migration.html
13
+ ### New Features
15
14
 
16
- ### 5.0.0-alpha.26
15
+ - **[NEW]** Full TypeScript support, including Mongoose models.
16
+ - **[NEW]** New model type: `BaseModel`, simplifying work with TypeScript and based on statics.
17
+ - **[NEW]** `AppInstance` helper to access the app instance from anywhere without passing it.
18
+ - **[NEW]** `GenerateTypes` command added.
19
+ - **[NEW]** `Lock` model for working with locks via MongoDB.
20
+ - **[NEW]** `FrameworkFolder` folder added to the app for module usage.
21
+ - **[NEW]** Ability to skip Mongo model initialization in CLI environments.
22
+ - **[NEW]** Mongo connections in CLI now have unique names, including the command name.
23
+ - **[NEW]** On shutdown event, force shutdown after a timeout.
24
+ - **[NEW]** `GenerateRandomBytes` command added.
25
+ - **[NEW]** `IpDetector` middleware for detecting proxies and `X-Forwarded-For` headers.
26
+ - **[NEW]** Test helpers getTestServerURL and serverInstance.
27
+ - **[NEW]** Rate limiter middleware - add consumeResult function to allow user middleware as a regular rate limiter
28
+ - **[NEW]** Ip detector middleware - add getIpAdressFromIncomingMessage function to allow user middleware as a detector of id adresses without middleware
29
+ - **[NEW]** Introduce i18nService (ability to user i18n not only inside middleware)
17
30
 
18
- [UPDATE] update deps
19
- [UPDATE] new commands view in CLI
31
+ ### Breaking changes (please read carefully)
20
32
 
21
- ### 5.0.0-alpha.24
33
+ - **[BREAKING]** No more global variables for testing and default user will not be created by default
34
+ - **[BREAKING]** All models now should be extended from `BaseModel`. This is a potencial breaking change specially for `User` model.
35
+ - **[BREAKING]** Remove jest support for testing.
36
+ - **[BREAKING]** Move email module to separate package `@adaptivestone/framework-module-email`. Please use it if you want to send emails.
37
+ - **[BREAKING]** Remove `VIEWS` folders at all. Should not affect any user as this was not used internally.
38
+ - **[BREAKING]** Removed `noidemailer-sendmail-transport`. Not needed anymore and not recommended to use as well.
39
+ - **[BREAKING]** Remove `minimist` CLI parsing and replace it by `commandArguments` parser.
40
+ - **[BREAKING]** `vitest` v3 <https://vitest.dev/guide/migration.html>.
41
+ - **[BREAKING]** `i18next` v24 <https://www.i18next.com/misc/migration-guide#v23.x.x-to-v24.0.0>.
42
+ - **[BREAKING]** Possible breaking. Framework start using express 5 instead of express 4. Please follow express migration guide too <https://expressjs.com/en/guide/migrating-5.html>.
43
+ - **[BREAKING]** As part of express 5 migration `_` in rotes (middlewares) should have perameter. please replace `_` to `*splat`.
44
+ - **[BREAKING]** Default auth responce changed to be unified. `{token, user}` => `{data:{token, user}}`.
45
+ - **[BREAKING]** `RateLimiter` now need to have `IpDetector` middleware before.
46
+ - **[BREAKING]** Removing `staticFiles` middleware as it not used in projects anymore. Docs with nginx config will be provided.
47
+ - **[BREAKING]** Remove default `AUTH_SALT`. It should be provided on a app level now.
48
+ - **[BREAKING]** Minimum node version is 20.12 as for now (`process.loadEnvFile`).
49
+ - **[BREAKING]** ESM only. No more commonJS. That help to fix a lot of bugs with tests and provides better development expirience.
50
+ - **[BREAKING]** Mongoose v8. <https://mongoosejs.com/docs/migrating_to_8.html>.
51
+ - **[BREAKING]** Vitest v4 <https://vitest.dev/guide/migration.html#vitest-4>
22
52
 
23
- [UPDATE] update deps
24
- [BREAKING] i18next v24 https://www.i18next.com/misc/migration-guide#v23.x.x-to-v24.0.0
53
+ ---
54
+ ## [5.0.0-beta.40]
25
55
 
26
- ### 5.0.0-alpha.23
56
+ - **[UPDATE]** Update `rate-limiter-flexible` to v9.
57
+ - **[UPDATE]** Remove 'winston-transport-sentry' and implementcustom logic based on 'sentry' itself (from v9.14 sentry have natove winston support)
27
58
 
28
- [UPDATE] update deps
29
59
 
30
- ### 5.0.0-alpha.22
60
+ ## [5.0.0-beta.39]
31
61
 
32
- [UPDATE] update deps
33
- [FIX] fix optional routing parameters
62
+ - **[UPDATE]** rete limiter. Do not create index on mongo if we have "process.env.test === 'true'"
34
63
 
35
- ### 5.0.0-alpha.21
64
+ ---
36
65
 
37
- [BREAKING] possible breaking. Framework start using express 5 instead of express 4. Please follow express migration guide too https://expressjs.com/en/guide/migrating-5.html.
38
- [BREAKING] AS part of express 5 migration _ in rotes (middlewares) should have perameter. please replace _ to \*splat
39
- [UPDATE] update deps
40
- [UPDATE] Mailer uses await import() for startup speedup
66
+ ## [5.0.0-beta.38]
41
67
 
42
- ### 5.0.0-alpha.20
68
+ - **[UPDATE]** update dependencies
69
+ - **[UPDATE]** update rate limiter Mongo option to not create an index by default when NODE_ENV=test
70
+ - **[UPDATE]** the default User model now uses roles and permissions with the String type (previously was any, for historical reasons). To avoid changes on Mongoose 8.19 as it affects User model https://github.com/Automattic/mongoose/issues/15699
71
+ - **[BREAKING]** Vitest v4 <https://vitest.dev/guide/migration.html#vitest-4>
43
72
 
44
- [UPDATE] update deps
45
- [UPDATE] #realLogger do not throw error in a scecific cases (model toJSON({virtual:true}))
73
+ ---
46
74
 
47
- ### 5.0.0-alpha.19
75
+ ## [5.0.0-beta.36]
48
76
 
49
- [NEW] added modelSchemaOptions for models
77
+ - **[UPDATE]** i18nService update loading to avoid race conditions
78
+ ---
50
79
 
51
- ### 5.0.0-alpha.18
80
+ ## [5.0.0-beta.36]
52
81
 
53
- [BREAKING] default auth responce changed to be unified. {token, user} = > {data:{token, user}}
54
- [UPDATE] RateLimiter updae key generation
82
+ - **[UPDATE]** i18nService update method names
55
83
 
56
- ### 5.0.0-alpha.17
84
+ ---
57
85
 
58
- [NEW] generateRandomBytes command
59
- [UPDATE] update deps
86
+ ## [5.0.0-beta.35]
60
87
 
61
- ### 5.0.0-alpha.16
88
+ - **[NEW]** Introduce i18nService (ability to user i18n not only inside middleware)
62
89
 
63
- [UPDATE] no warning of direct usage body and query
64
- [UPDATE] update deps
90
+ ---
65
91
 
66
- ### 5.0.0-alpha.15
92
+ ## [5.0.0-beta.34]
67
93
 
68
- [BUG] fix bug with pagination
69
- [UPDATE] update deps
94
+ - **[NEW]** I18nMiddlewareAppInfo type
70
95
 
71
- ### 5.0.0-alpha.14
96
+ ---
72
97
 
73
- [NEW] add types for Abstract model (wip)
98
+ ## [5.0.0-beta.33]
74
99
 
75
- ### 5.0.0-alpha.13
100
+ - **[NEW]** consumeResult changed to be more flexible
76
101
 
77
- [UPDATE] update deps
78
- [UPDATE] update i18n internal implementation
79
- [CHANGE] disable https server view
102
+ ---
80
103
 
81
- ### 5.0.0-alpha.12
104
+ ## [5.0.0-beta.32]
82
105
 
83
- [UPDATE] update deps
106
+ - **[NEW]** Ip detector middleware - add getIpAdressFromIncomingMessage function to allow user middleware as a detector of id adresses without middleware
84
107
 
85
- ### 5.0.0-alpha.11
108
+ ---
86
109
 
87
- [UPDATE] update deps
110
+ ## [5.0.0-beta.31]
88
111
 
89
- ### 5.0.0-alpha.10
112
+ - **[NEW]** Rate limiter middleware - add consumeResult function to allow user middleware as a regular rate limiter
90
113
 
91
- [UPDATE] update deps
92
- [NEW] IpDetector middleware that support detecting proxy and X-Forwarded-For header
93
- [BREAKING] RateLimiter now need to have IpDetector middleware before
94
114
 
95
- ### 5.0.0-alpha.9
115
+ ---
96
116
 
97
- [UPDATE] update deps
98
- [BREAKING] removing staticFiles middleware as it not used in projects anymore. Docs with nginx config will be provided
99
- [BREAKING] remove default AUTH_SALT. It should be provided on a app level now
100
- [BREAKING] Vitest 2.0.0 https://vitest.dev/guide/migration.html#migrating-to-vitest-2-0
117
+ ## [5.0.0-beta.30]
101
118
 
102
- ### 5.0.0-alpha.8
119
+ - **[FIX]** Fix CLI mongo app name generation (64 symbols limit)
103
120
 
104
- [UPDATE] replace dotenv with loadEnvFile
105
- [UPDATE] replace nodemon with node --watch (dev only)
106
- [BREAKING] Minimum node version is 20.12 as for now (process.loadEnvFile)
107
121
 
108
- ### 5.0.0-alpha.7
122
+ ---
109
123
 
110
- [UPDATE] deps update
124
+ ## [5.0.0-beta.29]
111
125
 
112
- ### 5.0.0-alpha.6
126
+ - **[FIX]** Fix CLI mongo app name generation (128 symbols limit)
113
127
 
114
- [UPDATE] Update internal documentation (jsdoc, d.ts)
128
+ ---
115
129
 
116
- ### 5.0.0-alpha.5
130
+ ## [5.0.0-beta.28]
117
131
 
118
- [UPDATE] More verbose errors for rapsing body request.
119
- [UPDATE] deps update
132
+ - **[UPDATE]** Inside CLI allow to have a negative values
133
+ - **[UPDATE]** Update deps.
120
134
 
121
- ### 5.0.0-alpha.4
135
+ ---
122
136
 
123
- [UPDATE] Update rate-limiter-flexible to v5
124
- [CHANGE] Cache update redis.setEX to redis.set(..,..,{EX:xx}) as setEX deprecated
137
+ ## [5.0.0-beta.27]
125
138
 
126
- ### 5.0.0-alpha.3
139
+ - **[UPDATE]** Remove eslint, prettiver and move to biome
140
+ - **[UPDATE]** Update types.
141
+ - **[UPDATE]** Update deps.
127
142
 
128
- [UPDATE] deps update
129
- [FIX] Migration commands apply
130
143
 
131
- ### 5.0.0-alpha.2
144
+ ---
132
145
 
133
- [UPDATE] deps update
146
+ ## [5.0.0-beta.26]
134
147
 
135
- ### 5.0.0-alpha.1
148
+ - **[UPDATE]** Update types.
149
+ - **[UPDATE]** Update tests (more ts).
136
150
 
137
- [BREAKING] Vitest 1.0.0 https://vitest.dev/guide/migration.html#migrating-from-vitest-0-34-6
138
- [BREAKING] ESM only. No more commonJS. That help to fix a lot of bugs with tests and provides better development expirience
139
- [BREAKING] Mongoose v8. https://mongoosejs.com/docs/migrating_to_8.html
151
+ ---
140
152
 
141
- ### 4.11.4
153
+ ## [5.0.0-beta.25]
142
154
 
143
- [UPDATE] deps update
155
+ - **[UPDATE]** Update types.
144
156
 
145
- ### 4.11.3
157
+ ---
146
158
 
147
- [UPDATE] deps update
159
+ ## [5.0.0-beta.24]
148
160
 
149
- ### 4.11.2
161
+ - **[UPDATE]** Update types.
150
162
 
151
- [FIX] Cors middleware return proper headers on multidomains
163
+ ---
152
164
 
153
- ### 4.11.1
165
+ ## [5.0.0-beta.23]
154
166
 
155
- [FIX] Cors middleware return proper status
167
+ - **[BREAKING]** No more global variables for testing and default user will not be created by default
168
+ - **[NEW]** Test helpers getTestServerURL, serverInstance, setDefaultUser, setDefaultAuthToken and createDefaultTestUser.
156
169
 
157
- ### 4.11.0
170
+ ---
158
171
 
159
- [NEW] Cors middleware
160
- [BREAKING] This is a potencial breaking change as we switched from cors external package to internal middleware. From API nothing was changed. This is a potencial breaking changes, but it should keep working as it
172
+ ## [5.0.0-beta.22]
161
173
 
162
- ### 4.10.0
174
+ - **[UPDATE]** Update types.
163
175
 
164
- [UPDATE] deps update
165
- [NEW] Static file middleware
166
- [BREAKING] This is a potencial breaking change as we switched from express.static to internal middleware that provide less features but faster. From API nothing was changed
176
+ ---
167
177
 
168
- ### 4.9.2
178
+ ## [5.0.0-beta.21]
169
179
 
170
- [UPDATE] deps update
180
+ - **[FIX]** Fix bug with missed model options.
171
181
 
172
- ### 4.9.1
182
+ ---
173
183
 
174
- [UPDATE] all responces from framework now happens in JSON. Previouls sometime aswers was in plan text
184
+ ## [5.0.0-beta.20]
175
185
 
176
- ### 4.9.0
186
+ - **[FIX]** Fix bug with `Lock` model index.
187
+ - **[NEW]** `BaseModel` add `Virtuals`.
177
188
 
178
- [BREAKING] We are separated testsing to setyp and global setup. Global setup now care of mongo to make sure that only on mongodb memoery server is spinned up. If you are using vitest please add "globalSetup: node_modules/@adaptivestone/framework/tests/globalSetupVitest" to your vitest config
189
+ ---
179
190
 
180
- ### 4.8.3
191
+ ## [5.0.0-beta.19]
181
192
 
182
- [UPDATE] Fix problme with fat start and closing connections after
193
+ - **[NEW]** Introducing new model type. `BaseModel`. Features - simplifie works with typescript. And based on statics.
194
+ - **[BREAKING]** All models now should be extended from `BaseModel`. This is a potencial breaking change specially for `User` model.
183
195
 
184
- ### 4.8.2
196
+ ---
185
197
 
186
- [UPDATE] CLI - disable mongoose index creation
198
+ ## [5.0.0-beta.18]
187
199
 
188
- ### 4.8.1
200
+ - **[UPDATE]** Move away connection from `mongooseModels` to server itself (preparation for different model types).
201
+ - **[BREAKING]** Potencial. We are removed callback from `mongooseModels` contrctuctor. It was not used in code.
202
+ - **[NEW]** Add `appInstance` helper to access app instance from anywhere without passing it.
189
203
 
190
- [UPDATE] Model inited on server inited.
191
- [NEW] New options to skip model init isSkipModelInit
192
- [NEW] New method server method initAllModels()
204
+ ---
193
205
 
194
- ### 4.8.0
206
+ ## [5.0.0-beta.17]
195
207
 
196
- [BREAKING] Minimum node js version id 18.17.0 now.
197
- [BREAKING] Removed getFileWithExtendingInhirence. This was internal method and not suppose to use externally
198
- [UPDATE] update Base getFilesPathWithInheritance to use fs.read dir resursive option
199
- [UPDATE] update cache (refactor+tets)
200
- [UPDATE] update config and model inits
208
+ - **[NEW]** Add `GenerateTypes` command.
201
209
 
202
- ### 4.7.0
210
+ ---
203
211
 
204
- [UPDATE] update logger init (refactor)
205
- [UPDATE] updated deps
212
+ ## [5.0.0-beta.16]
206
213
 
207
- ### 4.6.0
214
+ - **[UPDATE]** Update deps.
215
+ - **[UPDATE]** New app getter `internalFilesCache`.
216
+ - **[UPDATE]** Command new static props to load `isShouldGetModelPaths`.
208
217
 
209
- [NEW] migrated from JEST to vitest
218
+ ---
210
219
 
211
- ### 4.5.0
220
+ ## [5.0.0-beta.15]
212
221
 
213
- [NEW] Now getSuper() available as a method on mongoose models
214
- [UPDATE] Update rate-limiter-flexible to v3
215
- [UPDATE] Update test runner to suport ESM. In case problem with test please copy babel.config.js from framework to your project directory
222
+ - **[FIX]** Fix missing folder `migrations` in `dist` folder (hope that will be finally).
216
223
 
217
- ### 4.4.0
224
+ ---
218
225
 
219
- [NEW] New method to grab url of server it testing enviroument global.server.testingGetUrl("/some/endpoint")
226
+ ## [5.0.0-beta.14]
220
227
 
221
- ### 4.3.1
228
+ - **[FIX]** Fix missing folder `migrations` in `dist` folder.
222
229
 
223
- [UPDATE] Yup file validator update. As formidable now return all fields as an array
230
+ ---
224
231
 
225
- ### 4.3.0
232
+ ## [5.0.0-beta.13]
226
233
 
227
- [BREAKING] updated formidable with a new version + tests. Marked as breaking because of a new major version, but this is internal of framework and exernal still the same. Should break nothing
234
+ - **[UPDATE]** Only process `.ts` or `.js` files (not `.map` files).
228
235
 
229
- ### 4.2.0
236
+ ---
230
237
 
231
- [UPDATE] updated deps
232
- [NEW] CreateUser cli command. Ability to update user by email or id.
238
+ ## [5.0.0-beta.12]
233
239
 
234
- ### 4.1.0
240
+ - **[BREAKING]** Remove jest support for testing.
241
+ - **[NEW]** Initial move to typescript. Potencially breaking.
242
+ - **[NEW]** Introduce `src` and `dist` folders.
235
243
 
236
- [UPDATE] updated deps
237
- [NEW] email - Ability to render templae to string for future usage
244
+ ---
238
245
 
239
- ### 4.0.0
246
+ ## [5.0.0-beta.11]
240
247
 
241
- [BREAKING] change bcrypt encryption with scrypt
242
- [BREAKING] change internal express parser to formidable parser. Affect you if external formidable is used
243
- [BREAKING] should not affect any user. Changed email-templates module to internal implementation. Idea to keep dependensy list smaller
244
- [BREAKING] change i18n middleware to internal one. Nothing should be affected
245
- [BREAKING] now validation of request splitted between request and query
246
- [BREAKING] supportedLngs option added to i18n config
247
- [BREAKING] email inliner now looking for src/services/messaging/email/resources folder instead of 'build' folder.
248
+ - **[NEW]** Commands typing.
249
+ - **[NEW]** Commands support TS files.
250
+ - **[UPDATE]** Update deps.
248
251
 
249
- [BREAKING] Mongoose v7. https://mongoosejs.com/docs/migrating_to_7.html
250
- [BREAKING] Yup validation was updated to v1 https://github.com/jquense/yup/issues/1906
252
+ ---
251
253
 
252
- [DEPRECATED] getExpress path is deprecated. Renamed to getHttpPath
254
+ ## [5.0.0-beta.9]
253
255
 
254
- [NEW] pagination middleware
255
- [NEW] requestLogger middleware. Migrated from core server to be an middleware
256
- [NEW] CreateUser command
257
- [NEW] custom yup validator for validate File requests
258
- [UPDATE] updated deps
259
- [UPDATE] openApi generator support files
260
- [UPDATE] updated 18n middleware. Introduced internal cachce. Speed up of request processing up to 100%
261
- [UPDATE] cache drivers to JSON support BigInt numbers
256
+ - **[BREAKING]** Move email module to separate package `@adaptivestone/framework-module-email`. Please use it if you want to send emails.
257
+ - **[NEW]** App now contains `frameworkFolder` folder the framework located. Mostly for modules usage.
258
+ - **[BREAKING]** Remove `VIEWS` folders at all. Should not afffect any user as this was not used internally.
259
+ - **[UPDATE]** Update typing.
260
+ - **[UPDATE]** Change `redis` -> `@redis/client` as we are using only client from pakage.
261
+ - **[BREAKING]** Removed `noidemailer-sendmail-transport`. Not needed anymore and not recommended to use as well.
262
262
 
263
- ### 3.4.3
263
+ ---
264
264
 
265
- [UPDATE] updated deps
266
- [FIX] fix tests for redis
267
- [FIX] support in tests TEST_FOLDER_EMAILS
265
+ ## [5.0.0-beta.8]
268
266
 
269
- ### 3.4.2
267
+ - **[UPDATE]** Update deps.
268
+ - **[NEW]** `Lock` model for working locks via mongoDB.
270
269
 
271
- [UPDATE] updated deps
272
- [FIX] fix documentation generation
270
+ ---
273
271
 
274
- ### 3.4.1
272
+ ## [5.0.0-beta.7]
275
273
 
276
- [FIX] fix documentation generation
274
+ - **[UPDATE]** Update deps.
275
+ - **[UPDATE]** Change `vitest` shutdown behavior as mongo driver v6.13 change befaviur that affect us (`MongoClient.close` now closes any outstanding cursors).
277
276
 
278
- ### 3.4.0
277
+ ---
279
278
 
280
- [NEW] now we pass 'req' to validation and casting as a second parameter. This done mostly for custom validators
279
+ ## [5.0.0-beta.5]
281
280
 
282
- ### 3.3.0
281
+ - **[BREAKING]** Remove `minimist` CLI parsing and replace it by `commandArguments` parser.
282
+ - **[UPDATE]** Migrated from `eslint-plugin-import` to `eslint-plugin-import-x`.
283
+ - **[UPDATE]** Migrate to eslint 9 and away from aibnb styles (they are abonded).
283
284
 
284
- [NEW] new command 'SyncIndexes' to sync indexes for mongodb https://framework.adaptivestone.com/docs/cli#syncindexes
285
- [UPDATE] updated deps
286
- [FIX] fix documentation generation
285
+ ---
287
286
 
288
- ### 3.2.2
287
+ ## [5.0.0-beta.4]
289
288
 
290
- [UPDATE] add options for i18n to config.
291
- [CHANGE] by default i18n not writing missed keys. Can be enabled via config
289
+ - **[NEW]** On shutdown event now after timeout we are forcing to shutdown.
292
290
 
293
- ### 3.2.1
291
+ ---
294
292
 
295
- [UPDATE] updated deps
296
- [FIX] fix documentation generation
293
+ ## [5.0.0-beta.2]
297
294
 
298
- ### 3.2.0
295
+ - **[UPDATE]** Update deps.
296
+ - **[NEW]** Add ability to skip mongo model init in CLI env.
297
+ - **[NEW]** Now each mongo connection on CLI have own name and inslude command name there too (`getMongoConnectionName` in command).
299
298
 
300
- [UPDATE] updated deps
301
- [NEW] cache.removeKey(key) - function to remove key from cache
299
+ ---
302
300
 
303
- ### 3.1.1
301
+ ## [5.0.0-beta.1]
304
302
 
305
- [UPDATE] updated deps
306
- [FIX] fix cache error handling.
303
+ - **[UPDATE]** Update deps.
304
+ - **[BREAKING]** `vitest` v3 <https://vitest.dev/guide/migration.html>.
307
305
 
308
- ### 3.1.0
306
+ ---
309
307
 
310
- [NEW] new comand to generate open API documentation (wip)
311
- [NEW] coverage report
312
- [UPDATE] updated deps
308
+ ## [5.0.0-alpha.26]
313
309
 
314
- ### 3.0.23
310
+ - **[UPDATE]** Update deps.
311
+ - **[UPDATE]** New commands view in CLI.
315
312
 
316
- [UPDATE] updated deps
317
- [FIX] fix custom errors
313
+ ---
318
314
 
319
- ### 3.0.22
315
+ ## [5.0.0-alpha.24]
320
316
 
321
- [UPDATE] updated deps
322
- [UPDATE] cast function now can be ASYNC too
317
+ - **[UPDATE]** Update deps.
318
+ - **[BREAKING]** `i18next` v24 <https://www.i18next.com/misc/migration-guide#v23.x.x-to-v24.0.0>.
323
319
 
324
- ### 3.0.21
320
+ ---
325
321
 
326
- [UPDATE] updated redis to v4
327
- [NEW] updates tests to have own namespace on redis
322
+ ## [5.0.0-alpha.23]
328
323
 
329
- ### 3.0.20
324
+ - **[UPDATE]** Update deps.
330
325
 
331
- [UPDATE] update deps
326
+ ---
332
327
 
333
- ### 3.0.19
328
+ ## [5.0.0-alpha.22]
334
329
 
335
- [UPDATE] update deps
330
+ - **[UPDATE]** Update deps.
331
+ - **[FIX]** Fix optional routing parameters.
336
332
 
337
- ### 3.0.18
333
+ ---
338
334
 
339
- [UPDATE] update deps
340
- [UPDATE] change default branch to 'main'
335
+ ## [5.0.0-alpha.21]
341
336
 
342
- ### 3.0.17
337
+ - **[BREAKING]** Possible breaking. Framework start using express 5 instead of express 4. Please follow express migration guide too <https://expressjs.com/en/guide/migrating-5.html>.
338
+ - **[BREAKING]** As part of express 5 migration `_` in rotes (middlewares) should have perameter. please replace `_` to `*splat`.
339
+ - **[UPDATE]** Update deps.
340
+ - **[UPDATE]** Mailer uses `await import()` for startup speedup.
343
341
 
344
- [UPDATE] update deps
342
+ ---
345
343
 
346
- ### 3.0.16
344
+ ## [5.0.0-alpha.20]
347
345
 
348
- [UPDATE] update deps
349
- [FIX] fix bug with route level middleware
346
+ - **[UPDATE]** Update deps.
347
+ - **[UPDATE]** `#realLogger` do not throw error in a scecific cases (`model.toJSON({virtual:true})`).
350
348
 
351
- ### 3.0.15
349
+ ---
352
350
 
353
- [UPDATE] update deps
354
- [UPDATE] minimum node version 16
351
+ ## [5.0.0-alpha.19]
355
352
 
356
- ### 3.0.14
353
+ - **[NEW]** Added `modelSchemaOptions` for models.
357
354
 
358
- [NEW] now possible to show all errors during validation (default one) by parameter controllerValidationAbortEarly
359
- [UPDATE] update deps
355
+ ---
360
356
 
361
- ### 3.0.13
357
+ ## [5.0.0-alpha.18]
362
358
 
363
- [UPDATE] bug fix with "mergeParams"
359
+ - **[BREAKING]** Default auth responce changed to be unified. `{token, user}` => `{data:{token, user}}`.
360
+ - **[UPDATE]** `RateLimiter` updae key generation.
364
361
 
365
- ### 3.0.12
362
+ ---
366
363
 
367
- [NEW] ability to pass "mergeParams" options to express router
368
- [UPDATE] update deps
364
+ ## [5.0.0-alpha.17]
369
365
 
370
- ### 3.0.11
366
+ - **[NEW]** `generateRandomBytes` command.
367
+ - **[UPDATE]** Update deps.
371
368
 
372
- [UPDATE] more verbose email error
369
+ ---
373
370
 
374
- ### 3.0.10
371
+ ## [5.0.0-alpha.16]
375
372
 
376
- [UPDATE] update deps
377
- [CHANGE] tests afterAll not using timeout anymore (conflict with jest 28-alpha)
378
- [NEW] config for mail now supports "EMAIL_TRANSPORT" env variable. SMTP by default (as was)
373
+ - **[UPDATE]** No warning of direct usage `body` and `query`.
374
+ - **[UPDATE]** Update deps.
379
375
 
380
- ### 3.0.9
376
+ ---
381
377
 
382
- [UPDATE] update deps
378
+ ## [5.0.0-alpha.15]
383
379
 
384
- ### 3.0.8
380
+ - **[BUG]** Fix bug with pagination.
381
+ - **[UPDATE]** Update deps.
385
382
 
386
- [UPDATE] update deps
383
+ ---
387
384
 
388
- ### 3.0.7
385
+ ## [5.0.0-alpha.14]
389
386
 
390
- [UPDATE] update deps
391
- [CHANGE] change default getConfig method
387
+ - **[NEW]** Add types for `Abstract` model (wip).
392
388
 
393
- ### 3.0.6
389
+ ---
394
390
 
395
- [UPDATE] update deps
391
+ ## [5.0.0-alpha.13]
396
392
 
397
- ### 3.0.5
393
+ - **[UPDATE]** Update deps.
394
+ - **[UPDATE]** Update `i18n` internal implementation.
395
+ - **[CHANGE]** Disable https server view.
398
396
 
399
- [UPDATE] update deps
397
+ ---
400
398
 
401
- ### 3.0.4
399
+ ## [5.0.0-alpha.12]
402
400
 
403
- [UPDATE] fix bug with app shutdown
401
+ - **[UPDATE]** Update deps.
404
402
 
405
- ### 3.0.3
403
+ ---
406
404
 
407
- [UPDATE] update deps
405
+ ## [5.0.0-alpha.11]
408
406
 
409
- ### 3.0.2
407
+ - **[UPDATE]** Update deps.
410
408
 
411
- [UPDATE] update deps
409
+ ---
412
410
 
413
- ### 3.0.1
411
+ ## [5.0.0-alpha.10]
414
412
 
415
- [UPDATE] update deps
416
- [UPDATE] getUserByTokens more logs
413
+ - **[UPDATE]** Update deps.
414
+ - **[NEW]** `IpDetector` middleware that support detecting proxy and `X-Forwarded-For` header.
415
+ - **[BREAKING]** `RateLimiter` now need to have `IpDetector` middleware before.
417
416
 
418
- ### 3.0.0
417
+ ---
419
418
 
420
- [BREAKING] Mongoose v6. Than a lot of changes:[mongoDB drive changes](https://github.com/mongodb/node-mongodb-native/blob/4.0/docs/CHANGES_4.0.0.md), [Mongoose changes](https://mongoosejs.com/docs/migrating_to_6.html).
421
- Notable changes from migration
422
- Removed `execPopulate()`[link](https://mongoosejs.com/docs/migrating_to_6.html#removed-execpopulate)
419
+ ## [5.0.0-alpha.9]
423
420
 
424
- ```js
425
- // Document#populate() now returns a promise and is now no longer chainable.
421
+ - **[UPDATE]** Update deps.
422
+ - **[BREAKING]** Removing `staticFiles` middleware as it not used in projects anymore. Docs with nginx config will be provided.
423
+ - **[BREAKING]** Remove default `AUTH_SALT`. It should be provided on a app level now.
424
+ - **[BREAKING]** Vitest 2.0.0 <https://vitest.dev/guide/migration.html#migrating-to-vitest-2-0>.
426
425
 
427
- //Replace
428
- await doc.populate('path1').populate('path2').execPopulate();
429
- // with
430
- await doc.populate(['path1', 'path2']);
431
- //Replace
432
- await doc
433
- .populate('path1', 'select1')
434
- .populate('path2', 'select2')
435
- .execPopulate();
436
- // with
437
- await doc.populate([
438
- { path: 'path1', select: 'select1' },
439
- { path: 'path2', select: 'select2' },
440
- ]);
441
- ```
426
+ ---
442
427
 
443
- [REMOVED] removed deprecated router handler string not allowed anymore. Use functions by itself
444
- [REMOVED] removed deprecated someSecretSalt() on user model (use this.saltSecret instead)
445
- [REMOVED] removed deprecated validate() on abstract controller and as result validator dependency. Use request validators instead
446
- [REMOVED] removed deprecated isUseControllerNameForRouting() on abstract controller. Use getExpressPath() instead
447
- [REMOVED] removed deprecated Base.loadFilesWithInheritance please use getFilesPathWithInheritance that produce almost the same output
448
- [BREAKING] Removed "success" field on Auth contreoller. Please use http status instead
449
- [BREAKING] Auth controller - "error" error responce renamed to "message"
428
+ ## [5.0.0-alpha.8]
450
429
 
451
- ```js
452
- // Before
453
- {
454
- error: 'Some error';
455
- }
456
- // After
457
- {
458
- message: 'Some error';
459
- }
460
- ```
430
+ - **[UPDATE]** Replace `dotenv` with `loadEnvFile`.
431
+ - **[UPDATE]** Replace `nodemon` with `node --watch` (dev only).
432
+ - **[BREAKING]** Minimum node version is 20.12 as for now (`process.loadEnvFile`).
461
433
 
462
- [UPDATE] update deps
463
- [UPDATE] winston console transport now using timestapms
464
- [UPDATE] PrepareAppInfo middleware now a global one. Do not need to include it on every controller
465
- [NEW] Request anso works with req.query, but req.body have bigger priority
434
+ ---
466
435
 
467
- ### 2.18.0
436
+ ## [5.0.0-alpha.7]
468
437
 
469
- [UPDATE] update deps
470
- [UPDATE] replace body-parser with express.json
471
- [NEW] role middleware
438
+ - **[UPDATE]** Deps update.
472
439
 
473
- ### 2.17.0
440
+ ---
474
441
 
475
- [UPDATE] update deps
476
- [NEW] new env variable LOGGER_SENTRY_LEVEL (default=info)
477
- [NEW] new env variable LOGGER_CONSOLE_ENABLE (default=true)
478
- [BREAKING] on translation we changed i18next. Please convert files if you have plurals inside it https://i18next.github.io/i18next-v4-format-converter-web/
442
+ ## [5.0.0-alpha.6]
479
443
 
480
- #### 2.16.0
444
+ - **[UPDATE]** Update internal documentation (`jsdoc`, `d.ts`).
481
445
 
482
- [UPDATE] update deps
483
- [NEW] begin adding type script definitions
446
+ ---
484
447
 
485
- #### 2.15.4
448
+ ## [5.0.0-alpha.5]
486
449
 
487
- [UPDATE] update deps
488
- [UPDATE] update tests timeout
450
+ - **[UPDATE]** More verbose errors for rapsing body request.
451
+ - **[UPDATE]** Deps update.
489
452
 
490
- #### 2.15.0
453
+ ---
491
454
 
492
- [UPDATE] update deps
493
- [NEW] Ability to configure Auth flow with 'isAuthWithVefificationFlow' option.
494
- [BREAKING] Register not return status 201 instead of 200
455
+ ## [5.0.0-alpha.4]
495
456
 
496
- #### 2.14.0
457
+ - **[UPDATE]** Update `rate-limiter-flexible` to v5.
458
+ - **[CHANGE]** Cache update `redis.setEX` to `redis.set(..,..,{EX:xx})` as `setEX` deprecated.
497
459
 
498
- [NEW] Add Sequence. It provide ability to easily generate sequences for given types. It save to use on distributed environments
460
+ ---
499
461
 
500
- ```javascript
501
- const SequenceModel = this.app.getModel('Sequence');
502
- // will be 1
503
- const someTypeSequence = await SequenceModel.getSequence('someType');
504
- // will be 2
505
- const someTypeSequence2 = await SequenceModel.getSequence('someType');
506
- // will be 1 as type is another
507
- const someAnotherTypeSequence =
508
- await SequenceModel.getSequence('someAnotherType');
509
- ```
462
+ ## [5.0.0-alpha.3]
510
463
 
511
- #### 2.13.1
464
+ - **[UPDATE]** Deps update.
465
+ - **[FIX]** `Migration` commands apply.
512
466
 
513
- [FIX] fix documentation about not using req.appInfo.request, but using req.body for RateLimiter
467
+ ---
514
468
 
515
- #### 2.13.0
516
-
517
- [NEW] Rate limited middleware - ability to include request components (req.body) for key generation. Please not that you have no access to req.appInfo.request on this stage
518
-
519
- ```javascript
469
+ ## [5.0.0-alpha.2]
470
+
471
+ - **[UPDATE]** Deps update.
472
+
473
+ ---
474
+
475
+ ## [5.0.0-alpha.1]
476
+
477
+ - **[BREAKING]** Vitest 1.0.0 <https://vitest.dev/guide/migration.html#migrating-from-vitest-0-34-6>.
478
+ - **[BREAKING]** ESM only. No more commonJS. That help to fix a lot of bugs with tests and provides better development expirience.
479
+ - **[BREAKING]** Mongoose v8. <https://mongoosejs.com/docs/migrating_to_8.html>.
480
+
481
+ ---
482
+
483
+ ## [4.11.4]
484
+
485
+ - **[UPDATE]** Deps update.
486
+
487
+ ---
488
+
489
+ ## [4.11.3]
490
+
491
+ - **[UPDATE]** Deps update.
492
+
493
+ ---
494
+
495
+ ## [4.11.2]
496
+
497
+ - **[FIX]** `Cors` middleware return proper headers on multidomains.
498
+
499
+ ---
500
+
501
+ ## [4.11.1]
502
+
503
+ - **[FIX]** `Cors` middleware return proper status.
504
+
505
+ ---
506
+
507
+ ## [4.11.0]
508
+
509
+ - **[NEW]** `Cors` middleware.
510
+ - **[BREAKING]** This is a potencial breaking change as we switched from `cors` external package to internal middleware. From API nothing was changed. This is a potencial breaking changes, but it should keep working as it.
511
+
512
+ ---
513
+
514
+ ## [4.10.0]
515
+
516
+ - **[UPDATE]** Deps update.
517
+ - **[NEW]** Static file middleware.
518
+ - **[BREAKING]** This is a potencial breaking change as we switched from `express.static` to internal middleware that provide less features but faster. From API nothing was changed.
519
+
520
+ ---
521
+
522
+ ## [4.9.2]
523
+
524
+ - **[UPDATE]** Deps update.
525
+
526
+ ---
527
+
528
+ ## [4.9.1]
529
+
530
+ - **[UPDATE]** All responces from framework now happens in JSON. Previouls sometime aswers was in plan text.
531
+
532
+ ---
533
+
534
+ ## [4.9.0]
535
+
536
+ - **[BREAKING]** We are separated testsing to setyp and global setup. Global setup now care of mongo to make sure that only on mongodb memoery server is spinned up. If you are using `vitest` please add `"globalSetup": "node_modules/@adaptivestone/framework/tests/globalSetupVitest"` to your vitest config.
537
+
538
+ ---
539
+
540
+ ## [4.8.3]
541
+
542
+ - **[UPDATE]** Fix problme with fat start and closing connections after.
543
+
544
+ ---
545
+
546
+ ## [4.8.2]
547
+
548
+ - **[UPDATE]** CLI - disable mongoose index creation.
549
+
550
+ ---
551
+
552
+ ## [4.8.1]
553
+
554
+ - **[UPDATE]** Model inited on server inited.
555
+ - **[NEW]** New options to skip model init `isSkipModelInit`.
556
+ - **[NEW]** New method server method `initAllModels()`.
557
+
558
+ ---
559
+
560
+ ## [4.8.0]
561
+
562
+ - **[BREAKING]** Minimum node js version id 18.17.0 now.
563
+ - **[BREAKING]** Removed `getFileWithExtendingInhirence`. This was internal method and not suppose to use externally.
564
+ - **[UPDATE]** Update `Base.getFilesPathWithInheritance` to use `fs.read` dir resursive option.
565
+ - **[UPDATE]** Update cache (refactor+tets).
566
+ - **[UPDATE]** Update config and model inits.
567
+
568
+ ---
569
+
570
+ ## [4.7.0]
571
+
572
+ - **[UPDATE]** Update logger init (refactor).
573
+ - **[UPDATE]** Updated deps.
574
+
575
+ ---
576
+
577
+ ## [4.6.0]
578
+
579
+ - **[NEW]** Migrated from JEST to `vitest`.
580
+
581
+ ---
582
+
583
+ ## [4.5.0]
584
+
585
+ - **[NEW]** Now `getSuper()` available as a method on mongoose models.
586
+ - **[UPDATE]** Update `rate-limiter-flexible` to v3.
587
+ - **[UPDATE]** Update test runner to suport ESM. In case problem with test please copy `babel.config.js` from framework to your project directory.
588
+
589
+ ---
590
+
591
+ ## [4.4.0]
592
+
593
+ - **[NEW]** New method to grab url of server it testing enviroument `global.server.testingGetUrl("/some/endpoint")`.
594
+
595
+ ---
596
+
597
+ ## [4.3.1]
598
+
599
+ - **[UPDATE]** `Yup` file validator update. As formidable now return all fields as an array.
600
+
601
+ ---
602
+
603
+ ## [4.3.0]
604
+
605
+ - **[BREAKING]** Updated `formidable` with a new version + tests. Marked as breaking because of a new major version, but this is internal of framework and exernal still the same. Should break nothing.
606
+
607
+ ---
608
+
609
+ ## [4.2.0]
610
+
611
+ - **[UPDATE]** Updated deps.
612
+ - **[NEW]** `CreateUser` cli command. Ability to update user by email or id.
613
+
614
+ ---
615
+
616
+ ## [4.1.0]
617
+
618
+ - **[UPDATE]** Updated deps.
619
+ - **[NEW]** Email - Ability to render templae to string for future usage.
620
+
621
+ ---
622
+
623
+ ## [4.0.0]
624
+
625
+ - **[BREAKING]** Change `bcrypt` encryption with `scrypt`.
626
+ - **[BREAKING]** Change internal express parser to `formidable` parser. Affect you if external `formidable` is used.
627
+ - **[BREAKING]** Should not affect any user. Changed `email-templates` module to internal implementation. Idea to keep dependensy list smaller.
628
+ - **[BREAKING]** Change `i18n` middleware to internal one. Nothing should be affected.
629
+ - **[BREAKING]** Now validation of request splitted between `request` and `query`.
630
+ - **[BREAKING]** `supportedLngs` option added to `i18n` config.
631
+ - **[BREAKING]** Email inliner now looking for `src/services/messaging/email/resources` folder instead of `build` folder.
632
+ - **[BREAKING]** Mongoose v7. <https://mongoosejs.com/docs/migrating_to_7.html>.
633
+ - **[BREAKING]** `Yup` validation was updated to v1 <https://github.com/jquense/yup/issues/1906>.
634
+ - **[DEPRECATED]** `getExpress` path is deprecated. Renamed to `getHttpPath`.
635
+ - **[NEW]** Pagination middleware.
636
+ - **[NEW]** `requestLogger` middleware. Migrated from core server to be an middleware.
637
+ - **[NEW]** `CreateUser` command.
638
+ - **[NEW]** Custom `yup` validator for validate File requests.
639
+ - **[UPDATE]** Updated deps.
640
+ - **[UPDATE]** `openApi` generator support files.
641
+ - **[UPDATE]** Updated `18n` middleware. Introduced internal cachce. Speed up of request processing up to 100%.
642
+ - **[UPDATE]** Cache drivers to JSON support `BigInt` numbers.
643
+
644
+ ---
645
+
646
+ ## [3.4.3]
647
+
648
+ - **[UPDATE]** Updated deps.
649
+ - **[FIX]** Fix tests for redis.
650
+ - **[FIX]** Support in tests `TEST_FOLDER_EMAILS`.
651
+
652
+ ---
653
+
654
+ ## [3.4.2]
655
+
656
+ - **[UPDATE]** Updated deps.
657
+ - **[FIX]** Fix documentation generation.
658
+
659
+ ---
660
+
661
+ ## [3.4.1]
662
+
663
+ - **[FIX]** Fix documentation generation.
664
+
665
+ ---
666
+
667
+ ## [3.4.0]
668
+
669
+ - **[NEW]** Now we pass `req` to validation and casting as a second parameter. This done mostly for custom validators.
670
+
671
+ ---
672
+
673
+ ## [3.3.0]
674
+
675
+ - **[NEW]** New command `SyncIndexes` to sync indexes for mongodb <https://framework.adaptivestone.com/docs/cli#syncindexes>.
676
+ - **[UPDATE]** Updated deps.
677
+ - **[FIX]** Fix documentation generation.
678
+
679
+ ---
680
+
681
+ ## [3.2.2]
682
+
683
+ - **[UPDATE]** Add options for `i18n` to config.
684
+ - **[CHANGE]** By default `i18n` not writing missed keys. Can be enabled via config.
685
+
686
+ ---
687
+
688
+ ## [3.2.1]
689
+
690
+ - **[UPDATE]** Updated deps.
691
+ - **[FIX]** Fix documentation generation.
692
+
693
+ ---
694
+
695
+ ## [3.2.0]
696
+
697
+ - **[UPDATE]** Updated deps.
698
+ - **[NEW]** `cache.removeKey(key)` - function to remove key from cache.
699
+
700
+ ---
701
+
702
+ ## [3.1.1]
703
+
704
+ - **[UPDATE]** Updated deps.
705
+ - **[FIX]** Fix cache error handling.
706
+
707
+ ---
708
+
709
+ ## [3.1.0]
710
+
711
+ - **[NEW]** New comand to generate open API documentation (wip).
712
+ - **[NEW]** Coverage report.
713
+ - **[UPDATE]** Updated deps.
714
+
715
+ ---
716
+
717
+ ## [3.0.23]
718
+
719
+ - **[UPDATE]** Updated deps.
720
+ - **[FIX]** Fix custom errors.
721
+
722
+ ---
723
+
724
+ ## [3.0.22]
725
+
726
+ - **[UPDATE]** Updated deps.
727
+ - **[UPDATE]** Cast function now can be ASYNC too.
728
+
729
+ ---
730
+
731
+ ## [3.0.21]
732
+
733
+ - **[UPDATE]** Updated redis to v4.
734
+ - **[NEW]** Updates tests to have own namespace on redis.
735
+
736
+ ---
737
+
738
+ ## [3.0.20]
739
+
740
+ - **[UPDATE]** Update deps.
741
+
742
+ ---
743
+
744
+ ## [3.0.19]
745
+
746
+ - **[UPDATE]** Update deps.
747
+
748
+ ---
749
+
750
+ ## [3.0.18]
751
+
752
+ - **[UPDATE]** Update deps.
753
+ - **[UPDATE]** Change default branch to `main`.
754
+
755
+ ---
756
+
757
+ ## [3.0.17]
758
+
759
+ - **[UPDATE]** Update deps.
760
+
761
+ ---
762
+
763
+ ## [3.0.16]
764
+
765
+ - **[UPDATE]** Update deps.
766
+ - **[FIX]** Fix bug with route level middleware.
767
+
768
+ ---
769
+
770
+ ## [3.0.15]
771
+
772
+ - **[UPDATE]** Update deps.
773
+ - **[UPDATE]** Minimum node version 16.
774
+
775
+ ---
776
+
777
+ ## [3.0.14]
778
+
779
+ - **[NEW]** Now possible to show all errors during validation (default one) by parameter `controllerValidationAbortEarly`.
780
+ - **[UPDATE]** Update deps.
781
+
782
+ ---
783
+
784
+ ## [3.0.13]
785
+
786
+ - **[UPDATE]** Bug fix with "mergeParams".
787
+
788
+ ---
789
+
790
+ ## [3.0.12]
791
+
792
+ - **[NEW]** Ability to pass "mergeParams" options to express router.
793
+ - **[UPDATE]** Update deps.
794
+
795
+ ---
796
+
797
+ ## [3.0.11]
798
+
799
+ - **[UPDATE]** More verbose email error.
800
+
801
+ ---
802
+
803
+ ## [3.0.10]
804
+
805
+ - **[UPDATE]** Update deps.
806
+ - **[CHANGE]** Tests `afterAll` not using timeout anymore (conflict with jest 28-alpha).
807
+ - **[NEW]** Config for mail now supports "EMAIL_TRANSPORT" env variable. SMTP by default (as was).
808
+
809
+ ---
810
+
811
+ ## [3.0.9]
812
+
813
+ - **[UPDATE]** Update deps.
814
+
815
+ ---
816
+
817
+ ## [3.0.8]
818
+
819
+ - **[UPDATE]** Update deps.
820
+
821
+ ---
822
+
823
+ ## [3.0.7]
824
+
825
+ - **[UPDATE]** Update deps.
826
+ - **[CHANGE]** Change default `getConfig` method.
827
+
828
+ ---
829
+
830
+ ## [3.0.6]
831
+
832
+ - **[UPDATE]** Update deps.
833
+
834
+ ---
835
+
836
+ ## [3.0.5]
837
+
838
+ - **[UPDATE]** Update deps.
839
+
840
+ ---
841
+
842
+ ## [3.0.4]
843
+
844
+ - **[UPDATE]** Fix bug with app shutdown.
845
+
846
+ ---
847
+
848
+ ## [3.0.3]
849
+
850
+ - **[UPDATE]** Update deps.
851
+
852
+ ---
853
+
854
+ ## [3.0.2]
855
+
856
+ - **[UPDATE]** Update deps.
857
+
858
+ ---
859
+
860
+ ## [3.0.1]
861
+
862
+ - **[UPDATE]** Update deps.
863
+ - **[UPDATE]** `getUserByTokens` more logs.
864
+
865
+ ---
866
+
867
+ ## [3.0.0]
868
+
869
+ - **[BREAKING]** Mongoose v6. Than a lot of changes:[mongoDB drive changes](https://github.com/mongodb/node-mongodb-native/blob/4.0/docs/CHANGES_4.0.0.md), [Mongoose changes](https://mongoosejs.com/docs/migrating_to_6.html).
870
+ Notable changes from migration
871
+ Removed `execPopulate()`[link](https://mongoosejs.com/docs/migrating_to_6.html#removed-execpopulate)
872
+ ```js
873
+ // Document#populate() now returns a promise and is now no longer chainable.
874
+ //Replace
875
+ await doc.populate('path1').populate('path2').execPopulate();
876
+ // with
877
+ await doc.populate(['path1', 'path2']);
878
+ //Replace
879
+ await doc
880
+ .populate('path1', 'select1')
881
+ .populate('path2', 'select2')
882
+ .execPopulate();
883
+ // with
884
+ await doc.populate([
885
+ { path: 'path1', select: 'select1' },
886
+ { path: 'path2', select: 'select2' },
887
+ ]);
888
+ ```
889
+ - **[REMOVED]** Removed deprecated router handler string not allowed anymore. Use functions by itself.
890
+ - **[REMOVED]** Removed deprecated `someSecretSalt()` on user model (use `this.saltSecret` instead).
891
+ - **[REMOVED]** Removed deprecated `validate()` on abstract controller and as result validator dependency. Use request validators instead.
892
+ - **[REMOVED]** Removed deprecated `isUseControllerNameForRouting()` on abstract controller. Use `getExpressPath()` instead.
893
+ - **[REMOVED]** Removed deprecated `Base.loadFilesWithInheritance` please use `getFilesPathWithInheritance` that produce almost the same output.
894
+ - **[BREAKING]** Removed "success" field on Auth contreoller. Please use http status instead.
895
+ - **[BREAKING]** Auth controller - "error" error responce renamed to "message".
896
+ ```js
897
+ // Before
898
+ {
899
+ error: 'Some error';
900
+ }
901
+ // After
902
+ {
903
+ message: 'Some error';
904
+ }
905
+ ```
906
+ - **[UPDATE]** Update deps.
907
+ - **[UPDATE]** Winston console transport now using timestapms.
908
+ - **[UPDATE]** `PrepareAppInfo` middleware now a global one. Do not need to include it on every controller.
909
+ - **[NEW]** Request also works with `req.query`, but `req.body` have bigger priority.
910
+
911
+ ---
912
+
913
+ ## [2.18.0]
914
+
915
+ - **[UPDATE]** Update deps.
916
+ - **[UPDATE]** Replace `body-parser` with `express.json`.
917
+ - **[NEW]** Role middleware.
918
+
919
+ ---
920
+
921
+ ## [2.17.0]
922
+
923
+ - **[UPDATE]** Update deps.
924
+ - **[NEW]** New env variable `LOGGER_SENTRY_LEVEL` (default=`info`).
925
+ - **[NEW]** New env variable `LOGGER_CONSOLE_ENABLE` (default=`true`).
926
+ - **[BREAKING]** On translation we changed `i18next`. Please convert files if you have plurals inside it <https://i18next.github.io/i18next-v4-format-converter-web/>.
927
+
928
+ ---
929
+
930
+ ## [2.16.0]
931
+
932
+ - **[UPDATE]** Update deps.
933
+ - **[NEW]** Begin adding type script definitions.
934
+
935
+ ---
936
+
937
+ ## [2.15.4]
938
+
939
+ - **[UPDATE]** Update deps.
940
+ - **[UPDATE]** Update tests timeout.
941
+
942
+ ---
943
+
944
+ ## [2.15.0]
945
+
946
+ - **[UPDATE]** Update deps.
947
+ - **[NEW]** Ability to configure Auth flow with `isAuthWithVefificationFlow` option.
948
+ - **[BREAKING]** Register not return status 201 instead of 200.
949
+
950
+ ---
951
+
952
+ ## [2.14.0]
953
+
954
+ - **[NEW]** Add `Sequence`. It provide ability to easily generate sequences for given types. It save to use on distributed environments.
955
+ ```javascript
956
+ const SequenceModel = this.app.getModel('Sequence');
957
+ // will be 1
958
+ const someTypeSequence = await SequenceModel.getSequence('someType');
959
+ // will be 2
960
+ const someTypeSequence2 = await SequenceModel.getSequence('someType');
961
+ // will be 1 as type is another
962
+ const someAnotherTypeSequence =
963
+ await SequenceModel.getSequence('someAnotherType');
964
+ ```
965
+
966
+ ---
967
+
968
+ ## [2.13.1]
969
+
970
+ - **[FIX]** Fix documentation about not using `req.appInfo.request`, but using `req.body` for `RateLimiter`.
971
+
972
+ ---
973
+
974
+ ## [2.13.0]
975
+
976
+ - **[NEW]** Rate limited middleware - ability to include request components (`req.body`) for key generation. Please not that you have no access to `req.appInfo.request` on this stage.
977
+ ```javascript
520
978
  static get middleware() {
521
979
  return new Map([
522
980
  ['POST/login', [
@@ -526,16 +984,16 @@ const someAnotherTypeSequence =
526
984
  ]]
527
985
  ]);
528
986
  }
529
- ```
987
+ ```
530
988
 
531
- #### 2.12.0
989
+ ---
532
990
 
533
- [UPDATE] update deps
534
- [NEW] Rate limited middleware
991
+ ## [2.12.0]
535
992
 
536
- As rate limited we using https://github.com/animir/node-rate-limiter-flexible
537
-
538
- ```javascript
993
+ - **[UPDATE]** Update deps.
994
+ - **[NEW]** Rate limited middleware.
995
+ As rate limited we using <https://github.com/animir/node-rate-limiter-flexible>
996
+ ```javascript
539
997
  static get middleware() {
540
998
  return new Map([
541
999
  ['POST/login', [
@@ -545,13 +1003,10 @@ As rate limited we using https://github.com/animir/node-rate-limiter-flexible
545
1003
  ]]
546
1004
  ]);
547
1005
  }
548
- ```
549
-
550
- Be default rate key generated based on Route, IP and userID. But you can adjust it vie config (global) or via middleware parameters (see v 2.10.0)
551
-
552
- Rate limiter have multiple backends (memory, redis and mongo). Buy default 'memory' backend activated
553
-
554
- ```javascript
1006
+ ```
1007
+ Be default rate key generated based on Route, IP and userID. But you can adjust it vie config (global) or via middleware parameters (see v 2.10.0)
1008
+ Rate limiter have multiple backends (memory, redis and mongo). Buy default 'memory' backend activated
1009
+ ```javascript
555
1010
  static get middleware() {
556
1011
  return new Map([
557
1012
  [
@@ -570,18 +1025,21 @@ Rate limiter have multiple backends (memory, redis and mongo). Buy default 'memo
570
1025
  ],
571
1026
  ]);
572
1027
  }
573
- ```
1028
+ ```
1029
+
1030
+ ---
574
1031
 
575
- #### 2.11.0
1032
+ ## [2.11.0]
576
1033
 
577
- [NEW] Added env variable HTTP_HOST for configure host to listen
1034
+ - **[NEW]** Added env variable `HTTP_HOST` for configure host to listen.
578
1035
 
579
- #### 2.10.0
1036
+ ---
580
1037
 
581
- [UPDATE] update deps
582
- [NEW] ability to pass parameters to middleware
1038
+ ## [2.10.0]
583
1039
 
584
- ```javascript
1040
+ - **[UPDATE]** Update deps.
1041
+ - **[NEW]** Ability to pass parameters to middleware.
1042
+ ```javascript
585
1043
  static get middleware() {
586
1044
  return new Map([
587
1045
  ['POST/someUrl', [
@@ -591,113 +1049,150 @@ Rate limiter have multiple backends (memory, redis and mongo). Buy default 'memo
591
1049
  ]]
592
1050
  ]);
593
1051
  }
594
- ```
1052
+ ```
1053
+ All this params goes to constructor as a second paramater.
1054
+
1055
+ ---
1056
+
1057
+ ## [2.9.2]
1058
+
1059
+ - **[UPDATE]** Update deps.
1060
+ - **[FIX]** Fix auth nick.
1061
+
1062
+ ---
1063
+
1064
+ ## [2.9.1]
1065
+
1066
+ - **[UPDATE]** Update deps.
1067
+
1068
+ ---
1069
+
1070
+ ## [2.9.0]
1071
+
1072
+ - **[BREAKING]** Auth controller update.
1073
+
1074
+ ---
1075
+
1076
+ ## [2.8.3]
1077
+
1078
+ - **[FIX]** Update recovery email template.
595
1079
 
596
- All this params goes to constructor as a second paramater
1080
+ ---
597
1081
 
598
- #### 2.9.2
1082
+ ## [2.8.2]
599
1083
 
600
- [UPDATE] update deps
601
- [FIX] fix auth nick
1084
+ - **[FIX]** Update AUTH controller.
602
1085
 
603
- #### 2.9.1
1086
+ ---
604
1087
 
605
- [UPDATE] update deps
1088
+ ## [2.8.1]
606
1089
 
607
- #### 2.9.0
1090
+ - **[UPDATE]** Update deps.
1091
+ - **[FIX]** Update AUTH controller.
608
1092
 
609
- [BREAKING] Auth controller update
1093
+ ---
610
1094
 
611
- #### 2.8.3
1095
+ ## [2.8.0]
612
1096
 
613
- [FIX] update recovery email template
1097
+ - **[UPDATE]** Change controllers to reflect latest changes.
1098
+ - **[UPDATE]** Add warning when using `req.body` directly.
1099
+ - **[BREAKING]** Possible breaking. `AsyncFunction` now required for router handler (it always was but without checking of code).
1100
+ - **[DEPRECATE]** Usage of `validator` of controllers.
1101
+ - **[DEPRECATE]** Usage of `isUseControllerNameForRouting` of controllers.
614
1102
 
615
- #### 2.8.2
1103
+ ---
616
1104
 
617
- [FIX] update AUTH controller
1105
+ ## [2.7.4]
618
1106
 
619
- #### 2.8.1
1107
+ - **[UPDATE]** Update deps.
620
1108
 
621
- [UPDATE] update deps
622
- [FIX] update AUTH controller
1109
+ ---
623
1110
 
624
- #### 2.8.0
1111
+ ## [2.7.3]
625
1112
 
626
- [UPDATE] change controllers to reflect latest changes
627
- [UPDATE] add warning when using 'req.body' directly
628
- [BREAKING] Possible breaking. AsyncFunction now required for router handler (it always was but without checking of code)
629
- [DEPRECATE] usage of 'validator' of controllers
630
- [DEPRECATE] usage of 'isUseControllerNameForRouting' of controllers.
1113
+ - **[UPDATE]** Replace `i18next-node-fs-backend` to `i18next-fs-backend` (drop in replacement).
631
1114
 
632
- #### 2.7.4
1115
+ ---
633
1116
 
634
- [UPDATE] update deps
1117
+ ## [2.7.2]
635
1118
 
636
- #### 2.7.3
1119
+ - **[UPDATE]** Update deps.
637
1120
 
638
- [UPDATE] replace i18next-node-fs-backend to i18next-fs-backend (drop in replacement)
1121
+ ---
639
1122
 
640
- #### 2.7.2
1123
+ ## [2.7.1]
641
1124
 
642
- [UPDATE] update deps
1125
+ - **[REMOVE]** Remove unused websocket.
643
1126
 
644
- #### 2.7.1
1127
+ ---
645
1128
 
646
- [REMOVE] remove unused websocket
1129
+ ## [2.7.0]
647
1130
 
648
- #### 2.7.0
1131
+ - **[UPDATE]** Change winston sentry transport.
649
1132
 
650
- [UPDATE] change winston sentry transport
1133
+ ---
651
1134
 
652
- #### 2.6.5
1135
+ ## [2.6.5]
653
1136
 
654
- [UPDATE] update deps
655
- [UPDATE] optimize deps
1137
+ - **[UPDATE]** Update deps.
1138
+ - **[UPDATE]** Optimize deps.
656
1139
 
657
- #### 2.6.4
1140
+ ---
658
1141
 
659
- [UPDATE] update deps
1142
+ ## [2.6.4]
660
1143
 
661
- #### 2.6.3
1144
+ - **[UPDATE]** Update deps.
662
1145
 
663
- [UPDATE] update deps
664
- [UPDATE] update handling exceptions loging
1146
+ ---
665
1147
 
666
- #### 2.6.2
1148
+ ## [2.6.3]
667
1149
 
668
- [UPDATE] normalize auth config
1150
+ - **[UPDATE]** Update deps.
1151
+ - **[UPDATE]** Update handling exceptions loging.
669
1152
 
670
- #### 2.6.1
1153
+ ---
671
1154
 
672
- [FIX] fix error on cache system
673
- [UPDATE] stripUnknown=true by default on casting
1155
+ ## [2.6.2]
674
1156
 
675
- #### 2.6.0
1157
+ - **[UPDATE]** Normalize auth config.
676
1158
 
677
- [UPDATE] deps update
678
- [NEW]new cache system (alpha, subject of change)
1159
+ ---
679
1160
 
680
- ```javascript
681
- const cacheTime = 60 * 5;
682
- this.app.cache.getSetValue(
683
- 'someKey',
684
- async () => {
685
- // function that will execute in case cache value is missed
686
- },
687
- cacheTime,
688
- );
689
- ```
1161
+ ## [2.6.1]
690
1162
 
691
- #### 2.5.1
1163
+ - **[FIX]** Fix error on cache system.
1164
+ - **[UPDATE]** `stripUnknown=true` by default on casting.
692
1165
 
693
- [UPDATE] deps update
694
- [FIX] fix error logging on unhadled rejection
1166
+ ---
695
1167
 
696
- #### 2.5.0
1168
+ ## [2.6.0]
697
1169
 
698
- [NEW] new route handler format with request validations and casting (yup based)
1170
+ - **[UPDATE]** Deps update.
1171
+ - **[NEW]** New cache system (alpha, subject of change).
1172
+ ```javascript
1173
+ const cacheTime = 60 * 5;
1174
+ this.app.cache.getSetValue(
1175
+ 'someKey',
1176
+ async () => {
1177
+ // function that will execute in case cache value is missed
1178
+ },
1179
+ cacheTime,
1180
+ );
1181
+ ```
699
1182
 
700
- ```javascript
1183
+ ---
1184
+
1185
+ ## [2.5.1]
1186
+
1187
+ - **[UPDATE]** Deps update.
1188
+ - **[FIX]** Fix error logging on unhadled rejection.
1189
+
1190
+ ---
1191
+
1192
+ ## [2.5.0]
1193
+
1194
+ - **[NEW]** New route handler format with request validations and casting (yup based).
1195
+ ```javascript
701
1196
  get routes() {
702
1197
  return {
703
1198
  post: {
@@ -712,217 +1207,301 @@ this.app.cache.getSetValue(
712
1207
  }
713
1208
  // send request with data {count: "5000"}
714
1209
  // will produce error with status 400 and {errors: {count:['Text error']}}
715
-
716
-
717
1210
  postSample(req,res) =>{
718
1211
  // on success validate we pass here.
719
1212
  // {count: "5000"}
720
1213
  console.log(req.appInfo.request)
721
1214
  // {count: 5000} -> casted to number
722
1215
  }
723
- ```
1216
+ ```
1217
+
1218
+ ---
724
1219
 
725
- #### 2.4.4
1220
+ ## [2.4.4]
726
1221
 
727
- [UPDATE] deps update
728
- [NEW] controller unhandled rejection now handled with default error
729
- [NEW] handle error with wrong model name
1222
+ - **[UPDATE]** Deps update.
1223
+ - **[NEW]** Controller unhandled rejection now handled with default error.
1224
+ - **[NEW]** Handle error with wrong model name.
730
1225
 
731
- #### 2.4.3
1226
+ ---
732
1227
 
733
- [UPDATE] deps update
1228
+ ## [2.4.3]
734
1229
 
735
- #### 2.4.2
1230
+ - **[UPDATE]** Deps update.
736
1231
 
737
- [FIX] abstract controlled middleware
738
- [UPDATE] deps update
1232
+ ---
739
1233
 
740
- #### 2.4.1
1234
+ ## [2.4.2]
741
1235
 
742
- [FIX] updated test because of previous breaking changes
1236
+ - **[FIX]** Abstract controlled middleware.
1237
+ - **[UPDATE]** Deps update.
743
1238
 
744
- #### 2.4.0
1239
+ ---
745
1240
 
746
- [BREAKING] possible that bug fix of middleware can affect your code. Previous route middleware was GLOBAL (router.use) now in router level only (route.any). Previous Home controller (/ route be default) middleware affect ANY routes on app. Right now that fixed.
1241
+ ## [2.4.1]
747
1242
 
748
- [NEW] Controller middleware now support methods. Previous only ALL was supported. Possible to start router with any method that supported by Express and middleware will be scoped by this method. If middleware route started from "/" then ALL method will be used (like previous bahaviour)
1243
+ - **[FIX]** Updated test because of previous breaking changes.
749
1244
 
750
- ```javascript
1245
+ ---
1246
+
1247
+ ## [2.4.0]
1248
+
1249
+ - **[BREAKING]** Possible that bug fix of middleware can affect your code. Previous route middleware was GLOBAL (`router.use`) now in router level only (`route.any`). Previous Home controller (`/` route be default) middleware affect ANY routes on app. Right now that fixed.
1250
+ - **[NEW]** Controller middleware now support methods. Previous only `ALL` was supported. Possible to start router with any method that supported by Express and middleware will be scoped by this method. If middleware route started from "/" then `ALL` method will be used (like previous bahaviour).
1251
+ ```javascript
751
1252
  static get middleware() {
752
1253
  return new Map([['GET/*', [PrepareAppInfo, GetUserByToken]]]);
753
1254
  }
754
- ```
1255
+ ```
1256
+
1257
+ ---
1258
+
1259
+ ## [2.3.14]
1260
+
1261
+ - **[FIX]** Fix validate controller method for non strings.
1262
+
1263
+ ---
1264
+
1265
+ ## [2.3.13]
1266
+
1267
+ - **[UPDATE]** Testing now with mongoDB Replica.
1268
+ - **[UPDATE]** Refactor CLI.
1269
+
1270
+ ---
1271
+
1272
+ ## [2.3.12]
1273
+
1274
+ - **[UPDATE]** Testing update.
1275
+
1276
+ ---
1277
+
1278
+ ## [2.3.11]
1279
+
1280
+ - **[UPDATE]** Refactor CLI for testing.
1281
+
1282
+ ---
1283
+
1284
+ ## [2.3.10]
1285
+
1286
+ - **[UPDATE]** Update user model indexes to allow null email and nick.
1287
+ - **[UPDATE]** Deps update.
1288
+
1289
+ ---
1290
+
1291
+ ## [2.3.9]
1292
+
1293
+ - **[FIX]** Test fix.
1294
+
1295
+ ---
1296
+
1297
+ ## [2.3.8]
1298
+
1299
+ - **[NEW]** Add `global.testSetup.beforeAll` `global.testSetup.afterAll` functions and `global.testSetup.disableUserCreate` flag for testing testing.
1300
+
1301
+ ---
1302
+
1303
+ ## [2.3.7]
1304
+
1305
+ - **[UPDATE]** Deps update.
1306
+ - **[NEW]** Add `global.testSetup.userCreate` function for testing.
1307
+
1308
+ ---
1309
+
1310
+ ## [2.3.6]
1311
+
1312
+ - **[UPDATE]** Deps update.
1313
+ - **[FIX]** Test fix.
1314
+
1315
+ ---
1316
+
1317
+ ## [2.3.5]
1318
+
1319
+ - **[NEW]** Add command `DropIndex`.
1320
+ - **[UPDATE]** Deps update.
1321
+
1322
+ ---
1323
+
1324
+ ## [2.3.4]
1325
+
1326
+ - **[NEW]** Add `webResources` option to email service.
1327
+ - **[UPDATE]** Deps update.
1328
+
1329
+ ---
1330
+
1331
+ ## [2.3.3]
1332
+
1333
+ - **[UPDATE]** Deps update.
1334
+
1335
+ ---
1336
+
1337
+ ## [2.3.2]
1338
+
1339
+ - **[FIX]** Fix controllers order to load.
755
1340
 
756
- #### 2.3.14
1341
+ ---
757
1342
 
758
- [FIX] fix validate controller method for non strings
1343
+ ## [2.3.1]
759
1344
 
760
- #### 2.3.13
1345
+ - **[FIX]** Fix parsing token.
761
1346
 
762
- [UPDATE] testing now with mongoDB Replica
763
- [UPDATE] refactor CLI
1347
+ ---
764
1348
 
765
- #### 2.3.12
1349
+ ## [2.3.0]
766
1350
 
767
- [UPDATE] testing update
1351
+ - **[NEW]** `Migration/create` `migration/migrate` commands.
768
1352
 
769
- #### 2.3.11
1353
+ ---
770
1354
 
771
- [UPDATE] refactor CLI for testing
1355
+ ## [2.2.6]
772
1356
 
773
- #### 2.3.10
1357
+ - **[NEW]** CLI command receiving parsed arguments.
774
1358
 
775
- [UPDATE] update user model indexes to allow null email and nick
776
- [UPDATE] deps update
1359
+ ---
777
1360
 
778
- #### 2.3.9
1361
+ ## [2.2.5]
779
1362
 
780
- [FIX] test fix
1363
+ - **[FIX]** Fix disconnecting problems with replica set.
781
1364
 
782
- #### 2.3.8
1365
+ ---
783
1366
 
784
- [NEW] add 'global.testSetup.beforeAll' 'global.testSetup.afterAll' functions and 'global.testSetup.disableUserCreate' flag for testing testing
1367
+ ## [2.2.4]
785
1368
 
786
- #### 2.3.7
1369
+ - **[UPDATE]** Internal update for speed up cli init.
787
1370
 
788
- [UPDATE] deps update
789
- [NEW] add 'global.testSetup.userCreate' function for testing
1371
+ ---
790
1372
 
791
- #### 2.3.6
1373
+ ## [2.2.3]
792
1374
 
793
- [UPDATE] deps update
794
- [FIX] test fix
1375
+ - **[FIX]** Fix language detection.
795
1376
 
796
- #### 2.3.5
1377
+ ---
797
1378
 
798
- [NEW] Add command DropIndex
799
- [UPDATE] deps update
1379
+ ## [2.2.2]
800
1380
 
801
- #### 2.3.4
1381
+ - **[FIX]** Fix test as part of docker image update. This just a `mongo-memory-server` problems.
1382
+ - **[NEW]** Add config to configure language detecting order and types.
802
1383
 
803
- [NEW] Add webResources option to email service
804
- [UPDATE] deps update
1384
+ ---
805
1385
 
806
- #### 2.3.3
1386
+ ## [2.2.1]
807
1387
 
808
- [UPDATE] deps update
1388
+ - **[UPDATE]** Deps update.
809
1389
 
810
- #### 2.3.2
1390
+ ---
811
1391
 
812
- [FIX] Fix controllers order to load
1392
+ ## [2.2.0]
813
1393
 
814
- #### 2.3.1
1394
+ - **[DEPRECATED]** `Base.loadFilesWithInheritance` please use `getFilesPathWithInheritance` that produce almost the same output.
1395
+ - **[UPDATE]** Deps update.
1396
+ - **[UPDATE]** Https logs now contains request time.
1397
+ - **[NEW]** Ability to put controllers into folders with path inheritance.
1398
+ - **[NEW]** Ability to replace `expressPath` on controller - `getExpressPath()` methos.
1399
+ - **[NEW]** Ability to put commands into folders with path inheritance.
815
1400
 
816
- [FIX] Fix parsing token
1401
+ ---
817
1402
 
818
- #### 2.3.0
1403
+ ## [2.1.2]
819
1404
 
820
- [NEW] Migration/create migration/migrate commands
1405
+ - **[UPDATE]** Disconnect of mongoose when command was finished.
821
1406
 
822
- #### 2.2.6
1407
+ ---
823
1408
 
824
- [NEW] CLI command receiving parsed arguments
1409
+ ## [2.1.1]
825
1410
 
826
- #### 2.2.5
1411
+ - **[UPDATE]** Deps update.
827
1412
 
828
- [FIX] Fix disconnecting problems with replica set
1413
+ ---
829
1414
 
830
- #### 2.2.4
1415
+ ## [2.1.0]
831
1416
 
832
- [UPDATE] Internal update for speed up cli init
1417
+ - **[DEV]** Added codestyle checker.
1418
+ - **[NEW]** Initial CLI module.
833
1419
 
834
- #### 2.2.3
1420
+ ---
835
1421
 
836
- [FIX] fix language detection
1422
+ ## [2.0.2]
837
1423
 
838
- #### 2.2.2
1424
+ - **[UPDATE]** Socket.io v3.
1425
+ - **[UPDATE]** Deps update.
839
1426
 
840
- [FIX] fix test as part of docker image update. This just a mongo-memory-server problems
841
- [NEW] add config to configure language detecting order and types
1427
+ ---
842
1428
 
843
- #### 2.2.1
1429
+ ## [2.0.1]
844
1430
 
845
- [UPDATE] deps update
1431
+ - **[NEW]** Added config to websocket.
846
1432
 
847
- #### 2.2.0
1433
+ ---
848
1434
 
849
- [DEPRECATED] Base.loadFilesWithInheritance please use getFilesPathWithInheritance that produce almost the same output
850
- [UPDATE] deps update
851
- [UPDATE] https logs now contains request time
852
- [NEW] Ability to put controllers into folders with path inheritance
853
- [NEW] Ability to replace expressPath on controller - getExpressPath() methos
854
- [NEW] Ability to put commands into folders with path inheritance
1435
+ ## [2.0.0]
855
1436
 
856
- #### 2.1.2
1437
+ - **[BREAKING]** Change config format of log config. Now configs can be only objects.
857
1438
 
858
- [UPDATE] disconnect of mongoose when command was finished
1439
+ ---
859
1440
 
860
- #### 2.1.1
1441
+ ## [1.5.0]
861
1442
 
862
- [UPDATE] deps update
1443
+ - **[NEW]** Support for environment configs (`config.js` and `config.{NODE_ENV}.js`) with overwrite.
1444
+ - **[UPDATE]** Deps update.
863
1445
 
864
- #### 2.1.0
1446
+ ---
865
1447
 
866
- [DEV] added codestyle checker
867
- [NEW] Initial CLI module
1448
+ ## [1.4.0]
868
1449
 
869
- #### 2.0.2 released
1450
+ - **[NEW]** Ability to pass additional parameter to server that will be executed before adding page 404.
870
1451
 
871
- [UPDATE] socket.io v3
872
- [UPDATE] deps update
1452
+ ---
873
1453
 
874
- #### 2.0.1
1454
+ ## [1.3.0]
875
1455
 
876
- [NEW] Added config to websocket
1456
+ - **[NEW]** Models now support optional callback that will executed on connection ready. If mongo already connected then callback will be executed immediately.
877
1457
 
878
- #### 2.0.0
1458
+ ---
879
1459
 
880
- [BREAKING] Change config format of log config. Now configs can be only objects
1460
+ ## [1.2.9]
881
1461
 
882
- #### 1.5.0
1462
+ - **[UPDATE]** Update deps.
883
1463
 
884
- [NEW] Support for environment configs (config.js and config.{NODE_ENV}.js) with overwrite
885
- [UPDATE] deps update
1464
+ ---
886
1465
 
887
- #### 1.4.0
1466
+ ## [1.2.8]
888
1467
 
889
- Ability to pass additional parameter to server that will be executed before adding page 404
1468
+ - **[UPDATE]** Update deps.
890
1469
 
891
- #### 1.3.0
1470
+ ---
892
1471
 
893
- Models now support optional callback that will executed on connection ready. If mongo already connected then callback will be executed immediately
1472
+ ## [1.2.7]
894
1473
 
895
- #### 1.2.9
1474
+ - **[NEW]** Add abilty to return error from custom validation functions.
896
1475
 
897
- Update deps
1476
+ ---
898
1477
 
899
- #### 1.2.8
1478
+ ## [1.2.6]
900
1479
 
901
- Update deps
1480
+ - **[UPDATE]** Validator documentation (jsdoc) update.
1481
+ - **[UPDATE]** Validator support pass parameters to validator.
902
1482
 
903
- #### 1.2.7
1483
+ ---
904
1484
 
905
- Add abilty to return error from custom validation functions
1485
+ ## [1.2.5]
906
1486
 
907
- #### 1.2.6
1487
+ - **[FIX]** Fix problem with test (user should be global on tests).
908
1488
 
909
- Validator documentation (jsdoc) update
910
- Validator support pass parameters to validator
1489
+ ---
911
1490
 
912
- #### 1.2.5
1491
+ ## [1.2.4]
913
1492
 
914
- Fix problem with test (user should be global on tests)
1493
+ - **[NEW]** Add eslint.
1494
+ - **[UPDATE]** Code refactor.
915
1495
 
916
- #### 1.2.4
1496
+ ---
917
1497
 
918
- Add eslint
919
- Code refactor
1498
+ ## [1.2.3]
920
1499
 
921
- #### 1.2.3
1500
+ - **[NEW]** Add prettier.
1501
+ - **[UPDATE]** Code reformat.
922
1502
 
923
- Add prettier
924
- Code reformat
1503
+ ---
925
1504
 
926
- #### 1.2.2
1505
+ ## [1.2.2]
927
1506
 
928
- Update deps
1507
+ - **[UPDATE]** Update deps.