@opengis/fastify-table 1.3.41 → 1.3.43

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.3.41",
3
+ "version": "1.3.43",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -69,7 +69,7 @@ export default async function insert(req) {
69
69
 
70
70
  const res = await dataInsert({
71
71
  pg,
72
- id: params?.id,
72
+ id: params?.id || body.id,
73
73
  table: loadTemplate?.table || table,
74
74
  data: body,
75
75
  uid: user?.uid,
@@ -58,7 +58,7 @@ export default async function update(req) {
58
58
  const xssCheck = checkXSS({ body, schema });
59
59
 
60
60
  if (xssCheck.error && formData?.xssCheck !== false) {
61
- logger.warn({ name: 'injection/xss', msg: xssCheck.error, table }, req);
61
+ logger.file('injection/xss', { msg: xssCheck.error, table }, req);
62
62
  return { message: 'Дані містять заборонені символи. Приберіть їх та спробуйте ще раз', status: 409 };
63
63
  }
64
64
 
@@ -189,7 +189,7 @@ export default async function dataAPI(req, reply, called) {
189
189
  count(*)::int as total,
190
190
  count(*) FILTER(WHERE ${filterWhere.join(' and ') || 'true'})::int as filtered
191
191
  ${aggregates.length ? `,${aggregates.map((el) => `${aggColumns[el.name]}(${el.name}) FILTER(WHERE ${filterWhere.join(' and ') || 'true'}) as ${el.name}`).join(',')}` : ''}
192
- from (select * ${sql?.filter(el => el.inline).map(el => `,(${el.sql})`).join('') || ''} from ${table} t ${sqlTable})q
192
+ from (select * ${sql?.filter(el => el.inline).map(el => `,(${el.sql})`).join('') || ''} from ${table} t ${sqlTable}) t
193
193
  where ${[loadTable?.query, tokenData?.query, accessQuery, contextQuery].filter(el => el).filter((el) => checkQuery(el)).join(' and ') || 'true'} `
194
194
  .replace(/{{uid}}/g, uid);
195
195