@opengis/fastify-table 1.4.45 → 1.4.46

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 (60) hide show
  1. package/README.md +86 -86
  2. package/package.json +1 -1
  3. package/server/helpers/core/token.js +18 -18
  4. package/server/helpers/format/formatAuto.js +13 -13
  5. package/server/helpers/format/formatDate.js +258 -258
  6. package/server/helpers/format/formatDigit.js +20 -20
  7. package/server/helpers/format/formatNum.js +361 -361
  8. package/server/helpers/format/formatNumber.js +54 -54
  9. package/server/helpers/format/formatRelative.js +106 -106
  10. package/server/helpers/format/formatUnit.js +38 -38
  11. package/server/helpers/format/num_format.js +41 -41
  12. package/server/helpers/funcs/_math.js +49 -49
  13. package/server/helpers/funcs/empty.js +21 -21
  14. package/server/helpers/funcs/ifCond.js +106 -106
  15. package/server/helpers/funcs/ifCondAnd.js +96 -96
  16. package/server/helpers/funcs/ifCondOr.js +98 -98
  17. package/server/helpers/funcs/inc.js +20 -20
  18. package/server/helpers/funcs/json.js +2 -2
  19. package/server/helpers/funcs/round.js +27 -27
  20. package/server/helpers/list/buttonHelper.js +21 -21
  21. package/server/helpers/list/utils/button.js +5 -5
  22. package/server/helpers/string/coalesce.js +31 -31
  23. package/server/helpers/string/concat.js +28 -28
  24. package/server/helpers/string/split.js +19 -19
  25. package/server/helpers/string/str_replace.js +60 -60
  26. package/server/helpers/string/substr.js +31 -31
  27. package/server/helpers/string/translit.js +23 -23
  28. package/server/helpers/string/utils/alphabet.js +75 -75
  29. package/server/helpers/utils/button.js +5 -5
  30. package/server/helpers/utils/mdToHTML.js +17 -17
  31. package/server/plugins/cron/funcs/addCron.js +52 -52
  32. package/server/plugins/cron/index.js +76 -76
  33. package/server/plugins/crud/funcs/getOpt.js +14 -14
  34. package/server/plugins/crud/funcs/setOpt.js +21 -21
  35. package/server/plugins/crud/funcs/setToken.js +43 -43
  36. package/server/plugins/crud/funcs/utils/getFolder.js +11 -11
  37. package/server/plugins/crud/index.js +23 -23
  38. package/server/plugins/hook/index.js +8 -8
  39. package/server/plugins/logger/errorStatus.js +19 -19
  40. package/server/plugins/logger/index.js +26 -26
  41. package/server/plugins/migration/index.js +7 -7
  42. package/server/plugins/policy/sqlInjection.js +33 -33
  43. package/server/plugins/redis/client.js +8 -8
  44. package/server/plugins/redis/funcs/redisClients.js +3 -3
  45. package/server/plugins/redis/index.js +17 -17
  46. package/server/plugins/table/funcs/getData.js +2 -2
  47. package/server/plugins/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
  48. package/server/plugins/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
  49. package/server/plugins/table/funcs/getTemplates.js +19 -19
  50. package/server/plugins/table/funcs/gisIRColumn.js +82 -82
  51. package/server/plugins/table/funcs/loadTemplate.js +1 -1
  52. package/server/plugins/table/funcs/loadTemplatePath.js +1 -1
  53. package/server/plugins/table/funcs/userTemplateDir.js +1 -1
  54. package/server/plugins/util/index.js +7 -7
  55. package/server/routes/logger/controllers/utils/getRootDir.js +26 -26
  56. package/server/routes/table/controllers/form.js +42 -42
  57. package/server/routes/table/controllers/search.js +74 -74
  58. package/server/routes/table/controllers/tableData.js +3 -3
  59. package/server/routes/table/functions/getData.js +2 -1
  60. package/server/routes/util/controllers/status.monitor.js +8 -8
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # fastify-table
2
-
3
- <!-- ![alt text](https://cdn.softpro.ua/data/npm/admin/opengis-admin.png) -->
4
-
5
- [![NPM version](https://img.shields.io/npm/v/@opengis/fastify-table?style=plain)](https://www.npmjs.com/package/@opengis/fastify-table)
6
- [![NPM last update](https://img.shields.io/npm/last-update/@opengis/fastify-table?style=plain)]()
7
- [![NPM downloads](https://img.shields.io/npm/dw/@opengis/fastify-table?style=plain)]()
8
- [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=plain)](http://standardjs.com/)
9
-
10
- This is a backend toolkit for database management and more.
11
-
12
- ### Why fastify-table?
13
-
14
- - **Logger** - Monitoring user activity and system status.
15
- - **Redis cache** - Optimizes web page rendering for lightning-fast performance.
16
- - **Secure** - Ensures protection against XSS attacks in queries.
17
- - **SQL Migration** - Automatically adds all necessary tables to your project's database.
18
-
19
-
20
- ### Features
21
-
22
- - CRUD
23
- - cron
24
- - Logger
25
- - Redis
26
- - pg
27
-
28
- ---
29
-
30
- ### Install
31
-
32
- ```bash
33
- npm i @opengis/fastify-table
34
- ```
35
-
36
- ### Usage
37
-
38
- ```js
39
- fastify.register(import('@opengis/fastify-table'), config);
40
- ```
41
-
42
- ---
43
-
44
- ### Documenation
45
-
46
- For a detailed understanding `fastify-table`, its features, and how to use them, refer to our [Documentation](https://apidocs.softpro.ua/fastify-table/).
47
-
48
- ---
49
-
50
- ### Technology stack
51
-
52
- <a href="https://fastify.dev/" target="_blank">
53
- <img src="https://img.shields.io/badge/Fastify-323330?style=for-the-badge&logo=fastify" /></a>
54
-
55
- <a href="https://www.postgresql.org/" target="_blank">
56
- <img src="https://img.shields.io/badge/PostgreSQL-323330?style=for-the-badge&logo=postgresql&logoColor=white" /></a>
57
-
58
- <a href="https://redis.io/" target="_blank">
59
- <img src="https://img.shields.io/badge/redis-323330.svg?&style=for-the-badge&logo=redis&logoColor=" /></a>
60
-
61
- <a href="https://www.npmjs.com/package/pino" target="_blank">
62
- <img src="https://img.shields.io/badge/pino-323330.svg?&style=for-the-badge&logo=pino&logoColor=" /></a>
63
-
64
- ---
65
-
66
- ### Contribute
67
-
68
- Feel free to contact us through our website [SOFTPRO.UA](https://softpro.ua) or email <info@softpro.ua>
69
-
70
- - Report bugs
71
- - Share your ideas
72
- - Ask questions
73
-
74
- ### Follow Us
75
-
76
- [Official site](https://softpro.ua)
77
-
78
- <p>
79
- <a href="https://www.instagram.com/gissoftpro/" target="_blank"><img src="https://cdn.softpro.ua/data/npm/instagram.png" alt="Softpro Instagram" title="oftpro Instagram"></a>&nbsp;&nbsp;
80
- <a href="https://www.facebook.com/gissoftpro" target="_blank"><img src="https://cdn.softpro.ua/data/npm/facebook.png" alt="Softpro Facebook" title="Softpro Facebook"></a>&nbsp;&nbsp;
81
- <a href="https://t.me/softprogis" target="_blank"><img src="https://cdn.softpro.ua/data/npm/telegram.png" alt="Softpro Telegram" title="Softpro Telegram"></a>&nbsp;&nbsp;
82
- <a href="https://www.linkedin.com/in/softpro-ukraine-a8876b282/recent-activity/all/" target="_blank"><img src="https://cdn.softpro.ua/data/npm/social/linkedin.png" alt="Softpro Linkedin" title="Softpro LinkedIn"></a>&nbsp;&nbsp;
83
- </p>
84
-
85
- ### License
86
-
1
+ # fastify-table
2
+
3
+ <!-- ![alt text](https://cdn.softpro.ua/data/npm/admin/opengis-admin.png) -->
4
+
5
+ [![NPM version](https://img.shields.io/npm/v/@opengis/fastify-table?style=plain)](https://www.npmjs.com/package/@opengis/fastify-table)
6
+ [![NPM last update](https://img.shields.io/npm/last-update/@opengis/fastify-table?style=plain)]()
7
+ [![NPM downloads](https://img.shields.io/npm/dw/@opengis/fastify-table?style=plain)]()
8
+ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=plain)](http://standardjs.com/)
9
+
10
+ This is a backend toolkit for database management and more.
11
+
12
+ ### Why fastify-table?
13
+
14
+ - **Logger** - Monitoring user activity and system status.
15
+ - **Redis cache** - Optimizes web page rendering for lightning-fast performance.
16
+ - **Secure** - Ensures protection against XSS attacks in queries.
17
+ - **SQL Migration** - Automatically adds all necessary tables to your project's database.
18
+
19
+
20
+ ### Features
21
+
22
+ - CRUD
23
+ - cron
24
+ - Logger
25
+ - Redis
26
+ - pg
27
+
28
+ ---
29
+
30
+ ### Install
31
+
32
+ ```bash
33
+ npm i @opengis/fastify-table
34
+ ```
35
+
36
+ ### Usage
37
+
38
+ ```js
39
+ fastify.register(import('@opengis/fastify-table'), config);
40
+ ```
41
+
42
+ ---
43
+
44
+ ### Documenation
45
+
46
+ For a detailed understanding `fastify-table`, its features, and how to use them, refer to our [Documentation](https://apidocs.softpro.ua/fastify-table/).
47
+
48
+ ---
49
+
50
+ ### Technology stack
51
+
52
+ <a href="https://fastify.dev/" target="_blank">
53
+ <img src="https://img.shields.io/badge/Fastify-323330?style=for-the-badge&logo=fastify" /></a>
54
+
55
+ <a href="https://www.postgresql.org/" target="_blank">
56
+ <img src="https://img.shields.io/badge/PostgreSQL-323330?style=for-the-badge&logo=postgresql&logoColor=white" /></a>
57
+
58
+ <a href="https://redis.io/" target="_blank">
59
+ <img src="https://img.shields.io/badge/redis-323330.svg?&style=for-the-badge&logo=redis&logoColor=" /></a>
60
+
61
+ <a href="https://www.npmjs.com/package/pino" target="_blank">
62
+ <img src="https://img.shields.io/badge/pino-323330.svg?&style=for-the-badge&logo=pino&logoColor=" /></a>
63
+
64
+ ---
65
+
66
+ ### Contribute
67
+
68
+ Feel free to contact us through our website [SOFTPRO.UA](https://softpro.ua) or email <info@softpro.ua>
69
+
70
+ - Report bugs
71
+ - Share your ideas
72
+ - Ask questions
73
+
74
+ ### Follow Us
75
+
76
+ [Official site](https://softpro.ua)
77
+
78
+ <p>
79
+ <a href="https://www.instagram.com/gissoftpro/" target="_blank"><img src="https://cdn.softpro.ua/data/npm/instagram.png" alt="Softpro Instagram" title="oftpro Instagram"></a>&nbsp;&nbsp;
80
+ <a href="https://www.facebook.com/gissoftpro" target="_blank"><img src="https://cdn.softpro.ua/data/npm/facebook.png" alt="Softpro Facebook" title="Softpro Facebook"></a>&nbsp;&nbsp;
81
+ <a href="https://t.me/softprogis" target="_blank"><img src="https://cdn.softpro.ua/data/npm/telegram.png" alt="Softpro Telegram" title="Softpro Telegram"></a>&nbsp;&nbsp;
82
+ <a href="https://www.linkedin.com/in/softpro-ukraine-a8876b282/recent-activity/all/" target="_blank"><img src="https://cdn.softpro.ua/data/npm/social/linkedin.png" alt="Softpro Linkedin" title="Softpro LinkedIn"></a>&nbsp;&nbsp;
83
+ </p>
84
+
85
+ ### License
86
+
87
87
  Copyright © SOFTPRO. All rights reserved.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.4.45",
3
+ "version": "1.4.46",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "keywords": [
@@ -1,18 +1,18 @@
1
- import setToken from '../../plugins/crud/funcs/setToken.js';
2
-
3
- export default function tokenFunc(params) {
4
- const { data, hash } = params;
5
-
6
- if (!data?.root?.user?.uid && !hash.uid) return '-';
7
- if (!hash || typeof hash !== 'object') return '-';
8
-
9
- // const id = hash?.edit ? hash?.id : data?.root?.id;
10
- // console.log(hash)
11
- const [token] = setToken({
12
- ids: [JSON.stringify(hash)],
13
-
14
- uid: data?.root?.user?.uid || hash.uid,
15
- array: 1,
16
- });
17
- return token;
18
- }
1
+ import setToken from '../../plugins/crud/funcs/setToken.js';
2
+
3
+ export default function tokenFunc(params) {
4
+ const { data, hash } = params;
5
+
6
+ if (!data?.root?.user?.uid && !hash.uid) return '-';
7
+ if (!hash || typeof hash !== 'object') return '-';
8
+
9
+ // const id = hash?.edit ? hash?.id : data?.root?.id;
10
+ // console.log(hash)
11
+ const [token] = setToken({
12
+ ids: [JSON.stringify(hash)],
13
+
14
+ uid: data?.root?.user?.uid || hash.uid,
15
+ array: 1,
16
+ });
17
+ return token;
18
+ }
@@ -1,13 +1,13 @@
1
- import formatDate from './formatDate.js'
2
-
3
- export default function formatAuto(data, options = {}) {
4
- const format = options.hash?.format || 'text';
5
- const auto = { true: 'так', false: 'ні' };
6
- if (auto[data]) return auto[data];
7
- if (['date'].includes(format)) {
8
- return formatDate(data, options);
9
- }
10
-
11
- if (typeof data === 'object') { return null; }
12
- return data;
13
- };
1
+ import formatDate from './formatDate.js'
2
+
3
+ export default function formatAuto(data, options = {}) {
4
+ const format = options.hash?.format || 'text';
5
+ const auto = { true: 'так', false: 'ні' };
6
+ if (auto[data]) return auto[data];
7
+ if (['date'].includes(format)) {
8
+ return formatDate(data, options);
9
+ }
10
+
11
+ if (typeof data === 'object') { return null; }
12
+ return data;
13
+ };