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

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