@opengis/fastify-table 2.0.68 → 2.0.70

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.
Files changed (31) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +3 -0
  3. package/dist/server/migrations/crm.sql +14 -4
  4. package/dist/server/plugins/notifications/addNotification.d.ts +12 -0
  5. package/dist/server/plugins/notifications/addNotification.d.ts.map +1 -0
  6. package/dist/server/plugins/notifications/addNotification.js +18 -0
  7. package/dist/server/routes/notifications/controllers/addUserNotification.d.ts +4 -0
  8. package/dist/server/routes/notifications/controllers/addUserNotification.d.ts.map +1 -0
  9. package/dist/server/routes/notifications/controllers/addUserNotification.js +22 -0
  10. package/dist/server/routes/notifications/controllers/deleteUserNotification.d.ts +4 -0
  11. package/dist/server/routes/notifications/controllers/deleteUserNotification.d.ts.map +1 -0
  12. package/dist/server/routes/notifications/controllers/deleteUserNotification.js +25 -0
  13. package/dist/server/routes/notifications/controllers/editUserNotification.d.ts +4 -0
  14. package/dist/server/routes/notifications/controllers/editUserNotification.d.ts.map +1 -0
  15. package/dist/server/routes/notifications/controllers/editUserNotification.js +31 -0
  16. package/dist/server/routes/notifications/controllers/readNotifications.d.ts +4 -0
  17. package/dist/server/routes/notifications/controllers/readNotifications.d.ts.map +1 -0
  18. package/dist/server/routes/notifications/controllers/readNotifications.js +17 -0
  19. package/dist/server/routes/notifications/controllers/userNotifications.d.ts +4 -0
  20. package/dist/server/routes/notifications/controllers/userNotifications.d.ts.map +1 -0
  21. package/dist/server/routes/notifications/controllers/userNotifications.js +33 -0
  22. package/dist/server/routes/notifications/index.d.ts +3 -0
  23. package/dist/server/routes/notifications/index.d.ts.map +1 -0
  24. package/dist/server/routes/notifications/index.js +23 -0
  25. package/dist/server/routes/table/controllers/search.d.ts +2 -1
  26. package/dist/server/routes/table/controllers/search.d.ts.map +1 -1
  27. package/dist/server/routes/table/controllers/search.js +37 -14
  28. package/dist/utils.d.ts +1 -0
  29. package/dist/utils.d.ts.map +1 -1
  30. package/dist/utils.js +2 -1
  31. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AA2EA,iBAAS,MAAM,CAAC,OAAO,EAAE,GAAG,QAyH3B;;AACD,wBAA0B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AA4EA,iBAAS,MAAM,CAAC,OAAO,EAAE,GAAG,QA4H3B;;AACD,wBAA0B"}
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ import widgetRoutes from "./server/routes/widget/index.js";
37
37
  import authRoutes from "./server/routes/auth/index.js";
38
38
  import fileRoutes from "./server/routes/file/index.js";
39
39
  import grpcRoutes from "./server/routes/grpc/index.js";
40
+ import notificationsRoutes from "./server/routes/notifications/index.js";
40
41
  const filename = fileURLToPath(import.meta.url);
41
42
  const cwd = path.dirname(filename);
42
43
  addHook("preForm", preForm);
@@ -102,6 +103,8 @@ function plugin(fastify) {
102
103
  // from fastify-file
103
104
  fastify.register(fileRoutes);
104
105
  fastify.register(grpcRoutes, opt);
106
+ // from admin
107
+ fastify.register(notificationsRoutes, opt);
105
108
  config.proxy?.forEach?.((el) => {
106
109
  if (execName === "bun") {
107
110
  fastify.all(`${el.source}/*`, async (req, reply) => {
@@ -21,13 +21,23 @@ ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS link text;
21
21
  ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS author_id text;
22
22
  ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS entity_id text;
23
23
 
24
- ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS uid text;
25
24
  ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS files json;
26
- ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS cdate timestamp without time zone DEFAULT (now())::timestamp without time zone;
27
- ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS editor_id text;
28
- ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS editor_date timestamp without time zone;
29
25
  ALTER TABLE crm.notifications ADD CONSTRAINT crm_notifications_pkey PRIMARY KEY (notification_id);
30
26
 
27
+ ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS type text;
28
+ ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS created_at timestamp without time zone DEFAULT (now())::timestamp without time zone;
29
+ ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS updated_at timestamp without time zone DEFAULT (now())::timestamp without time zone;
30
+ ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS created_by text;
31
+ ALTER TABLE crm.notifications ADD COLUMN IF NOT EXISTS updated_by text;
32
+
33
+ ALTER TABLE crm.notifications DROP COLUMN IF EXISTS cdate;
34
+ ALTER TABLE crm.notifications DROP COLUMN IF EXISTS editor_date;
35
+ ALTER TABLE crm.notifications DROP COLUMN IF EXISTS uid;
36
+ ALTER TABLE crm.notifications DROP COLUMN IF EXISTS editor_id;
37
+
38
+ ALTER TABLE crm.notifications ALTER COLUMN addressee_id SET NOT NULL;
39
+ ALTER TABLE crm.notifications ALTER COLUMN body SET NOT NULL;
40
+
31
41
  COMMENT ON COLUMN crm.notifications.addressee_id is 'ID користувача отримувача повідомлення';
32
42
  COMMENT ON COLUMN crm.notifications.read is 'Чи було повідомлення прочитане';
33
43
  COMMENT ON COLUMN crm.notifications.sent is 'Чи було повідомлення відправлене';
@@ -0,0 +1,12 @@
1
+ import { ExtendedPG } from "../../types/core.js";
2
+ export default function addUserNotification({ subject, body, link, addressee, author, entity, type, pg, }: {
3
+ subject?: string;
4
+ body: string;
5
+ link?: string;
6
+ addressee: string | number;
7
+ author: string | number;
8
+ entity?: string;
9
+ type?: string;
10
+ pg?: ExtendedPG;
11
+ }): Promise<any>;
12
+ //# sourceMappingURL=addNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addNotification.d.ts","sourceRoot":"","sources":["../../../../server/plugins/notifications/addNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,qBAAqB,CAAC;AAK/D,wBAA8B,mBAAmB,CAAC,EAChD,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,MAAM,EACN,MAAM,EACN,IAAI,EACJ,EAAqB,GACtB,EAAE;IACD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,UAAU,CAAC;CACjB,gBAgBA"}
@@ -0,0 +1,18 @@
1
+ import pgClients from "../pg/pgClients.js";
2
+ import dataInsert from "../crud/funcs/dataInsert.js";
3
+ export default async function addUserNotification({ subject, body, link, addressee, author, entity, type, pg = pgClients.client, }) {
4
+ const res = await dataInsert({
5
+ pg,
6
+ table: "crm.notifications",
7
+ data: {
8
+ subject,
9
+ body,
10
+ link,
11
+ addressee_id: addressee,
12
+ author_id: author,
13
+ entity_id: entity,
14
+ type,
15
+ },
16
+ });
17
+ return res?.rows?.[0] || {};
18
+ }
@@ -0,0 +1,4 @@
1
+ import { FastifyReply } from "fastify";
2
+ import { ExtendedRequest } from "../../../types/core.js";
3
+ export default function addUserNotification(req: ExtendedRequest, reply: FastifyReply): Promise<never>;
4
+ //# sourceMappingURL=addUserNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addUserNotification.d.ts","sourceRoot":"","sources":["../../../../../server/routes/notifications/controllers/addUserNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAEL,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAKhC,wBAA8B,mBAAmB,CAC/C,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,YAAY,kBAgCpB"}
@@ -0,0 +1,22 @@
1
+ import pgClients from "../../../plugins/pg/pgClients.js";
2
+ import dataInsert from "../../../plugins/crud/funcs/dataInsert.js";
3
+ export default async function addUserNotification(req, reply) {
4
+ const { pg = pgClients.client, body, user, } = req;
5
+ if (!user?.uid) {
6
+ return reply.status(401).send({ error: "unauthorized", code: 401 });
7
+ }
8
+ // who (user id) and what of (message) to notify
9
+ const missingKey = ["addressee_id", "body"].find((key) => !body[key]);
10
+ if (missingKey) {
11
+ return reply
12
+ .status(400)
13
+ .send({ error: `not enough body params: ${missingKey}`, code: 400 });
14
+ }
15
+ const result = await dataInsert({
16
+ pg,
17
+ table: "crm.notifications",
18
+ data: { ...body, author_id: user.uid },
19
+ uid: user.uid,
20
+ }).then((el) => el.rows?.[0] || {});
21
+ return reply.status(200).send(result);
22
+ }
@@ -0,0 +1,4 @@
1
+ import { FastifyReply } from "fastify";
2
+ import { ExtendedRequest } from "../../../types/core.js";
3
+ export default function editUserNotification(req: ExtendedRequest, reply: FastifyReply): Promise<never>;
4
+ //# sourceMappingURL=deleteUserNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteUserNotification.d.ts","sourceRoot":"","sources":["../../../../../server/routes/notifications/controllers/deleteUserNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAEL,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAKhC,wBAA8B,oBAAoB,CAChD,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,YAAY,kBAuCpB"}
@@ -0,0 +1,25 @@
1
+ import pgClients from "../../../plugins/pg/pgClients.js";
2
+ import dataDelete from "../../../plugins/crud/funcs/dataDelete.js";
3
+ export default async function editUserNotification(req, reply) {
4
+ const { pg = pgClients.client, params, user, } = req;
5
+ if (!user?.uid) {
6
+ return reply.status(401).send({ error: "unauthorized", code: 401 });
7
+ }
8
+ const author = pg && pg.pk?.["crm.notifications"]
9
+ ? await pg
10
+ .query("select read, author_id as author from crm.notifications where notification_id=$1", [params.id])
11
+ .then((el) => el.rows?.[0]?.author)
12
+ : null;
13
+ if (author && author !== user.uid && user?.user_type !== "admin") {
14
+ return reply
15
+ .status(403)
16
+ .send({ error: "not an author of notification", code: 403 });
17
+ }
18
+ const result = await dataDelete({
19
+ pg,
20
+ id: params.id,
21
+ table: "crm.notifications",
22
+ uid: user.uid,
23
+ });
24
+ return reply.status(200).send(result);
25
+ }
@@ -0,0 +1,4 @@
1
+ import { FastifyReply } from "fastify";
2
+ import { ExtendedRequest } from "../../../types/core.js";
3
+ export default function editUserNotification(req: ExtendedRequest, reply: FastifyReply): Promise<never>;
4
+ //# sourceMappingURL=editUserNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editUserNotification.d.ts","sourceRoot":"","sources":["../../../../../server/routes/notifications/controllers/editUserNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAEL,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAKhC,wBAA8B,oBAAoB,CAChD,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,YAAY,kBAgDpB"}
@@ -0,0 +1,31 @@
1
+ import pgClients from "../../../plugins/pg/pgClients.js";
2
+ import dataUpdate from "../../../plugins/crud/funcs/dataUpdate.js";
3
+ export default async function editUserNotification(req, reply) {
4
+ const { pg = pgClients.client, body, params, user, } = req;
5
+ if (!user?.uid) {
6
+ return reply.status(401).send({ error: "unauthorized", code: 401 });
7
+ }
8
+ const { read, author } = pg && pg.pk?.["crm.notifications"]
9
+ ? await pg
10
+ .query("select read, author_id as author from crm.notifications where notification_id=$1", [params.id])
11
+ .then((el) => el.rows?.[0] || {})
12
+ : {};
13
+ if (author !== user.uid && user?.user_type !== "admin") {
14
+ return reply
15
+ .status(403)
16
+ .send({ error: "not an author of notification", code: 403 });
17
+ }
18
+ if (read) {
19
+ return reply
20
+ .status(400)
21
+ .send({ error: "notification already read", code: 400 });
22
+ }
23
+ const result = await dataUpdate({
24
+ pg,
25
+ id: params.id,
26
+ table: "crm.notifications",
27
+ data: body,
28
+ uid: user.uid,
29
+ });
30
+ return reply.status(200).send(result);
31
+ }
@@ -0,0 +1,4 @@
1
+ import { FastifyReply } from "fastify";
2
+ import { ExtendedRequest } from "../../../types/core.js";
3
+ export default function readNotifications(req: ExtendedRequest, reply: FastifyReply): Promise<never>;
4
+ //# sourceMappingURL=readNotifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readNotifications.d.ts","sourceRoot":"","sources":["../../../../../server/routes/notifications/controllers/readNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAc,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIrE,wBAA8B,iBAAiB,CAC7C,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,YAAY,kBAmCpB"}
@@ -0,0 +1,17 @@
1
+ import pgClients from "../../../plugins/pg/pgClients.js";
2
+ export default async function readNotifications(req, reply) {
3
+ const { pg = pgClients.client, params, user, } = req;
4
+ if (!user?.uid) {
5
+ return reply.status(401).send({ error: "unauthorized", code: 401 });
6
+ }
7
+ const ids = pg && pg.pk?.["crm.notifications"]
8
+ ? await pg
9
+ .query(`update crm.notifications
10
+ set read=true
11
+ where read is not true
12
+ and addressee_id=$1
13
+ and ${params.id ? "notification_id=$2" : "1=1"} returning notification_id`, [user.uid, params?.id].filter(Boolean))
14
+ .then((el) => el.rows?.map((row) => row.notification_id) || [])
15
+ : [];
16
+ return reply.status(200).send({ ids, read: ids.length });
17
+ }
@@ -0,0 +1,4 @@
1
+ import { FastifyReply } from "fastify";
2
+ import { ExtendedRequest } from "../../../types/core.js";
3
+ export default function userNotifications(req: ExtendedRequest, reply: FastifyReply): Promise<never>;
4
+ //# sourceMappingURL=userNotifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userNotifications.d.ts","sourceRoot":"","sources":["../../../../../server/routes/notifications/controllers/userNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAc,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAYrE,wBAA8B,iBAAiB,CAC7C,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE,YAAY,kBA2CpB"}
@@ -0,0 +1,33 @@
1
+ import pgClients from "../../../plugins/pg/pgClients.js";
2
+ import getSelectVal from "../../../plugins/table/funcs/metaFormat/getSelectVal.js";
3
+ const maxLimit = 100;
4
+ const q = `select notification_id as id, subject, body, created_at,
5
+ author_id, read, link, entity_id, (select avatar from admin.users where uid=a.author_id limit 1) as avatar
6
+ from crm.notifications a
7
+ where addressee_id=$1 order by created_at desc limit $2 offset $3`;
8
+ export default async function userNotifications(req, reply) {
9
+ const { pg = pgClients.client, query, user, } = req;
10
+ const t1 = Date.now();
11
+ if (!user?.uid) {
12
+ return reply.status(401).send({ error: "unauthorized", code: 401 });
13
+ }
14
+ const limit = Math.min(maxLimit, +(query.limit || 5));
15
+ const offset = query.page && query.page > 0 ? (query.page - 1) * limit : 0;
16
+ const rows = pg && pg.pk?.["crm.notifications"]
17
+ ? await pg
18
+ .query(q, [user.uid, limit, offset])
19
+ .then((el) => el.rows || [])
20
+ : [];
21
+ const values = rows
22
+ .map((row) => row.author_id)
23
+ .filter((el, idx, arr) => el && arr.indexOf(el) === idx);
24
+ if (values.length) {
25
+ const vals = await getSelectVal({ name: "core.user_mentioned", values });
26
+ rows.forEach((row) => {
27
+ Object.assign(row, { author: vals?.[row.author_id] });
28
+ });
29
+ }
30
+ return reply
31
+ .status(200)
32
+ .send({ time: Date.now() - t1, total: rows.length, rows });
33
+ }
@@ -0,0 +1,3 @@
1
+ import { FastifyInstance } from "fastify";
2
+ export default function route(app: FastifyInstance): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAU1C,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,eAAe,QAgBjD"}
@@ -0,0 +1,23 @@
1
+ import readNotifications from "./controllers/readNotifications.js"; // mark as read
2
+ import userNotifications from "./controllers/userNotifications.js"; // check all, backend pagination
3
+ import addUserNotification from "./controllers/addUserNotification.js"; // add user notification
4
+ import editUserNotification from "./controllers/editUserNotification.js"; // edit unread user notification
5
+ import deleteUserNotification from "./controllers/deleteUserNotification.js"; // delete user notification
6
+ const params = { config: { policy: "L1" } };
7
+ export default function route(app) {
8
+ if (!app.hasRoute({ method: "GET", url: "/notification" })) {
9
+ app.get("/notification", params, userNotifications);
10
+ }
11
+ if (!app.hasRoute({ method: "POST", url: "/notification" })) {
12
+ app.post("/notification", params, addUserNotification);
13
+ }
14
+ if (!app.hasRoute({ method: "PUT", url: "/notification/:id" })) {
15
+ app.put("/notification/:id", params, editUserNotification);
16
+ }
17
+ if (!app.hasRoute({ method: "DELETE", url: "/notification/:id" })) {
18
+ app.delete("/notification/:id", params, deleteUserNotification);
19
+ }
20
+ if (!app.hasRoute({ method: "GET", url: "/notification-read/:id?" })) {
21
+ app.get("/notification-read/:id?", params, readNotifications);
22
+ }
23
+ }
@@ -1,7 +1,8 @@
1
1
  export default function search({ pg, funcs, query }: any): Promise<string | {
2
2
  time: number;
3
3
  total: number;
4
+ filtered: number;
4
5
  count: number;
5
- rows: never[];
6
+ rows: any[];
6
7
  }>;
7
8
  //# sourceMappingURL=search.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/controllers/search.ts"],"names":[],"mappings":"AAkGA,wBAA8B,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAU,EAAE,EAAE,GAAG;;;;;GA2BlE"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/controllers/search.ts"],"names":[],"mappings":"AA6HA,wBAA8B,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAU,EAAE,EAAE,GAAG;;;;;;GAoClE"}
@@ -1,4 +1,4 @@
1
- import { getMeta, metaFormat, getTemplates, getTemplate, handlebars, } from "../../../../utils.js";
1
+ import { getMeta, metaFormat, getTemplates, getTemplate, handlebarsSync, } from "../../../../utils.js";
2
2
  function sequence(tables, data, fn) {
3
3
  return tables.reduce((promise, table) => promise.then(() => fn({
4
4
  ...data,
@@ -11,7 +11,10 @@ async function getData({ pg, tableName, query = {}, maxLimit, res }) {
11
11
  return { message: "not found", status: 404 };
12
12
  }
13
13
  const { table, columns, meta } = loadTable;
14
- const { pk } = await getMeta(table);
14
+ const { pk, view } = await getMeta({ pg, table });
15
+ if (!pk && !view) {
16
+ return { message: "table not found", status: 404 };
17
+ }
15
18
  const cols = columns.map((el) => el.name || el).join(",");
16
19
  const [orderColumn, orderDir] = (query.order || loadTable.order || "").split("-");
17
20
  const order = cols.includes(orderColumn) && orderColumn?.length
@@ -24,29 +27,41 @@ async function getData({ pg, tableName, query = {}, maxLimit, res }) {
24
27
  ? `(${meta?.search
25
28
  .concat(meta?.title ? `,${meta?.title}` : "")
26
29
  .split(",")
27
- .map((el) => `${el} ilike '%${query.key}%'`)
30
+ .map((el) => `${el}::text ilike '%${query.key}%'`)
28
31
  .join(" or ")})`
29
32
  : "false";
30
- const where = [!pk ? "false" : "true", loadTable.query, search1].filter((el) => el);
33
+ const where = [!pk ? "false" : "true", loadTable.query, search1].filter(Boolean);
34
+ const sqlTable = loadTable.sql
35
+ ?.filter?.((el) => !el?.disabled)
36
+ ?.map((el, i) => ` left join lateral (${el.sql}) ${el.name || `t${i}`} on 1=1 `)
37
+ ?.join?.("") || "";
31
38
  const q = `select ${[
32
39
  `"${pk}" as id`,
33
40
  meta?.title ? `${meta.title} as title` : "",
34
41
  ]
35
42
  .filter((el) => el)
36
- .join(",")} from ${table} t where ${where.join(" and ") || "true"} ${order} ${offset} limit ${limit}`;
43
+ .join(",")} from ${table} t ${sqlTable} where ${where.join(" and ") || "true"} ${order} ${offset} limit ${limit}`;
37
44
  if (query.sql) {
38
45
  res.sql.push(q);
39
46
  return null;
40
47
  }
41
- const { rows } = await pg.query(q);
42
- const total = (await pg
43
- .queryCache(`select count(*) from ${table} t where ${where.join(" and ") || "true"}`)
44
- .then((el) => el?.rows[0]?.count)) || 0;
48
+ const rows = await pg.query(q).then((el) => el.rows || []);
49
+ const filtered = pg.queryCache
50
+ ? await pg
51
+ .queryCache(`select count(*) from ${table} t ${sqlTable} where ${where.join(" and ") || "true"}`)
52
+ .then((el) => +(el?.rows[0]?.count || 0))
53
+ : 0;
54
+ const total = pg.queryCache
55
+ ? await pg
56
+ .queryCache(`select count(*) from ${table}`)
57
+ .then((el) => +(el?.rows[0]?.count || 0))
58
+ : 0;
45
59
  await metaFormat({ rows, table: tableName });
46
60
  res.total += +total;
61
+ res.filtered += +filtered;
47
62
  rows.forEach((row) => {
48
63
  const href = meta?.href
49
- ? handlebars.compile(meta.href)({ ...row, [pk]: row.id })
64
+ ? handlebarsSync.compile(meta.href)({ ...row, [pk]: row.id })
50
65
  : undefined;
51
66
  res.rows.push({
52
67
  ...row,
@@ -58,9 +73,16 @@ async function getData({ pg, tableName, query = {}, maxLimit, res }) {
58
73
  return null;
59
74
  }
60
75
  export default async function search({ pg, funcs, query = {} }) {
61
- const time = Date.now();
62
- const tables = query.table ? [query.table] : await getTemplates("table");
63
- const res = { rows: [], sql: [], total: 0 };
76
+ const t1 = Date.now();
77
+ const tables = query.table
78
+ ? [query.table]
79
+ : getTemplates("table")?.map?.((el) => el[0]);
80
+ const res = {
81
+ rows: [],
82
+ sql: [],
83
+ total: 0,
84
+ filtered: 0,
85
+ };
64
86
  const maxLimit = Math.min(100, query.limit || "16");
65
87
  await sequence(tables, {
66
88
  pg,
@@ -72,8 +94,9 @@ export default async function search({ pg, funcs, query = {} }) {
72
94
  if (query.sql)
73
95
  return res.sql.join(";\n");
74
96
  return {
75
- time: Date.now() - time,
97
+ time: Date.now() - t1,
76
98
  total: res.total,
99
+ filtered: res.filtered,
77
100
  count: res.rows.length,
78
101
  rows: res.rows,
79
102
  };
package/dist/utils.d.ts CHANGED
@@ -76,6 +76,7 @@ export { default as jsonToCsv } from "./server/routes/file/controllers/utils/jso
76
76
  export { default as jsonToXls } from "./server/routes/file/controllers/utils/jsonToXls.js";
77
77
  export { default as getAdminAccess } from "./server/plugins/access/funcs/getAdminAccess.js";
78
78
  export { default as sendNotification } from "./server/plugins/auth/funcs/sendNotification.js";
79
+ export { default as addUserNotification } from "./server/plugins/notifications/addNotification.js";
79
80
  export { addUserCls, editUserCls, deleteUserCls, getUserCls, } from "./server/plugins/usercls/index.js";
80
81
  declare const _default: null;
81
82
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGvE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mCAA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AAI,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AAGhG,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,qDAAqD,CAAC;AAE3F,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAE5F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAE9F,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAEnG,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,GACX,MAAM,mCAAmC,CAAC;;AAE3C,wBAAoB"}
package/dist/utils.js CHANGED
@@ -91,6 +91,7 @@ export { default as getExport } from "./server/plugins/file/getExport.js";
91
91
  export { default as jsonToCsv } from "./server/routes/file/controllers/utils/jsonToCsv.js";
92
92
  export { default as jsonToXls } from "./server/routes/file/controllers/utils/jsonToXls.js";
93
93
  export { default as getAdminAccess } from "./server/plugins/access/funcs/getAdminAccess.js";
94
- export { default as sendNotification } from "./server/plugins/auth/funcs/sendNotification.js";
94
+ export { default as sendNotification } from "./server/plugins/auth/funcs/sendNotification.js"; // email
95
+ export { default as addUserNotification } from "./server/plugins/notifications/addNotification.js"; // popup, widget, interface etc.
95
96
  export { addUserCls, editUserCls, deleteUserCls, getUserCls, } from "./server/plugins/usercls/index.js";
96
97
  export default null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "2.0.68",
3
+ "version": "2.0.70",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [