@adaptivestone/framework 5.0.0-alpha.14 → 5.0.0-alpha.16

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### 5.0.0-alpha.16
2
+
3
+ [UPDATE] no warning of direct usage body and query
4
+ [UPDATE] update deps
5
+
6
+ ### 5.0.0-alpha.15
7
+
8
+ [BUG] fix bug with pagination
9
+ [UPDATE] update deps
10
+
1
11
  ### 5.0.0-alpha.14
2
12
 
3
13
  [NEW] add types for Abstract model (wip)
@@ -196,22 +196,22 @@ class AbstractController extends Base {
196
196
  errors: err.message,
197
197
  });
198
198
  }
199
- req.body = new Proxy(req.body, {
200
- get: (target, prop) => {
201
- this.logger.warn(
202
- 'Please not use "req.body" directly. Implement "request" and use "req.appInfo.request" ',
203
- );
204
- return target[prop];
205
- },
206
- });
207
- req.query = new Proxy(req.query, {
208
- get: (target, prop) => {
209
- this.logger.warn(
210
- 'Please not use "req.query" directly. Implement "query" and use "req.appInfo.query" ',
211
- );
212
- return target[prop];
213
- },
214
- });
199
+ // req.body = new Proxy(req.body, {
200
+ // get: (target, prop) => {
201
+ // this.logger.warn(
202
+ // 'Please not use "req.body" directly. Implement "request" and use "req.appInfo.request" ',
203
+ // );
204
+ // return target[prop];
205
+ // },
206
+ // });
207
+ // req.query = new Proxy(req.query, {
208
+ // get: (target, prop) => {
209
+ // this.logger.warn(
210
+ // 'Please not use "req.query" directly. Implement "query" and use "req.appInfo.query" ',
211
+ // );
212
+ // return target[prop];
213
+ // },
214
+ // });
215
215
 
216
216
  if (!routeObject.handler) {
217
217
  this.logger.error(`Route object have no handler defined`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptivestone/framework",
3
- "version": "5.0.0-alpha.14",
3
+ "version": "5.0.0-alpha.16",
4
4
  "description": "Adaptive stone node js framework",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -19,8 +19,9 @@ class Pagination extends AbstractMiddleware {
19
19
  async middleware(req, res, next) {
20
20
  let { limit, maxLimit } = this.params;
21
21
 
22
- limit = typeof limit !== 'number' ? parseInt(limit, 10) : 10;
23
- maxLimit = typeof maxLimit !== 'number' ? parseInt(maxLimit, 10) : 100;
22
+ limit = (typeof limit !== 'number' ? parseInt(limit, 10) : limit) || 10;
23
+ maxLimit =
24
+ (typeof maxLimit !== 'number' ? parseInt(maxLimit, 10) : maxLimit) || 100;
24
25
 
25
26
  req.appInfo.pagination = {};
26
27
  req.appInfo.pagination.page =