@opengis/fastify-table 2.2.9 → 2.2.10

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/dist/functions.js CHANGED
@@ -18,7 +18,7 @@ const rclient = getRedis();
18
18
  const filename = fileURLToPath(import.meta.url);
19
19
  const cwd = path.dirname(filename);
20
20
  export async function onListen1() {
21
- const json = await getMenu({ user: { uid: "1" }, pg: client }, null);
21
+ const json = await getMenu({ user: { uid: "1" }, pg: client }, null).catch(); // prevent "too many clients already" from crashing the application
22
22
  // insert interface list to db (user access management)
23
23
  if (client?.pk?.["admin.routes"] && json?.menus?.length) {
24
24
  const menuList = json?.menus?.filter?.((el) => el?.table ||
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare function plugin(fastify: any): void;
1
+ declare function plugin(fastify: any): Promise<void>;
2
2
  declare const _default: typeof plugin;
3
3
  export default _default;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AA4FA,iBAAS,MAAM,CAAC,OAAO,EAAE,GAAG,QA8K3B;;AACD,wBAA0B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AA4FA,iBAAe,MAAM,CAAC,OAAO,EAAE,GAAG,iBAgLjC;;AACD,wBAEG"}
package/dist/index.js CHANGED
@@ -61,8 +61,9 @@ addHook("preTemplate", preTemplate);
61
61
  addHook("afterTemplate", afterTemplate);
62
62
  addHook("afterUpdate", afterUpdate);
63
63
  addHook("afterInsert", afterInsert);
64
- function plugin(fastify) {
64
+ async function plugin(fastify) {
65
65
  const opt = { prefix: "/api" };
66
+ // await new Promise(resolve => setTimeout(resolve, 50000)); // ! for debug, simulate Plugin did not start in time
66
67
  if (config.disableCors) {
67
68
  fastify.addHook("onSend", async (request, reply) => {
68
69
  reply.header("Access-Control-Allow-Origin", "*");
@@ -204,4 +205,6 @@ function plugin(fastify) {
204
205
  }
205
206
  });
206
207
  }
207
- export default fp(plugin);
208
+ export default fp(plugin, {
209
+ name: "@opengis/fastify-table",
210
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.2.9",
3
+ "version": "2.2.10",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [