@nest-omni/core 3.1.2-3 → 3.1.2-7

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.
@@ -33,31 +33,27 @@ typeorm_1.SelectQueryBuilder.prototype.toDtoPage = function (pageOptionsDto, dto
33
33
  const page = pageOptionsDto.page || 1;
34
34
  const pageSize = pageOptionsDto.pageSize || 10;
35
35
  const skip = (page - 1) * pageSize;
36
- const totalItems = yield this.getCount();
37
- const entities = yield this
38
- .skip(skip)
39
- .take(pageSize)
40
- .getMany();
41
- if (entities.length > 0) {
36
+ const total = yield this.getCount();
37
+ const entities = yield this.skip(skip).take(pageSize).getMany();
38
+ const count = entities.length;
39
+ if (count) {
42
40
  console.log('Raw entity sample:', JSON.stringify(entities[0], null, 2));
43
41
  }
44
42
  const data = yield entities.toDto(dtoClass, context);
45
43
  if (data.length > 0) {
46
44
  console.log('Converted DTO sample:', JSON.stringify(data[0], null, 2));
47
45
  }
48
- const itemCount = totalItems;
49
- const pageCount = Math.ceil(itemCount / pageSize);
46
+ const pageCount = Math.ceil(total / pageSize);
50
47
  const hasPreviousPage = page > 1;
51
48
  const hasNextPage = page < pageCount;
52
49
  return {
53
50
  data,
54
- meta: {
55
- itemCount,
56
- page,
57
- pageCount,
58
- hasPreviousPage,
59
- hasNextPage,
60
- },
51
+ count,
52
+ total,
53
+ page,
54
+ pageCount,
55
+ hasPreviousPage,
56
+ hasNextPage,
61
57
  };
62
58
  });
63
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-omni/core",
3
- "version": "3.1.2-3",
3
+ "version": "3.1.2-7",
4
4
  "description": "A comprehensive NestJS framework for building enterprise-grade applications with best practices",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -139,11 +139,7 @@ function bootstrapSetup(AppModule, SetupSwagger) {
139
139
  app.enableShutdownHooks();
140
140
  app.enableVersioning();
141
141
  app.enable('trust proxy');
142
- app.set('query parser', 'extended');
143
- app.use(bodyParse.urlencoded({
144
- extended: true,
145
- parameterLimit: 1000,
146
- }), bodyParse.json({ limit: '50mb' }), new nestjs_cls_1.ClsMiddleware({
142
+ app.use(bodyParse.json({ limit: '50mb' }), new nestjs_cls_1.ClsMiddleware({
147
143
  saveReq: true,
148
144
  }).use, (0, __1.RequestIdMiddleware)(), (0, __1.PowerByMiddleware)(), (0, __1.OmniAuthMiddleware)(), compression());
149
145
  const reflector = app.get(core_1.Reflector);