ismx-nexo-node-app 0.4.55 → 0.4.57

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.
@@ -229,7 +229,7 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
229
229
  let values = [];
230
230
  for (let [key, value] of elements) {
231
231
  let colum = PostgresUtils_1.default.camelToSnake(key);
232
- if (key !== "id" && !columns.includes(colum))
232
+ if (key !== "id" && !columns.includes(colum.replace(/"/g, '')))
233
233
  continue;
234
234
  if (alias !== "")
235
235
  alias += ".";
@@ -48,10 +48,10 @@ class RepositoryRest extends Repository_1.default {
48
48
  return call.then((res) => __awaiter(this, void 0, void 0, function* () {
49
49
  var _a, _b, _c, _d, _e;
50
50
  let headers = {};
51
- res.headers.forEach((value, key) => headers[key] = value);
51
+ res.headers.forEach((value, key) => headers[key.toLowerCase()] = value);
52
52
  let content = yield res.text();
53
53
  (_b = (_a = this.options).onRawResponse) === null || _b === void 0 ? void 0 : _b.call(_a, request, content);
54
- if ((_c = headers['Content-Type']) === null || _c === void 0 ? void 0 : _c.startsWith('application/json'))
54
+ if ((_c = headers['content-type']) === null || _c === void 0 ? void 0 : _c.startsWith('application/json'))
55
55
  content = JSON.parse(content, this.reviver);
56
56
  let response = { httpCode: res.status, content: content, headers };
57
57
  (_e = (_d = this.options) === null || _d === void 0 ? void 0 : _d.onResponse) === null || _e === void 0 ? void 0 : _e.call(_d, request, response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.55",
3
+ "version": "0.4.57",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -202,7 +202,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
202
202
 
203
203
  for (let [key, value] of elements) {
204
204
  let colum = PostgresUtils.camelToSnake(key)
205
- if (key !== "id" && !columns.includes(colum)) continue;
205
+ if (key !== "id" && !columns.includes(colum.replace(/"/g, ''))) continue;
206
206
  if (alias !== "") alias += "."
207
207
  if (value instanceof Array) where += ` AND ${alias}${colum} = ANY(\$${iter++})`
208
208
  else where += ` AND ${alias}${colum}=\$${iter++}`
@@ -59,11 +59,11 @@ export default class RepositoryRest<Body=any,Res=any> extends Repository
59
59
 
60
60
  // Añade información adicional a la respuesta y devuelve el resultado (o el error en su caso).
61
61
  return call.then(async (res: Response) => {
62
- let headers: any = {}; res.headers.forEach((value, key) => headers[key] = value);
62
+ let headers: any = {}; res.headers.forEach((value, key) => headers[key.toLowerCase()] = value);
63
63
  let content: string | E = await res.text();
64
64
  this.options.onRawResponse?.(request, content);
65
65
 
66
- if (headers['Content-Type']?.startsWith('application/json'))
66
+ if (headers['content-type']?.startsWith('application/json'))
67
67
  content = JSON.parse(content, this.reviver) as E;
68
68
 
69
69
  let response: HttpResponse<E> = { httpCode: res.status, content: content as E, headers };