@opengis/fastify-table 2.5.63 → 2.5.65
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/helper.d.ts +0 -1
- package/dist/helper.d.ts.map +1 -1
- package/dist/server/plugins/file/utils/inspectContent.js +1 -1
- package/dist/server/plugins/table/funcs/getFilterSQLParametrized/getFilterList.d.ts.map +1 -1
- package/dist/server/plugins/table/funcs/getFilterSQLParametrized/getFilterList.js +4 -1
- package/dist/server/routes/crud/controllers/table.js +1 -1
- package/package.json +1 -1
package/dist/helper.d.ts
CHANGED
package/dist/helper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../helper.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,QAAA,MAAQ,MAAM,KAAoB,CAAC;AAInC,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../helper.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,QAAA,MAAQ,MAAM,KAAoB,CAAC;AAInC,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;;;;GAiChD;AAED,wBAAsB,KAAK,kBAI1B;AAGD,wBAAsB,QAAQ,kBAW7B;AAED,wBAAsB,KAAK,iBA+B1B;AAED,OAAO,EAEL,MAAM,EACN,MAAM,EACN,SAAS,GACV,CAAC"}
|
|
@@ -48,7 +48,7 @@ const handlers = {
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
geojson: (buffer) => {
|
|
51
|
-
const text = buffer.subarray(0,
|
|
51
|
+
const text = buffer.subarray(0, 512).toString("utf8").trimStart();
|
|
52
52
|
if (text.startsWith("{") &&
|
|
53
53
|
text.includes("features") &&
|
|
54
54
|
text.includes("FeatureCollection")) {
|
|
@@ -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,
|
|
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}}
|
|
140
|
+
.query(q.replace(/{{uid}}/, user?.uid), [id])
|
|
141
141
|
.then((el) => el.rows[0])
|
|
142
142
|
: null;
|
|
143
143
|
if (id && !data) {
|