@opengis/fastify-table 2.0.21 → 2.0.22
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/server/plugins/pg/funcs/getMeta.d.ts.map +1 -1
- package/dist/server/plugins/pg/funcs/getMeta.js +3 -2
- package/dist/server/plugins/table/funcs/getFilterSQL/util/formatValue.d.ts.map +1 -1
- package/dist/server/plugins/table/funcs/getFilterSQL/util/formatValue.js +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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
|
|
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,
|
|
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
|