@opengis/fastify-table 1.0.24 → 1.0.25

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/Changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # fastify-table
2
2
 
3
+ ## 1.0.25 - 08.05.2024
4
+
5
+ - decorator to hook
6
+
3
7
  ## 1.0.24 - 07.05.2024
4
8
 
5
9
  - getTemplate page
package/index.js CHANGED
@@ -22,7 +22,10 @@ async function plugin(fastify, opt) {
22
22
  fastify.decorate('config', config);
23
23
  }
24
24
  if (!fastify.funcs) {
25
- fastify.decorateRequest('funcs', fastify);
25
+ fastify.addHook('onRequest', async (req) => {
26
+ req.funcs = fastify;
27
+ });
28
+ // fastify.decorateRequest('funcs', fastify);
26
29
  }
27
30
 
28
31
  policyPlugin(fastify);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "main": "index.js",
@@ -9,7 +9,10 @@ import config from '../config.js';
9
9
  test('api crud xss', async (t) => {
10
10
  const app = await build(t);
11
11
  const session = { passport: { user: { uid: '1' } } };
12
- app.decorateRequest('session', session);
12
+ app.addHook('onRequest', async (req) => {
13
+ req.session = session;
14
+ });
15
+ // app.decorateRequest('session', session);
13
16
 
14
17
  const prefix = config.prefix || '/api';
15
18