@opengis/fastify-table 2.0.21 → 2.0.23

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":"getMeta.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getMeta.ts"],"names":[],"mappings":"AAIA,wBAA8B,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,gBAgE5D"}
1
+ {"version":3,"file":"getMeta.d.ts","sourceRoot":"","sources":["../../../../../server/plugins/pg/funcs/getMeta.ts"],"names":[],"mappings":"AAIA,wBAA8B,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,gBAkE5D"}
@@ -22,7 +22,8 @@ export default async function getMeta(opt, nocache) {
22
22
  const pk = table.startsWith("public.")
23
23
  ? pks1[table.replace("public.", "")] || pks1[table.replace("public.", "")]
24
24
  : pks1[table] || pks1[table];
25
- const geomAttr = fields.find((el) => pg.pgType?.[el.dataTypeID] === "geometry")?.name; // change geometry text to geometry code
25
+ const geomColumns = fields.filter((el) => pg.pgType?.[el.dataTypeID] === "geometry");
26
+ const geomAttr = geomColumns.find((el) => el.name === "geom_4326") || geomColumns[0];
26
27
  const dbColumns = await pg
27
28
  .query(`select json_object_agg(
28
29
  attname,
@@ -37,7 +38,7 @@ export default async function getMeta(opt, nocache) {
37
38
  const res = {
38
39
  pk,
39
40
  columns: fields,
40
- geom: geomAttr,
41
+ geom: geomAttr?.name,
41
42
  view: pg.relkinds?.[table] === "v",
42
43
  };
43
44
  if (!data[pg.options.database]) {
@@ -1 +1 @@
1
- {"version":3,"file":"formatValue.d.ts","sourceRoot":"","sources":["../../../../../../../server/plugins/table/funcs/getFilterSQL/util/formatValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK/D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,EAAE,EACF,KAAK,EACL,MAAW,EACX,IAAI,EACJ,KAAK,EACL,UAAU,EACV,GAAO,EACP,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,OAuLA"}
1
+ {"version":3,"file":"formatValue.d.ts","sourceRoot":"","sources":["../../../../../../../server/plugins/table/funcs/getFilterSQL/util/formatValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK/D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,EAAE,EACF,KAAK,EACL,MAAW,EACX,IAAI,EACJ,KAAK,EACL,UAAU,EACV,GAAO,EACP,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,OAyLA"}
@@ -105,7 +105,7 @@ export default function formatValue({ pg, table, filter = {}, name, value, dataT
105
105
  return { op: "between", query };
106
106
  }
107
107
  /* select query - from admin.cls / filter options */
108
- if (["check", "autocomplete", "tags", "avatar", "radio"].includes(filterType)) {
108
+ if (["check", "autocomplete", "tags", "avatar", "radio", "select"].includes(filterType)) {
109
109
  // multiple checks with predefined query
110
110
  if (options?.find?.((el) => el?.sql)) {
111
111
  const query = options
@@ -209,7 +209,7 @@ export default async function suggest(req) {
209
209
  // const ids = dataNew.map((el) => el.id);
210
210
  const data = dataNew.filter((el) => el.id && el.text);
211
211
  if (tableName && column) {
212
- const { name = column, type = "select" } = getColumnCLS(tableName, column) || {};
212
+ const { name = query.sel || column, type = "select" } = getColumnCLS(tableName, column) || {};
213
213
  await metaFormat({
214
214
  rows: data,
215
215
  table: tableName,
@@ -226,7 +226,7 @@ export default async function suggest(req) {
226
226
  data: data.map((el) => ({
227
227
  count: el.count,
228
228
  id: el.id,
229
- text: el.text,
229
+ text: el.text_text || el.text,
230
230
  ...(el.text_data || {}),
231
231
  })),
232
232
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.21",
3
+ "version": "2.0.23",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [