@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 +1 -1
- package/package.json +1 -1
- package/server/plugins/crud/funcs/dataDelete.js +2 -2
- package/server/plugins/crud/funcs/dataInsert.js +1 -1
- package/server/plugins/crud/funcs/dataUpdate.js +1 -1
- package/server/plugins/pg/funcs/getPG.js +1 -0
- package/server/plugins/pg/funcs/getPGAsync.js +1 -0
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
|
@@ -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
|
|
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
|
|
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
|
|
61
|
+
throw err;
|
|
62
62
|
}).then(el => el || {});
|
|
63
63
|
|
|
64
64
|
const table1 = pg.pk[table] ? table : table.replace(/"/g, '');
|
|
@@ -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 {
|