@opengis/fastify-table 2.0.137 → 2.0.138

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,9 +1,10 @@
1
1
  import { type ExtendedPG } from "../../../../types/core.js";
2
- export default function getFilterSQL({ table, filter, pg, search, filterList, query, custom, state, uid, objectId, order, }: {
2
+ export default function getFilterSQL({ table, filter, pg, search, searchColumn: searchColumn1, filterList, query, custom, state, uid, objectId, order, }: {
3
3
  table: string | undefined;
4
4
  filter?: string;
5
5
  pg: ExtendedPG;
6
6
  search?: string;
7
+ searchColumn?: string;
7
8
  filterList?: any[];
8
9
  query?: string;
9
10
  custom?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/getFilterSQL/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAsC5D,wBAA8B,YAAY,CAAC,EACzC,KAAK,EACL,MAAM,EACN,EAAqB,EACrB,MAAM,EACN,UAAU,EACV,KAAK,EACL,MAAM,EACN,KAAK,EACL,GAAG,EACH,QAAQ,EACR,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;;;;;;;;;;;;;;;;;;;;;;;GAmPA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../server/plugins/table/funcs/getFilterSQL/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAsC5D,wBAA8B,YAAY,CAAC,EACzC,KAAK,EACL,MAAM,EACN,EAAqB,EACrB,MAAM,EACN,YAAY,EAAE,aAAa,EAC3B,UAAU,EACV,KAAK,EACL,MAAM,EACN,KAAK,EACL,GAAG,EACH,QAAQ,EACR,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;;;;;;;;;;;;;;;;;;;;;;;GAsPA"}
@@ -20,7 +20,7 @@ function getExtraQuery(mainColumns, schema, table, pk) {
20
20
  extraColumns,
21
21
  };
22
22
  }
23
- export default async function getFilterSQL({ table, filter, pg = pgClients.client, search, filterList, query, custom, state, uid, objectId, order, }) {
23
+ export default async function getFilterSQL({ table, filter, pg = pgClients.client, search, searchColumn: searchColumn1, filterList, query, custom, state, uid, objectId, order, }) {
24
24
  if (!table)
25
25
  return { error: "param table is required", status: 400 };
26
26
  const body = await getTemplate("table", table);
@@ -79,7 +79,10 @@ export default async function getFilterSQL({ table, filter, pg = pgClients.clien
79
79
  ?.filter((el) => pg.pgType?.[el.dataTypeID] === "text")
80
80
  ?.map((el) => `"${el.name}"`)
81
81
  .join(",");
82
- const searchColumn = body?.search_column || body?.meta?.search || autoSearchColumn;
82
+ const searchColumn = searchColumn1 ||
83
+ body?.search_column ||
84
+ body?.meta?.search ||
85
+ autoSearchColumn;
83
86
  const fieldsList = (fieldsModel || fields)?.map((el) => el.name);
84
87
  try {
85
88
  const tableSQL = await getTableSql({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.137",
3
+ "version": "2.0.138",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [