@opengis/fastify-table 1.2.97 → 1.2.99

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.2.97",
3
+ "version": "1.2.99",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -82,7 +82,7 @@ async function init(client) {
82
82
 
83
83
  const cacheData = await rclient.get(keyCache);
84
84
 
85
- if (cacheData) {
85
+ if (cacheData && !config.local) {
86
86
  // console.log('from cache', table, query);
87
87
  return JSON.parse(cacheData);
88
88
  }
@@ -72,7 +72,7 @@ export default function checkPolicy(req, reply) {
72
72
  && config.auth?.tokens?.includes?.(headers.token);
73
73
 
74
74
  if (validToken && !req?.user?.uid) {
75
- req.user = { uid: req.headers?.uid };
75
+ req.user = { uid: req.headers?.uid, user_type: (req.ip === '193.239.152.181' || config.debug) ? 'admin' : 'regular' };
76
76
  }
77
77
 
78
78
  /* === policy: public === */
@@ -1,8 +1,8 @@
1
1
  import routeData from '../../../routes/table/controllers/data.js';
2
2
 
3
- export default async function getData({ id, table, pg, filter, state, limit, page, search, user, sql, contextQuery, sufix }, reply, called) {
3
+ export default async function getData({ id, table, pg, filter, state, limit, page, search, user, order, sql, contextQuery, sufix }, reply, called) {
4
4
  const params = { table, id };
5
- const query = { filter, limit, page, search, sql, state };
5
+ const query = { filter, limit, page, search, sql, state, order };
6
6
  const result = await routeData({ pg, params, query, user, contextQuery, sufix }, reply, called);
7
7
  return result;
8
8
  }