@opengis/fastify-table 1.1.4 → 1.1.6

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 (50) hide show
  1. package/Changelog.md +4 -0
  2. package/README.md +26 -26
  3. package/config.js +10 -10
  4. package/cron/controllers/cronApi.js +22 -22
  5. package/cron/controllers/utils/cronList.js +1 -1
  6. package/cron/funcs/addCron.js +131 -131
  7. package/cron/index.js +10 -10
  8. package/crud/controllers/insert.js +5 -2
  9. package/crud/controllers/update.js +3 -2
  10. package/crud/controllers/utils/checkXSS.js +45 -45
  11. package/crud/controllers/utils/xssInjection.js +72 -72
  12. package/crud/funcs/dataUpdate.js +30 -30
  13. package/crud/funcs/getToken.js +27 -27
  14. package/crud/funcs/isFileExists.js +13 -13
  15. package/crud/funcs/setToken.js +53 -53
  16. package/notification/controllers/testEmail.js +49 -49
  17. package/notification/funcs/utils/sendEmail.js +39 -39
  18. package/notification/index.js +38 -38
  19. package/package.json +1 -1
  20. package/pg/funcs/getPG.js +30 -30
  21. package/redis/funcs/getRedis.js +23 -23
  22. package/server/migrations/crm.sql +150 -150
  23. package/server/migrations/log.sql +80 -80
  24. package/server/templates/select/test.storage.data.json +3 -3
  25. package/server/templates/select/test.suggest.ato_new.json +2 -2
  26. package/server/templates/select/test.suggest.ato_new.sql +25 -25
  27. package/server/templates/select/test.suggest.data.json +4 -4
  28. package/server/templates/select/test.suggest.parent.sql +2 -2
  29. package/server.js +14 -14
  30. package/table/controllers/card.js +44 -44
  31. package/table/controllers/form.js +28 -28
  32. package/test/api/crud.xss.test.js +72 -72
  33. package/test/api/notification.test.js +37 -37
  34. package/test/api/suggest.test.js +65 -65
  35. package/test/config.example +18 -18
  36. package/test/funcs/notification.test.js +31 -31
  37. package/test/funcs/pg.test.js +34 -34
  38. package/test/funcs/redis.test.js +19 -19
  39. package/test/templates/cls/test.json +9 -9
  40. package/test/templates/form/cp_building.form.json +32 -32
  41. package/test/templates/select/account_id.json +3 -3
  42. package/test/templates/select/storage.data.json +2 -2
  43. package/test/templates/table/gis.dataset.table.json +20 -20
  44. package/util/controllers/logger.file.js +90 -90
  45. package/util/controllers/next.id.js +4 -4
  46. package/util/controllers/properties.get.js +19 -19
  47. package/util/controllers/utils/checkUserAccess.js +19 -19
  48. package/util/controllers/utils/getRootDir.js +20 -20
  49. package/util/index.js +23 -23
  50. package/utils.js +36 -1
package/util/index.js CHANGED
@@ -1,23 +1,23 @@
1
- import getExtraProperties from './controllers/properties.get.js';
2
- import addExtraProperties from './controllers/properties.add.js';
3
- import nextId from './controllers/next.id.js';
4
- import statusMonitor from './controllers/status.monitor.js';
5
- import loggerFile from './controllers/logger.file.js';
6
-
7
- const propertiesSchema = {
8
- params: {
9
- id: { type: 'string', pattern: '^([\\d\\w]+)$' },
10
- },
11
- };
12
-
13
- async function plugin(fastify, config = {}) {
14
- const prefix = config.prefix || '/api';
15
-
16
- fastify.get(`${prefix}/next-id`, {}, nextId);
17
- fastify.get(`${prefix}/status-monitor`, {}, statusMonitor);
18
- fastify.get(`${prefix}/properties/:id`, { schema: propertiesSchema }, getExtraProperties);
19
- fastify.post(`${prefix}/properties/:id`, { schema: propertiesSchema }, addExtraProperties);
20
- fastify.get('/logger-file/*', { config: { policy: ['log'] } }, loggerFile);
21
- }
22
-
23
- export default plugin;
1
+ import getExtraProperties from './controllers/properties.get.js';
2
+ import addExtraProperties from './controllers/properties.add.js';
3
+ import nextId from './controllers/next.id.js';
4
+ import statusMonitor from './controllers/status.monitor.js';
5
+ import loggerFile from './controllers/logger.file.js';
6
+
7
+ const propertiesSchema = {
8
+ params: {
9
+ id: { type: 'string', pattern: '^([\\d\\w]+)$' },
10
+ },
11
+ };
12
+
13
+ async function plugin(fastify, config = {}) {
14
+ const prefix = config.prefix || '/api';
15
+
16
+ fastify.get(`${prefix}/next-id`, {}, nextId);
17
+ fastify.get(`${prefix}/status-monitor`, {}, statusMonitor);
18
+ fastify.get(`${prefix}/properties/:id`, { schema: propertiesSchema }, getExtraProperties);
19
+ fastify.post(`${prefix}/properties/:id`, { schema: propertiesSchema }, addExtraProperties);
20
+ fastify.get('/logger-file/*', { config: { policy: ['log'] } }, loggerFile);
21
+ }
22
+
23
+ export default plugin;
package/utils.js CHANGED
@@ -4,6 +4,41 @@
4
4
  import getTemplate from './table/controllers/utils/getTemplate.js';
5
5
  import addTemplateDir from './table/controllers/utils/addTemplateDir.js';
6
6
  import metaFormat from './table/funcs/metaFormat/index.js';
7
+ import autoIndex from './pg/funcs/autoIndex.js';
8
+
9
+ import getPG from './pg/funcs/getPG.js';
10
+ import initPG from './pg/funcs/init.js';
11
+ import pgClients from './pg/pgClients.js';
12
+ import getRedis from './redis/funcs/getRedis.js';
13
+
14
+ import dataInsert from './crud/funcs/dataInsert.js';
15
+ import dataUpdate from './crud/funcs/dataUpdate.js';
16
+ import dataDelete from './crud/funcs/dataDelete.js';
17
+
18
+ import getToken from './crud/funcs/getToken.js';
19
+ import setToken from './crud/funcs/setToken.js';
20
+ import checkXSS from './crud/controllers/utils/checkXSS.js';
21
+ import gisIRColumn from './table/controllers/utils/gisIRColumn.js';
22
+ import getMeta from './pg/funcs/getMeta.js';
23
+ import getAccess from './crud/funcs/getAccess.js';
7
24
 
8
25
  export default null;
9
- export { getTemplate, metaFormat, addTemplateDir };
26
+ export {
27
+ getTemplate,
28
+ metaFormat,
29
+ autoIndex,
30
+ addTemplateDir,
31
+ getPG,
32
+ initPG,
33
+ pgClients,
34
+ dataInsert,
35
+ dataUpdate,
36
+ dataDelete,
37
+ getRedis,
38
+ getToken,
39
+ setToken,
40
+ checkXSS,
41
+ gisIRColumn,
42
+ getMeta,
43
+ getAccess,
44
+ };