@opengis/fastify-table 2.0.67 → 2.0.69

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 (86) hide show
  1. package/dist/functions.d.ts +39 -0
  2. package/dist/functions.d.ts.map +1 -0
  3. package/dist/functions.js +412 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +18 -418
  6. package/dist/log/migration/dist-geoname-cls.json +1 -0
  7. package/dist/log/migration/dist-geoname-cls.sql +0 -0
  8. package/dist/server/migrations/crm.sql +14 -4
  9. package/dist/server/plugins/notifications/addNotification.d.ts +12 -0
  10. package/dist/server/plugins/notifications/addNotification.d.ts.map +1 -0
  11. package/dist/server/plugins/notifications/addNotification.js +18 -0
  12. package/dist/server/routes/access/index.d.ts +1 -1
  13. package/dist/server/routes/access/index.d.ts.map +1 -1
  14. package/dist/server/routes/access/index.js +1 -1
  15. package/dist/server/routes/auth/index.d.ts +1 -1
  16. package/dist/server/routes/auth/index.d.ts.map +1 -1
  17. package/dist/server/routes/auth/index.js +1 -1
  18. package/dist/server/routes/cron/index.d.ts +1 -1
  19. package/dist/server/routes/cron/index.d.ts.map +1 -1
  20. package/dist/server/routes/cron/index.js +1 -1
  21. package/dist/server/routes/crud/index.d.ts +1 -1
  22. package/dist/server/routes/crud/index.d.ts.map +1 -1
  23. package/dist/server/routes/crud/index.js +1 -1
  24. package/dist/server/routes/dblist/index.d.ts +1 -1
  25. package/dist/server/routes/dblist/index.d.ts.map +1 -1
  26. package/dist/server/routes/dblist/index.js +1 -1
  27. package/dist/server/routes/file/index.d.ts +1 -1
  28. package/dist/server/routes/file/index.d.ts.map +1 -1
  29. package/dist/server/routes/file/index.js +1 -1
  30. package/dist/server/routes/grpc/index.d.ts +1 -1
  31. package/dist/server/routes/grpc/index.d.ts.map +1 -1
  32. package/dist/server/routes/grpc/index.js +1 -1
  33. package/dist/server/routes/logger/index.d.ts +1 -1
  34. package/dist/server/routes/logger/index.d.ts.map +1 -1
  35. package/dist/server/routes/logger/index.js +1 -1
  36. package/dist/server/routes/menu/index.d.ts +1 -1
  37. package/dist/server/routes/menu/index.d.ts.map +1 -1
  38. package/dist/server/routes/menu/index.js +1 -1
  39. package/dist/server/routes/notifications/controllers/addUserNotification.d.ts +4 -0
  40. package/dist/server/routes/notifications/controllers/addUserNotification.d.ts.map +1 -0
  41. package/dist/server/routes/notifications/controllers/addUserNotification.js +22 -0
  42. package/dist/server/routes/notifications/controllers/deleteUserNotification.d.ts +4 -0
  43. package/dist/server/routes/notifications/controllers/deleteUserNotification.d.ts.map +1 -0
  44. package/dist/server/routes/notifications/controllers/deleteUserNotification.js +25 -0
  45. package/dist/server/routes/notifications/controllers/editUserNotification.d.ts +4 -0
  46. package/dist/server/routes/notifications/controllers/editUserNotification.d.ts.map +1 -0
  47. package/dist/server/routes/notifications/controllers/editUserNotification.js +31 -0
  48. package/dist/server/routes/notifications/controllers/readNotifications.d.ts +4 -0
  49. package/dist/server/routes/notifications/controllers/readNotifications.d.ts.map +1 -0
  50. package/dist/server/routes/notifications/controllers/readNotifications.js +17 -0
  51. package/dist/server/routes/notifications/controllers/userNotifications.d.ts +4 -0
  52. package/dist/server/routes/notifications/controllers/userNotifications.d.ts.map +1 -0
  53. package/dist/server/routes/notifications/controllers/userNotifications.js +33 -0
  54. package/dist/server/routes/notifications/index.d.ts +3 -0
  55. package/dist/server/routes/notifications/index.d.ts.map +1 -0
  56. package/dist/server/routes/notifications/index.js +23 -0
  57. package/dist/server/routes/properties/index.d.ts +1 -1
  58. package/dist/server/routes/properties/index.d.ts.map +1 -1
  59. package/dist/server/routes/properties/index.js +1 -1
  60. package/dist/server/routes/table/controllers/search.d.ts +2 -1
  61. package/dist/server/routes/table/controllers/search.d.ts.map +1 -1
  62. package/dist/server/routes/table/controllers/search.js +31 -12
  63. package/dist/server/routes/table/index.d.ts +1 -1
  64. package/dist/server/routes/table/index.d.ts.map +1 -1
  65. package/dist/server/routes/table/index.js +1 -1
  66. package/dist/server/routes/templates/index.d.ts +1 -1
  67. package/dist/server/routes/templates/index.d.ts.map +1 -1
  68. package/dist/server/routes/templates/index.js +1 -1
  69. package/dist/server/routes/util/index.d.ts +1 -1
  70. package/dist/server/routes/util/index.d.ts.map +1 -1
  71. package/dist/server/routes/util/index.js +1 -1
  72. package/dist/server/routes/widget/index.d.ts +1 -1
  73. package/dist/server/routes/widget/index.d.ts.map +1 -1
  74. package/dist/server/routes/widget/index.js +1 -1
  75. package/dist/utils.d.ts +1 -0
  76. package/dist/utils.d.ts.map +1 -1
  77. package/dist/utils.js +2 -1
  78. package/package.json +88 -88
  79. package/dist/server/plugins/grpc/utils/server/plugins/grpc/utils/convertp.proto +0 -137
  80. package/dist/server/plugins/grpc/utils/server/plugins/grpc/utils/office2pdf.proto +0 -14
  81. package/dist/server/plugins/hook/funcs/addHook.js +0 -7
  82. package/dist/server/plugins/hook/funcs/applyHook.js +0 -25
  83. package/dist/server/plugins/hook/funcs/applyHookSync.js +0 -7
  84. package/dist/server/plugins/hook/index.js +0 -7
  85. package/dist/server/routes/logger/controllers/utils/checkUserAccess.js +0 -22
  86. package/dist/server/routes/logger/controllers/utils/getRootDir.js +0 -25
@@ -7,7 +7,7 @@ const cronSchema = {
7
7
  },
8
8
  },
9
9
  };
10
- async function plugin(app, opt = {}) {
10
+ function plugin(app, opt = {}) {
11
11
  app.get("/cron/:name", { config: { role: "admin" }, schema: cronSchema }, cronApi);
12
12
  }
13
13
  export default plugin;
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opt?: any): Promise<void>;
1
+ declare function plugin(app: any, opt?: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/crud/index.ts"],"names":[],"mappings":"AAiBA,iBAAe,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAqB5C;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/crud/index.ts"],"names":[],"mappings":"AAiBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAqBtC;AAED,eAAe,MAAM,CAAC"}
@@ -12,7 +12,7 @@ const tableSchema = {
12
12
  },
13
13
  };
14
14
  const policy = "L0";
15
- async function plugin(app, opt = {}) {
15
+ function plugin(app, opt = {}) {
16
16
  app.put("/table/:table/:id?", { config: { policy }, schema: tableSchema }, update);
17
17
  app.delete("/table/:table/:id?", { config: { policy }, schema: tableSchema }, deleteCrud);
18
18
  app.post("/table/:table/:id?", { config: { policy }, schema: tableSchema }, insert);
@@ -1,2 +1,2 @@
1
- export default function plugin(app: any): Promise<void>;
1
+ export default function plugin(app: any): void;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/dblist/index.ts"],"names":[],"mappings":"AAKA,wBAA8B,MAAM,CAAC,GAAG,EAAE,GAAG,iBAiB5C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/dblist/index.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,GAAG,EAAE,GAAG,QAiBtC"}
@@ -1,7 +1,7 @@
1
1
  import readItemList from "./controllers/readItems.js";
2
2
  import setItem from "./controllers/setItem.js";
3
3
  const policy = ["site"];
4
- export default async function plugin(app) {
4
+ export default function plugin(app) {
5
5
  if (!app.hasRoute({ method: "GET", url: "/db-list" })) {
6
6
  app.route({
7
7
  method: "GET",
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opt?: any): Promise<void>;
1
+ declare function plugin(app: any, opt?: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/file/index.ts"],"names":[],"mappings":"AAWA,iBAAe,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAqB5C;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/file/index.ts"],"names":[],"mappings":"AAWA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAqBtC;AAED,eAAe,MAAM,CAAC"}
@@ -7,7 +7,7 @@ import exportTable from "./controllers/export.js";
7
7
  import uploadImage from "./controllers/uploadImage.js";
8
8
  import deleteFileAPI from "./controllers/delete.js";
9
9
  import { resizeSchema } from "./schema.js";
10
- async function plugin(app, opt = {}) {
10
+ function plugin(app, opt = {}) {
11
11
  app.get("/files/*", { config: { policy: ["public"] } }, files);
12
12
  app.get("/file/resize", { config: { policy: ["public"] }, schema: resizeSchema }, resize);
13
13
  app.get("/api/resize-all", { config: { policy: ["admin", "site"] }, schema: resizeSchema }, resizeAll);
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opts?: any): Promise<void>;
1
+ declare function plugin(app: any, opts?: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/grpc/index.ts"],"names":[],"mappings":"AAGA,iBAAe,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,iBAGzC;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/grpc/index.ts"],"names":[],"mappings":"AAGA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,QAGnC;AAED,eAAe,MAAM,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import file2geojson from "./controllers/file2geojson.js";
2
2
  import filePreview from "./controllers/filePreview.js";
3
- async function plugin(app, opts) {
3
+ function plugin(app, opts) {
4
4
  app.post("/file2geojson", { config: { policy: ["public"] } }, file2geojson);
5
5
  app.get("/file-preview", { config: { policy: ["public"] } }, filePreview);
6
6
  }
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opt?: any): Promise<void>;
1
+ declare function plugin(app: any, opt?: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/logger/index.ts"],"names":[],"mappings":"AAiBA,iBAAe,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAM5C;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/logger/index.ts"],"names":[],"mappings":"AAiBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAMtC;AAED,eAAe,MAAM,CAAC"}
@@ -12,7 +12,7 @@ const loggerSchema = {
12
12
  additionalProperties: false,
13
13
  },
14
14
  };
15
- async function plugin(app, opt = {}) {
15
+ function plugin(app, opt = {}) {
16
16
  app.get("/logger-file/*", { config: { policy: "L0", rateLimit: false }, schema: loggerSchema }, loggerFile);
17
17
  }
18
18
  export default plugin;
@@ -1,2 +1,2 @@
1
- export default function route(app: any, opt?: any): Promise<void>;
1
+ export default function route(app: any, opt?: any): void;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/menu/index.ts"],"names":[],"mappings":"AAGA,wBAA8B,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAG1D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/menu/index.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAGpD"}
@@ -1,6 +1,6 @@
1
1
  import getMenu from "./controllers/getMenu.js";
2
2
  import interfaces from "./controllers/interfaces.js";
3
- export default async function route(app, opt = {}) {
3
+ export default function route(app, opt = {}) {
4
4
  app.get("/user-menu", getMenu);
5
5
  app.get("/interfaces", { config: { role: "admin" } }, interfaces);
6
6
  }
@@ -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,3 +1,3 @@
1
- declare function plugin(app: any, opt?: any): Promise<void>;
1
+ declare function plugin(app: any, opt?: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/properties/index.ts"],"names":[],"mappings":"AAgBA,iBAAe,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAW5C;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/properties/index.ts"],"names":[],"mappings":"AAgBA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAWtC;AAED,eAAe,MAAM,CAAC"}
@@ -12,7 +12,7 @@ const propertiesSchema = {
12
12
  },
13
13
  },
14
14
  };
15
- async function plugin(app, opt = {}) {
15
+ function plugin(app, opt = {}) {
16
16
  app.get("/settings-app/:entity?", { config: { policy: "L0" }, schema: propertiesSchema }, getAppSettings);
17
17
  app.post("/settings-app/:entity?", { config: { role: "admin" } }, postAppSettings);
18
18
  }
@@ -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":"AAmHA,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
@@ -27,7 +30,7 @@ async function getData({ pg, tableName, query = {}, maxLimit, res }) {
27
30
  .map((el) => `${el} 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);
31
34
  const q = `select ${[
32
35
  `"${pk}" as id`,
33
36
  meta?.title ? `${meta.title} as title` : "",
@@ -38,15 +41,23 @@ async function getData({ pg, tableName, query = {}, maxLimit, res }) {
38
41
  res.sql.push(q);
39
42
  return null;
40
43
  }
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;
44
+ const rows = await pg.query(q).then((el) => el.rows || []);
45
+ const filtered = pg.queryCache
46
+ ? await pg
47
+ .queryCache(`select count(*) from ${table} t where ${where.join(" and ") || "true"}`)
48
+ .then((el) => +(el?.rows[0]?.count || 0))
49
+ : 0;
50
+ const total = pg.queryCache
51
+ ? await pg
52
+ .queryCache(`select count(*) from ${table}`)
53
+ .then((el) => +(el?.rows[0]?.count || 0))
54
+ : 0;
45
55
  await metaFormat({ rows, table: tableName });
46
56
  res.total += +total;
57
+ res.filtered += +filtered;
47
58
  rows.forEach((row) => {
48
59
  const href = meta?.href
49
- ? handlebars.compile(meta.href)({ ...row, [pk]: row.id })
60
+ ? handlebarsSync.compile(meta.href)({ ...row, [pk]: row.id })
50
61
  : undefined;
51
62
  res.rows.push({
52
63
  ...row,
@@ -58,9 +69,16 @@ async function getData({ pg, tableName, query = {}, maxLimit, res }) {
58
69
  return null;
59
70
  }
60
71
  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 };
72
+ const t1 = Date.now();
73
+ const tables = query.table
74
+ ? [query.table]
75
+ : getTemplates("table")?.map?.((el) => el[0]);
76
+ const res = {
77
+ rows: [],
78
+ sql: [],
79
+ total: 0,
80
+ filtered: 0,
81
+ };
64
82
  const maxLimit = Math.min(100, query.limit || "16");
65
83
  await sequence(tables, {
66
84
  pg,
@@ -72,8 +90,9 @@ export default async function search({ pg, funcs, query = {} }) {
72
90
  if (query.sql)
73
91
  return res.sql.join(";\n");
74
92
  return {
75
- time: Date.now() - time,
93
+ time: Date.now() - t1,
76
94
  total: res.total,
95
+ filtered: res.filtered,
77
96
  count: res.rows.length,
78
97
  rows: res.rows,
79
98
  };
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opt?: any): Promise<void>;
1
+ declare function plugin(app: any, opt?: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/table/index.ts"],"names":[],"mappings":"AA+BA,iBAAe,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBA4E5C;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/table/index.ts"],"names":[],"mappings":"AA+BA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QA4EtC;AAED,eAAe,MAAM,CAAC"}
@@ -14,7 +14,7 @@ import form from "./controllers/getFormByTable.js";
14
14
  import loadTemplatePath from "../../plugins/table/funcs/loadTemplatePath.js";
15
15
  import { tableDataSchema, tableSchema, searchSchema, suggestSchema, formSchema, filterSchema, cardTabDataSchema, tableDataIdSchema, } from "./schema.js";
16
16
  const policy = "L0";
17
- async function plugin(app, opt = {}) {
17
+ function plugin(app, opt = {}) {
18
18
  app.get("/token-info/:token", { config: { role: "admin" } }, tokenInfo);
19
19
  app.get("/table-filter/:table", { config: { policy }, schema: filterSchema }, filter);
20
20
  app.get("/table-info/:table/:id?", { config: { policy }, schema: tableDataSchema }, tableInfo);
@@ -1,2 +1,2 @@
1
- export default function route(app: any, opt?: any): Promise<void>;
1
+ export default function route(app: any, opt?: any): void;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/templates/index.ts"],"names":[],"mappings":"AAMA,wBAA8B,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAM1D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/templates/index.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAMpD"}
@@ -1,6 +1,6 @@
1
1
  import getTemplateApi from "./controllers/getTemplate.js";
2
2
  import { getTemplateSchema } from "./schema.js";
3
3
  const policy = "L0";
4
- export default async function route(app, opt = {}) {
4
+ export default function route(app, opt = {}) {
5
5
  app.get("/template/:type/:name", { config: { policy }, schema: getTemplateSchema }, getTemplateApi);
6
6
  }
@@ -1,3 +1,3 @@
1
- declare function plugin(app: any, opt?: any): Promise<void>;
1
+ declare function plugin(app: any, opt?: any): void;
2
2
  export default plugin;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/util/index.ts"],"names":[],"mappings":"AAQA,iBAAe,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAsB5C;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/util/index.ts"],"names":[],"mappings":"AAQA,iBAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QAsBtC;AAED,eAAe,MAAM,CAAC"}
@@ -3,7 +3,7 @@ import nextId from "./controllers/next.id.js";
3
3
  import statusMonitor from "./controllers/status.monitor.js";
4
4
  import userTokens from "./controllers/user.tokens.js";
5
5
  import codeGenerator from "./controllers/code.generator.js";
6
- async function plugin(app, opt = {}) {
6
+ function plugin(app, opt = {}) {
7
7
  app.get("/next-id", { config: { policy: "L0" } }, nextId);
8
8
  app.get("/status-monitor", { config: { role: "admin" } }, statusMonitor);
9
9
  app.get("/user-tokens/:token", { config: { role: "admin|regular" } }, userTokens);
@@ -1,2 +1,2 @@
1
- export default function route(app: any, opt?: any): Promise<void>;
1
+ export default function route(app: any, opt?: any): void;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/widget/index.ts"],"names":[],"mappings":"AAyCA,wBAA8B,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,iBAS1D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/routes/widget/index.ts"],"names":[],"mappings":"AAyCA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAE,GAAQ,QASpD"}
@@ -33,7 +33,7 @@ const tableSchema = {
33
33
  addHook("onWidgetSet", onWidgetSet);
34
34
  const policy = "L0";
35
35
  const params = { config: { policy }, schema: tableSchema };
36
- export default async function route(app, opt = {}) {
36
+ export default function route(app, opt = {}) {
37
37
  app.delete("/widget/:type/:objectid/:id", params, widgetDel);
38
38
  app.post("/widget/:type/:objectid/:id?", params, widgetSet);
39
39
  app.put("/file-edit/:id", params, fileEdit);
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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AAgB,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;