@opengis/fastify-table 1.3.69 → 1.3.71

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/index.js CHANGED
@@ -102,6 +102,6 @@ async function plugin(fastify, opt) {
102
102
  propertiesRoutes(fastify, opt);
103
103
  tableRoutes(fastify, opt);
104
104
  utilRoutes(fastify, opt);
105
- fastify.get('/api/test-proxy', {}, (req) => req.headers);
105
+ fastify.get('/api/test-proxy', {}, (req) => ({ ...req.headers || {}, sessionId: req.session?.sessionId }));
106
106
  }
107
107
  export default fp(plugin);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.3.69",
3
+ "version": "1.3.71",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -29,7 +29,7 @@ export default async function dataDelete({
29
29
  logger.file('crud/delete', {
30
30
  error: err.toString(), stack: err.stack, table, id, referer, uid,
31
31
  });
32
- throw new Error(err.toString());
32
+ throw new Error(err);
33
33
  });
34
34
  const table1 = table.replace(/"/g, '');
35
35
  if (!pg.tlist?.includes(table1)) return 'table not exist';
@@ -44,7 +44,7 @@ export default async function dataDelete({
44
44
  logger.file('crud/delete', {
45
45
  error: err.toString(), stack: err.stack, table, id, referer, uid, q: delQuery,
46
46
  });
47
- throw new Error(err.toString());
47
+ throw err;
48
48
  })
49
49
  .then(el => el.rows?.[0] || {});
50
50
 
@@ -58,7 +58,7 @@ export default async function dataInsert({
58
58
  logger.file('crud/insert', {
59
59
  error: err.toString(), stack: err.stack, table, id, referer, uid, q: insertQuery,
60
60
  });
61
- throw new Error(err.toString());
61
+ throw err;
62
62
  }).then(el => el || {});
63
63
 
64
64
  const table1 = pg.pk[table] ? table : table.replace(/"/g, '');
@@ -83,7 +83,7 @@ export default async function dataUpdate({
83
83
  data,
84
84
  q: updateQuery,
85
85
  });
86
- throw new Error(err.toString());
86
+ throw err;
87
87
  })
88
88
  .then(el => el?.rows?.[0]) || {};
89
89
 
@@ -11,6 +11,7 @@ import init from './init.js';
11
11
  import getDBParams from './getDBParams.js';
12
12
 
13
13
  function getPG(param) {
14
+ if (!config.pg) return null;
14
15
  const dbListParams = dblist.find(el => el.key === param?.key)
15
16
  || dblist.find(el => el.database === (param?.db || param?.database || param) && el.port === param?.port);
16
17
  const {
@@ -11,6 +11,7 @@ import init from './init.js';
11
11
  import getDBParams from './getDBParams.js';
12
12
 
13
13
  async function getPGAsync(param) {
14
+ if (!config.pg) return null;
14
15
  const dbListParams = dblist.find(el => el.key === param?.key)
15
16
  || dblist.find(el => el.database === (param?.db || param?.database || param) && el.port === param?.port);
16
17
  const {