@adaptivestone/framework 5.0.0-beta.3 → 5.0.0-beta.30

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