@opengis/fastify-table 1.3.74 → 1.3.76

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
@@ -35,9 +35,11 @@ import execMigrations from './server/plugins/migration/exec.migrations.js';
35
35
  import locales from './server/routes/table/controllers/utils/locales.js';
36
36
  import pgClients from './server/plugins/pg/pgClients.js';
37
37
 
38
- import dataPlugin from './server/routes/data/index.mjs';
39
- import menuPlugin from './server/routes/menu/index.mjs';
40
- import templatesPlugin from './server/routes/templates/index.mjs';
38
+ import dblistRoutes from './server/routes/dblist/index.mjs';
39
+
40
+ import dataRoutes from './server/routes/data/index.mjs';
41
+ import menuRoutes from './server/routes/menu/index.mjs';
42
+ import templatesRoutes from './server/routes/templates/index.mjs';
41
43
 
42
44
  // core templates && cls
43
45
  const filename = fileURLToPath(import.meta.url);
@@ -99,6 +101,10 @@ async function plugin(fastify, opt) {
99
101
  cronPlugin(fastify, opt);
100
102
  loggerPlugin(fastify, opt);
101
103
 
104
+ if (config.dblist) {
105
+ dblistRoutes(fastify, opt);
106
+ }
107
+
102
108
  // routes / api
103
109
  cronRoutes(fastify, opt);
104
110
  crudRoutes(fastify, opt);
@@ -107,9 +113,9 @@ async function plugin(fastify, opt) {
107
113
  tableRoutes(fastify, opt);
108
114
  utilRoutes(fastify, opt);
109
115
 
110
- dataPlugin(fastify, opt);
111
- menuPlugin(fastify, opt);
112
- templatesPlugin(fastify, opt);
116
+ dataRoutes(fastify, opt);
117
+ menuRoutes(fastify, opt);
118
+ templatesRoutes(fastify, opt);
113
119
 
114
120
  fastify.get('/api/test-proxy', {}, (req) => ({ ...req.headers || {}, sessionId: req.session?.sessionId }));
115
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.3.74",
3
+ "version": "1.3.76",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -4,16 +4,15 @@ import setItem from './controllers/setItem.js';
4
4
  const policy = ['site'];
5
5
 
6
6
  export default async function plugin(app, config = {}) {
7
- const { prefix = '/api' } = config;
8
7
  app.route({
9
8
  method: 'GET',
10
- url: `${prefix}/db-list`,
9
+ url: '/db-list',
11
10
  config: { policy },
12
11
  handler: readItemList,
13
12
  });
14
13
  app.route({
15
14
  method: 'GET',
16
- url: `${prefix}/db-list/:id`,
15
+ url: '/db-list/:id',
17
16
  config: { policy },
18
17
  handler: setItem,
19
18
  });
@@ -39,7 +39,7 @@ export default async function adminMenu({
39
39
  }, reply) {
40
40
  const time = Date.now();
41
41
 
42
- if (!user.uid) {
42
+ if (!user.uid && !config.auth?.disable) {
43
43
  return reply.status(403).send('access restricted');
44
44
  }
45
45