@munlib/common 1.0.160 → 1.0.162
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/build/errors/erroresStatus.js +2 -2
- package/build/errors/genericError.d.ts +2 -1
- package/build/errors/genericError.js +3 -2
- package/build/events/types/instituciones-pagos.d.ts +7 -4
- package/build/events/types/instituciones-pagos.js +8 -5
- package/build/middlewares/error-handler.js +3 -5
- package/package.json +1 -1
|
@@ -136,8 +136,8 @@ exports.errorCodes = {
|
|
|
136
136
|
"ERR_CANCELED": "La solicitud fue cancelada antes de completarse.",
|
|
137
137
|
//Errores Especificos PARA EL USURIO
|
|
138
138
|
"MIDDLEWARE": "Error interno de Sistema. Inténtelo nuevamente más tarde.",
|
|
139
|
-
"
|
|
140
|
-
"
|
|
139
|
+
"USER": "",
|
|
140
|
+
"SINTAX": "Hemos encontrado un problema al procesar su solicitud. Inténtelo nuevamente más tarde.",
|
|
141
141
|
"SUCCESS": "",
|
|
142
142
|
};
|
|
143
143
|
exports.statusCodeMapping = {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { CustomError } from './custom-error';
|
|
2
2
|
export declare class GenericError extends CustomError {
|
|
3
3
|
msg: string;
|
|
4
|
+
httpStatus: number;
|
|
4
5
|
code: string;
|
|
5
6
|
typeError: string;
|
|
6
7
|
userMsg: string;
|
|
7
8
|
statusCode: number;
|
|
8
|
-
constructor(msg: string, // Mensaje principal del error
|
|
9
|
+
constructor(msg: string, httpStatus: number, // Mensaje principal del error
|
|
9
10
|
code?: string, // Código de estado (por defecto 500)
|
|
10
11
|
typeError?: string, // Tipo de error opcional
|
|
11
12
|
userMsg?: string);
|
|
@@ -20,7 +20,7 @@ var custom_error_1 = require("./custom-error"); // Asegúrate de importar tu cla
|
|
|
20
20
|
var erroresStatus_1 = require("./erroresStatus");
|
|
21
21
|
var GenericError = /** @class */ (function (_super) {
|
|
22
22
|
__extends(GenericError, _super);
|
|
23
|
-
function GenericError(msg, // Mensaje principal del error
|
|
23
|
+
function GenericError(msg, httpStatus, // Mensaje principal del error
|
|
24
24
|
code, // Código de estado (por defecto 500)
|
|
25
25
|
typeError, // Tipo de error opcional
|
|
26
26
|
userMsg // Mensaje amigable para el usuario
|
|
@@ -30,10 +30,11 @@ var GenericError = /** @class */ (function (_super) {
|
|
|
30
30
|
if (userMsg === void 0) { userMsg = "Hemos encontrado un problema. Inténtelo nuevamente más tarde."; }
|
|
31
31
|
var _this = _super.call(this, msg, typeError, userMsg) || this;
|
|
32
32
|
_this.msg = msg;
|
|
33
|
+
_this.httpStatus = httpStatus;
|
|
33
34
|
_this.code = code;
|
|
34
35
|
_this.typeError = typeError;
|
|
35
36
|
_this.userMsg = userMsg;
|
|
36
|
-
_this.statusCode =
|
|
37
|
+
_this.statusCode = _this.httpStatus;
|
|
37
38
|
_this.msg = erroresStatus_1.ErrorController.getErrorMessage(code) || _this.message;
|
|
38
39
|
Object.setPrototypeOf(_this, GenericError.prototype);
|
|
39
40
|
return _this;
|
|
@@ -25,8 +25,11 @@ export declare enum EstadoSolPagoTypeEnum {
|
|
|
25
25
|
CLIR = "CLIR",
|
|
26
26
|
ECAN = "ECAN"
|
|
27
27
|
}
|
|
28
|
-
export declare enum
|
|
29
|
-
|
|
28
|
+
export declare enum ErrorCategories {
|
|
29
|
+
MIDDLEWARE = "MIDDLEWARE",
|
|
30
|
+
USER = "USER",
|
|
31
|
+
SINTAX = "SINTAX",
|
|
32
|
+
SUCCESS = "SUCCESS"
|
|
30
33
|
}
|
|
31
34
|
export declare enum FormaPagoEnum {
|
|
32
35
|
EFE = "EFE"
|
|
@@ -45,7 +48,7 @@ export declare enum EstadoPagoTypeEnum {
|
|
|
45
48
|
ECAN = "ECAN"
|
|
46
49
|
}
|
|
47
50
|
export interface EtapaSolPagosEntries {
|
|
48
|
-
Ientidadexterna:
|
|
51
|
+
Ientidadexterna: string;
|
|
49
52
|
Icuentabancaria: string;
|
|
50
53
|
Iformapago: FormaPago;
|
|
51
54
|
Icanaltransacional: CanalTransacionalOptions;
|
|
@@ -58,7 +61,7 @@ export interface EtapaSolPagosOutput {
|
|
|
58
61
|
oNumTransaccion: number;
|
|
59
62
|
}
|
|
60
63
|
export interface EtapaConfirmarPagoEntries {
|
|
61
|
-
Ientidadexterna:
|
|
64
|
+
Ientidadexterna: string;
|
|
62
65
|
Icuentabancaria?: string;
|
|
63
66
|
Iformapago: FormaPago;
|
|
64
67
|
Icanaltransacional: CanalTransacionalOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EstadoPagoTypeEnum = exports.FormaPagoEnum = exports.
|
|
3
|
+
exports.EstadoPagoTypeEnum = exports.FormaPagoEnum = exports.ErrorCategories = exports.EstadoSolPagoTypeEnum = exports.CanalTransacionalOptionsEnum = void 0;
|
|
4
4
|
var CanalTransacionalOptionsEnum;
|
|
5
5
|
(function (CanalTransacionalOptionsEnum) {
|
|
6
6
|
CanalTransacionalOptionsEnum["VENT"] = "VENT";
|
|
@@ -25,10 +25,13 @@ var EstadoSolPagoTypeEnum;
|
|
|
25
25
|
EstadoSolPagoTypeEnum["CLIR"] = "CLIR";
|
|
26
26
|
EstadoSolPagoTypeEnum["ECAN"] = "ECAN";
|
|
27
27
|
})(EstadoSolPagoTypeEnum || (exports.EstadoSolPagoTypeEnum = EstadoSolPagoTypeEnum = {}));
|
|
28
|
-
var
|
|
29
|
-
(function (
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
var ErrorCategories;
|
|
29
|
+
(function (ErrorCategories) {
|
|
30
|
+
ErrorCategories["MIDDLEWARE"] = "MIDDLEWARE";
|
|
31
|
+
ErrorCategories["USER"] = "USER";
|
|
32
|
+
ErrorCategories["SINTAX"] = "SINTAX";
|
|
33
|
+
ErrorCategories["SUCCESS"] = "SUCCESS";
|
|
34
|
+
})(ErrorCategories || (exports.ErrorCategories = ErrorCategories = {}));
|
|
32
35
|
var FormaPagoEnum;
|
|
33
36
|
(function (FormaPagoEnum) {
|
|
34
37
|
FormaPagoEnum["EFE"] = "EFE";
|
|
@@ -6,16 +6,14 @@ var erroresStatus_1 = require("../errors/erroresStatus");
|
|
|
6
6
|
var errorHandler = function (err, req, res, next) {
|
|
7
7
|
var statusCode = 500; // Código de estado por defecto para errores genéricos
|
|
8
8
|
if (err instanceof custom_error_1.CustomError) {
|
|
9
|
-
console.log("ENTRA A CUSTOM ERROR******");
|
|
10
9
|
return res.status(err.statusCode).send(err.serializeErrors());
|
|
11
10
|
}
|
|
12
|
-
console.log("NO===> ENTRA A CUSTOM ERROR");
|
|
13
11
|
res.status(statusCode).send({
|
|
14
|
-
status: erroresStatus_1.ErrorController.getGeneralStatus(statusCode.toString()),
|
|
12
|
+
status: erroresStatus_1.ErrorController.getGeneralStatus(statusCode.toString()) || "error",
|
|
15
13
|
msg: err.message, // Agregar el código de estado al objeto de errores
|
|
16
14
|
code: statusCode,
|
|
17
|
-
typeError: "
|
|
18
|
-
userMsg: ""
|
|
15
|
+
typeError: "MIDDLEWARE",
|
|
16
|
+
userMsg: erroresStatus_1.ErrorController.getErrorMessage("MIDDLEWARE")
|
|
19
17
|
});
|
|
20
18
|
};
|
|
21
19
|
exports.errorHandler = errorHandler;
|