ismx-nexo-node-app 0.3.68 → 0.3.70

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.
@@ -37,7 +37,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
38
  const Service_1 = require("../api/Service");
39
39
  const Business_1 = __importDefault(require("./Business"));
40
- const BusinessErrors_1 = require("../business/BusinessErrors");
41
40
  class BusinessServer extends Business_1.default {
42
41
  constructor() {
43
42
  super();
@@ -101,7 +100,7 @@ class BusinessServer extends Business_1.default {
101
100
  }
102
101
  run(service) {
103
102
  return (request, socket) => __awaiter(this, void 0, void 0, function* () {
104
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
103
+ var _a, _b, _c, _d, _e, _f, _g, _h;
105
104
  let code;
106
105
  let response = Service_1.HttpResponse.ko(500, "Internal server error");
107
106
  // Asigna un valor único a la llamada de la API.
@@ -129,16 +128,14 @@ class BusinessServer extends Business_1.default {
129
128
  catch (e) { }
130
129
  if (error instanceof Service_1.HttpResponse)
131
130
  response = error;
132
- if (error instanceof BusinessErrors_1.FormalError)
133
- response = error.type;
134
131
  else
135
- response = Service_1.HttpResponse.ko((_g = error.httpCode) !== null && _g !== void 0 ? _g : 500, error.content);
132
+ response = Service_1.HttpResponse.ko(500, null);
136
133
  }
137
134
  finally {
138
- let status = (_h = response === null || response === void 0 ? void 0 : response.httpCode) !== null && _h !== void 0 ? _h : 500;
135
+ let status = (_g = response === null || response === void 0 ? void 0 : response.httpCode) !== null && _g !== void 0 ? _g : 500;
139
136
  socket.status(status).send(response === null || response === void 0 ? void 0 : response.content);
140
137
  try {
141
- (_j = this.onEnd) === null || _j === void 0 ? void 0 : _j.call(this, request, response);
138
+ (_h = this.onEnd) === null || _h === void 0 ? void 0 : _h.call(this, request, response);
142
139
  }
143
140
  catch (e) { }
144
141
  }
package/dist/js/index.js CHANGED
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.RestUtils = exports.QueryUtils = exports.RepositoryRestFormalTemplate = exports.RepositoryRestFormal = exports.RepositoryRest = exports.RepositoryDatabasePostgres = exports.RepositoryDatabase = exports.Repository = exports.StringUtils = exports.NumberUtils = exports.CryptoUtils = exports.BusinessLogger = exports.BusinessErrors = exports.BusinessThread = exports.BusinessServer = exports.BusinessProxy = exports.BusinessState = exports.Business = exports.ColorUtils = exports.ServiceRestFormalTemplate = exports.ServiceRestFormal = exports.ServiceRest = exports.HttpResponse = exports.Service = void 0;
29
+ exports.RestUtils = exports.QueryUtils = exports.RepositoryRestFormalTemplate = exports.RepositoryRestFormal = exports.RepositoryRest = exports.RepositoryDatabasePostgres = exports.RepositoryDatabase = exports.Repository = exports.StringUtils = exports.NumberUtils = exports.CryptoUtils = exports.BusinessLogger = exports.FormalError = exports.BusinessErrors = exports.BusinessThread = exports.BusinessServer = exports.BusinessProxy = exports.BusinessState = exports.Business = exports.ColorUtils = exports.ServiceRestFormalTemplate = exports.ServiceRestFormal = exports.ServiceRest = exports.HttpResponse = exports.Service = void 0;
30
30
  const Service_1 = __importStar(require("./api/Service"));
31
31
  class Service extends Service_1.default {
32
32
  }
@@ -71,10 +71,13 @@ const BusinessThread_1 = __importDefault(require("./business/BusinessThread"));
71
71
  class BusinessThread extends BusinessThread_1.default {
72
72
  }
73
73
  exports.BusinessThread = BusinessThread;
74
- const BusinessErrors_1 = __importDefault(require("./business/BusinessErrors"));
74
+ const BusinessErrors_1 = __importStar(require("./business/BusinessErrors"));
75
75
  class BusinessErrors extends BusinessErrors_1.default {
76
76
  }
77
77
  exports.BusinessErrors = BusinessErrors;
78
+ class FormalError extends BusinessErrors_1.FormalError {
79
+ }
80
+ exports.FormalError = FormalError;
78
81
  const BusinessLogger_1 = __importDefault(require("./business/BusinessLogger"));
79
82
  class BusinessLogger extends BusinessLogger_1.default {
80
83
  }
@@ -37,10 +37,12 @@ export declare class BusinessServer extends _BusinessServer {
37
37
  import BaseBusinessThread from "./business/BusinessThread";
38
38
  export declare abstract class BusinessThread extends BaseBusinessThread {
39
39
  }
40
- import BaseBusinessErrors, { ErrorType as BaseFormalError } from "./business/BusinessErrors";
40
+ import BaseBusinessErrors, { ErrorType as _ErrorType, FormalError as _FormalError } from "./business/BusinessErrors";
41
41
  export declare class BusinessErrors extends BaseBusinessErrors {
42
42
  }
43
- export interface FormalError extends BaseFormalError {
43
+ export interface ErrorType extends _ErrorType {
44
+ }
45
+ export declare class FormalError extends _FormalError {
44
46
  }
45
47
  import BaseBusinessLogger from "./business/BusinessLogger";
46
48
  export declare class BusinessLogger extends BaseBusinessLogger {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.3.68",
3
+ "version": "0.3.70",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -1,6 +1,5 @@
1
1
  import Service, {HttpRequest, HttpResponse} from "../api/Service";
2
2
  import Business from "./Business";
3
- import {FormalError} from "../business/BusinessErrors";
4
3
 
5
4
  export default class BusinessServer extends Business
6
5
  {
@@ -90,8 +89,7 @@ export default class BusinessServer extends Business
90
89
  } catch (error: any) {
91
90
  try { error = this.onError?.(request, error); } catch (e) { }
92
91
  if (error instanceof HttpResponse) response = error;
93
- if (error instanceof FormalError) response = error.type;
94
- else response = HttpResponse.ko(error.httpCode ?? 500, error.content);
92
+ else response = HttpResponse.ko(500, null);
95
93
 
96
94
  } finally {
97
95
  let status = response?.httpCode ?? 500;
@@ -34,9 +34,10 @@ export class BusinessServer extends _BusinessServer {}
34
34
  import BaseBusinessThread from "./business/BusinessThread";
35
35
  export abstract class BusinessThread extends BaseBusinessThread {}
36
36
 
37
- import BaseBusinessErrors, { ErrorType as BaseFormalError } from "./business/BusinessErrors";
37
+ import BaseBusinessErrors, { ErrorType as _ErrorType, FormalError as _FormalError} from "./business/BusinessErrors";
38
38
  export class BusinessErrors extends BaseBusinessErrors {}
39
- export interface FormalError extends BaseFormalError {}
39
+ export interface ErrorType extends _ErrorType {}
40
+ export class FormalError extends _FormalError {}
40
41
 
41
42
  import BaseBusinessLogger from "./business/BusinessLogger";
42
43
  export class BusinessLogger extends BaseBusinessLogger {}