@opengis/fastify-table 2.6.7 → 2.6.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"getAccess.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/crud/funcs/getAccess.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;GASG;AAEH,wBAA8B,SAAS,CACrC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAS,EAAE,MAAc,EAAE,EAAE,GAAG,EACzD,EAAE,MAAmB,sBA4HtB"}
1
+ {"version":3,"file":"getAccess.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/crud/funcs/getAccess.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;GASG;AAEH,wBAA8B,SAAS,CACrC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAS,EAAE,MAAc,EAAE,EAAE,GAAG,EACzD,EAAE,MAAmB,sBA8HtB"}
@@ -24,7 +24,7 @@ left join admin.user_roles d on
24
24
  then d.expiration > CURRENT_DATE
25
25
  else 1=1
26
26
  end )
27
- where $1 in (a.route_id, a.alias, a.table_name) and $2 in (b.user_uid, d.user_uid)`;
27
+ where ($1 in (a.route_id, a.table_name, a.alias) or $2 in (a.route_id, a.table_name, a.alias)) and $3 in (b.user_uid, d.user_uid)`;
28
28
  /**
29
29
  * @param {Array} user_roles.actions Actions - user actions <> group actions
30
30
  * @param {Array} role_access.actions Actions - user actions = group actions
@@ -112,7 +112,9 @@ export default async function getAccess({ resource, table, form, user = {}, meth
112
112
  pg.pk?.["admin.role_access"] &&
113
113
  pg.pk?.["admin.roles"] &&
114
114
  pg.pk?.["admin.user_roles"]
115
- ? await pg.query(q, [table, uid]).then((el) => ({
115
+ ? await pg
116
+ .query(q, [table.replace(/\.table$/, ""), table, uid])
117
+ .then((el) => ({
116
118
  ...(el.rows[0] || {}),
117
119
  roles: el.rows?.map?.((row) => row.role_id) || [],
118
120
  actions: el.rows?.map?.((row) => row.actions).flat() || [],
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/plugins/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAqE7E,iBAAS,YAAY,CAAC,OAAO,EAAE,eAAe,QAmD7C;AACD,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/plugins/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAgC,MAAM,SAAS,CAAC;AAqE7E,iBAAS,YAAY,CAAC,OAAO,EAAE,eAAe,QAsD7C;AACD,eAAe,YAAY,CAAC"}
@@ -89,7 +89,10 @@ function loggerPlugin(fastify) {
89
89
  });
90
90
  });
91
91
  fastify.addHook("onListen", async () => {
92
- logger.file("init", { db: pgClients.client?.options?.database });
92
+ logger.file("init", {
93
+ db: pgClients.client?.options?.database,
94
+ port: process.env.PORT || 3000,
95
+ });
93
96
  });
94
97
  }
95
98
  export default loggerPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.6.7",
3
+ "version": "2.6.8",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [