@dwtechs/antity-pgsql 0.17.7 → 0.18.0

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.
@@ -69,7 +69,7 @@ function execute(query, args, clt) {
69
69
  return res;
70
70
  })
71
71
  .catch((err) => {
72
- err.msg = `Postgre error: ${err.message}`;
72
+ err.message = `Postgre error: ${err.message}`;
73
73
  throw err;
74
74
  });
75
75
  }
@@ -278,7 +278,7 @@ class Select {
278
278
  return execute(query, args, client)
279
279
  .then((r) => {
280
280
  if (!r.rowCount)
281
- throw { status: 404, msg: "Resource not found" };
281
+ throw { status: 404, message: "Resource not found" };
282
282
  const f = r.rows[0];
283
283
  if (f.total) {
284
284
  r.total = Number(f.total);
@@ -811,10 +811,10 @@ class SQLEntity extends Entity {
811
811
  const cId = l.consumer?.id;
812
812
  const cName = l.consumer?.nickname;
813
813
  if (!conflictTarget) {
814
- return next({ status: 400, msg: "Missing conflictTarget for upsert operation" });
814
+ return next({ status: 400, message: "Missing conflictTarget for upsert operation" });
815
815
  }
816
816
  if (!rows || !Array.isArray(rows) || rows.length === 0) {
817
- return next({ status: 400, msg: "Missing or empty rows array for upsert operation" });
817
+ return next({ status: 400, message: "Missing or empty rows array for upsert operation" });
818
818
  }
819
819
  log.debug(() => `${LOGS_PREFIX}upsert(rows=${rows.length}, conflictTarget=${conflictTarget}, consumerId=${cId})`);
820
820
  const rtn = this.ups.rtn("id");
@@ -881,7 +881,7 @@ class SQLEntity extends Entity {
881
881
  const id = req.params.id;
882
882
  const dbClient = res.locals.dbClient || null;
883
883
  if (!id) {
884
- next({ status: 400, msg: "Missing id" });
884
+ next({ status: 400, message: "Missing id" });
885
885
  return;
886
886
  }
887
887
  log.debug(() => `${LOGS_PREFIX}getHistory(schema=${this._schema}, table=${this._table}, id=${id})`);
@@ -897,7 +897,7 @@ class SQLEntity extends Entity {
897
897
  .then((r) => {
898
898
  const { rowCount, rows } = r;
899
899
  if (!rowCount) {
900
- return next({ status: 404, msg: "History not found" });
900
+ return next({ status: 404, message: "History not found" });
901
901
  }
902
902
  res.locals.history = rows;
903
903
  res.locals.total = rowCount;
@@ -912,7 +912,7 @@ class SQLEntity extends Entity {
912
912
  const cId = l.consumer?.id;
913
913
  const cName = l.consumer?.nickname;
914
914
  if (!rows || !Array.isArray(rows)) {
915
- return next({ status: 400, msg: "Missing or invalid rows array for sync operation" });
915
+ return next({ status: 400, message: "Missing or invalid rows array for sync operation" });
916
916
  }
917
917
  log.debug(() => `${LOGS_PREFIX}sync(rows=${rows.length}, idField=${idField}, consumerId=${cId})`);
918
918
  const cleanedFilters = cleanFilters(req.body.filters, this.properties) || null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dwtechs/antity-pgsql",
3
- "version": "0.17.7",
3
+ "version": "0.18.0",
4
4
  "description": "Open source library to add PostgreSQL support to @dwtechs/Antity entities.",
5
5
  "keywords": [
6
6
  "entities"