@opengis/fastify-table 2.5.63 → 2.5.64

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":"getFilterList.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/getFilterSQLParametrized/getFilterList.ts"],"names":[],"mappings":"AAyBA,wBAA8B,aAAa,CACzC,EACE,KAAK,EACL,GAAG,EACH,UAAU,EACV,cAAc,EACd,YAAiB,GAClB,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CACrC,EACD,EAAE,MAAmB,kBAqFtB"}
1
+ {"version":3,"file":"getFilterList.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/getFilterSQLParametrized/getFilterList.ts"],"names":[],"mappings":"AAyBA,wBAA8B,aAAa,CACzC,EACE,KAAK,EACL,GAAG,EACH,UAAU,EACV,cAAc,EACd,YAAiB,GAClB,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CACrC,EACD,EAAE,MAAmB,kBA8FtB"}
@@ -23,6 +23,9 @@ export default async function getFilterList({ table, uid, filterList, extraDataT
23
23
  table,
24
24
  user: { uid },
25
25
  }, null);
26
+ const customClsList = await pg
27
+ .queryCache("select array_agg(name) from admin.user_cls where parent is null and type=$1", { table: "admin.user_cls", args: ["json"] })
28
+ .then((r) => r.rows?.[0]?.array_agg || []);
26
29
  return Promise.all((filterList || [])
27
30
  .concat(filterResponse?.inline || [])
28
31
  .concat(filterResponse?.custom || [])
@@ -79,7 +82,7 @@ export default async function getFilterList({ table, uid, filterList, extraDataT
79
82
  Object.assign(el, {
80
83
  cls: el.data,
81
84
  options: cls.arr,
82
- select: `select code, name from admin.cls where parent='${el.data}'`,
85
+ select: `select code, name from ${customClsList.includes(el.data) ? "admin.user_cls" : "admin.cls"} where parent='${el.data}'`,
83
86
  });
84
87
  }
85
88
  else if (typeof (cls?.sql || cls) === "string") {
@@ -137,7 +137,7 @@ export default async function tableAPI(req, _, called) {
137
137
  }
138
138
  const data = id
139
139
  ? await pg
140
- .query(q.replace(/{{uid}}/g, user?.uid), [id])
140
+ .query(q.replace(/{{uid}}/, user?.uid), [id])
141
141
  .then((el) => el.rows[0])
142
142
  : null;
143
143
  if (id && !data) {
@@ -1,6 +1,6 @@
1
1
  const keySchema = {
2
2
  type: "string",
3
- pattern: "^([А-Яа-яҐґЄєІіЇї\\d\\w\\s_.\\-:—!?%@#$,'\"; ]+)$",
3
+ pattern: "^([А-Яа-яҐґЄєІіЇї\\d\\w\\s_.\\-:—–!?%@#$,'\"; №/()«»’“”]+)$",
4
4
  };
5
5
  const tableDataSchema = {
6
6
  type: "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.5.63",
3
+ "version": "2.5.64",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [