@nest-omni/core 3.1.2-2 → 3.1.2-6

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.
@@ -34,10 +34,7 @@ typeorm_1.SelectQueryBuilder.prototype.toDtoPage = function (pageOptionsDto, dto
34
34
  const pageSize = pageOptionsDto.pageSize || 10;
35
35
  const skip = (page - 1) * pageSize;
36
36
  const totalItems = yield this.getCount();
37
- const entities = yield this
38
- .skip(skip)
39
- .take(pageSize)
40
- .getMany();
37
+ const entities = yield this.skip(skip).take(pageSize).getMany();
41
38
  if (entities.length > 0) {
42
39
  console.log('Raw entity sample:', JSON.stringify(entities[0], null, 2));
43
40
  }
@@ -51,13 +48,11 @@ typeorm_1.SelectQueryBuilder.prototype.toDtoPage = function (pageOptionsDto, dto
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
+ itemCount,
52
+ page,
53
+ pageCount,
54
+ hasPreviousPage,
55
+ hasNextPage,
61
56
  };
62
57
  });
63
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-omni/core",
3
- "version": "3.1.2-2",
3
+ "version": "3.1.2-6",
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",
@@ -10,34 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.bootstrapSetup = bootstrapSetup;
13
- const crud_1 = require("@dataui/crud");
14
- crud_1.CrudConfigService.load({
15
- auth: {
16
- property: 'user',
17
- },
18
- params: {
19
- id: {
20
- field: 'id',
21
- type: 'string',
22
- primary: true,
23
- },
24
- },
25
- query: {
26
- limit: 10,
27
- alwaysPaginate: true,
28
- },
29
- routes: {
30
- updateOneBase: {
31
- allowParamsOverride: false,
32
- },
33
- deleteOneBase: {
34
- returnDeleted: false,
35
- },
36
- createOneBase: {
37
- returnShallow: false,
38
- },
39
- },
40
- });
41
13
  const Sentry = require("@sentry/nestjs");
42
14
  const profiling_node_1 = require("@sentry/profiling-node");
43
15
  const dotenv = require("dotenv");
@@ -106,6 +78,34 @@ Sentry.init({
106
78
  sendDefaultPii: true,
107
79
  integrations: [profiling_node_1.nodeProfilingIntegration],
108
80
  });
81
+ const crud_1 = require("@dataui/crud");
82
+ crud_1.CrudConfigService.load({
83
+ auth: {
84
+ property: 'user',
85
+ },
86
+ params: {
87
+ id: {
88
+ field: 'id',
89
+ type: 'string',
90
+ primary: true,
91
+ },
92
+ },
93
+ query: {
94
+ limit: 10,
95
+ alwaysPaginate: true,
96
+ },
97
+ routes: {
98
+ updateOneBase: {
99
+ allowParamsOverride: false,
100
+ },
101
+ deleteOneBase: {
102
+ returnDeleted: false,
103
+ },
104
+ createOneBase: {
105
+ returnShallow: false,
106
+ },
107
+ },
108
+ });
109
109
  const core_1 = require("@nestjs/core");
110
110
  const nestjs_pino_1 = require("nestjs-pino");
111
111
  const session = require("express-session");
@@ -119,7 +119,6 @@ const class_validator_1 = require("class-validator");
119
119
  const setup_1 = require("@sentry/nestjs/setup");
120
120
  const vault_1 = require("../vault");
121
121
  const dto_1 = require("../common/dto");
122
- const express_1 = require("express");
123
122
  function bootstrapSetup(AppModule, SetupSwagger) {
124
123
  return __awaiter(this, void 0, void 0, function* () {
125
124
  yield vault_1.VaultConfigLoader.loadVaultConfig();
@@ -140,10 +139,7 @@ function bootstrapSetup(AppModule, SetupSwagger) {
140
139
  app.enableShutdownHooks();
141
140
  app.enableVersioning();
142
141
  app.enable('trust proxy');
143
- app.use((0, express_1.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);