@obisey/nest 0.1.20 → 0.1.21

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.
@@ -0,0 +1,4 @@
1
+ import { ExceptionFilter, ArgumentsHost, HttpException } from '@nestjs/common';
2
+ export declare class HttpExceptionFilter implements ExceptionFilter {
3
+ catch(exception: HttpException, host: ArgumentsHost): void;
4
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.HttpExceptionFilter = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ let HttpExceptionFilter = class HttpExceptionFilter {
12
+ catch(exception, host) {
13
+ const ctx = host.switchToHttp();
14
+ const response = ctx.getResponse();
15
+ const request = ctx.getRequest();
16
+ const status = exception instanceof common_1.HttpException
17
+ ? exception.getStatus()
18
+ : common_1.HttpStatus.INTERNAL_SERVER_ERROR;
19
+ const err = exception.message;
20
+ console.log(exception, response, request, status, err);
21
+ try {
22
+ response.status(status).json({
23
+ statusCode: status,
24
+ timestamp: new Date().toISOString(),
25
+ path: request.url,
26
+ err: err,
27
+ });
28
+ }
29
+ catch (err) {
30
+ console.log(err);
31
+ }
32
+ }
33
+ };
34
+ exports.HttpExceptionFilter = HttpExceptionFilter;
35
+ exports.HttpExceptionFilter = HttpExceptionFilter = __decorate([
36
+ (0, common_1.Catch)(common_1.HttpException)
37
+ ], HttpExceptionFilter);
@@ -0,0 +1 @@
1
+ export declare const REDIS_CLIENT: unique symbol;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REDIS_CLIENT = void 0;
4
+ exports.REDIS_CLIENT = Symbol('Starconsole_REDIS');
package/index.d.ts CHANGED
@@ -9,5 +9,7 @@ export * from './prototipos/utils/activarRedis';
9
9
  export * from './prototipos/utils/formarInclude';
10
10
  export * from './prototipos/utils/formarorder';
11
11
  export * from './prototipos/utils/formarwhere';
12
+ export * from './assets/http-exception.filter';
13
+ export * from './assets/tokens';
12
14
  export * from './types';
13
15
  export * from './fecha';
package/index.js CHANGED
@@ -26,5 +26,7 @@ __exportStar(require("./prototipos/utils/activarRedis"), exports);
26
26
  __exportStar(require("./prototipos/utils/formarInclude"), exports);
27
27
  __exportStar(require("./prototipos/utils/formarorder"), exports);
28
28
  __exportStar(require("./prototipos/utils/formarwhere"), exports);
29
+ __exportStar(require("./assets/http-exception.filter"), exports);
30
+ __exportStar(require("./assets/tokens"), exports);
29
31
  __exportStar(require("./types"), exports);
30
32
  __exportStar(require("./fecha"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obisey/nest",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "NestJS utilities and base classes by Obisey",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -40,6 +40,7 @@
40
40
  "reflect-metadata": "^0.2.2",
41
41
  "sequelize": "^6.37.7",
42
42
  "sequelize-typescript": "^2.1.6",
43
- "typescript": "^5.8.3"
43
+ "typescript": "^5.8.3",
44
+ "express": "^5.0.0"
44
45
  }
45
46
  }
@@ -1 +1 @@
1
- export declare function onRedis(datos: any, si?: boolean): boolean;
1
+ export declare function onRedis(datos: any, si?: boolean): any;
@@ -1,4 +1,4 @@
1
- export declare const formarInclude: (include: any, mapa: any, tipo: any, conexion: any, required?: boolean) => any;
1
+ export declare const formarInclude: (include: any, mapa: any, tipo: any, conexion: any, required?: boolean) => Promise<any>;
2
2
  declare class FilterBasic {
3
3
  is: string;
4
4
  }
@@ -1 +1 @@
1
- export declare const formarWhere: (where: any) => {};
1
+ export declare const formarWhere: (where: any) => any;