@opengis/fastify-table 1.4.44 → 1.4.45
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.
- package/README.md +86 -86
- package/package.json +1 -1
- package/server/helpers/core/token.js +18 -18
- package/server/helpers/format/formatAuto.js +13 -13
- package/server/helpers/format/formatDate.js +258 -258
- package/server/helpers/format/formatDigit.js +20 -20
- package/server/helpers/format/formatNum.js +361 -361
- package/server/helpers/format/formatNumber.js +54 -54
- package/server/helpers/format/formatRelative.js +106 -106
- package/server/helpers/format/formatUnit.js +38 -38
- package/server/helpers/format/num_format.js +41 -41
- package/server/helpers/funcs/_math.js +49 -49
- package/server/helpers/funcs/empty.js +21 -21
- package/server/helpers/funcs/ifCond.js +106 -106
- package/server/helpers/funcs/ifCondAnd.js +96 -96
- package/server/helpers/funcs/ifCondOr.js +98 -98
- package/server/helpers/funcs/inc.js +20 -20
- package/server/helpers/funcs/json.js +2 -2
- package/server/helpers/funcs/round.js +27 -27
- package/server/helpers/list/buttonHelper.js +21 -21
- package/server/helpers/list/utils/button.js +5 -5
- package/server/helpers/string/coalesce.js +31 -31
- package/server/helpers/string/concat.js +28 -28
- package/server/helpers/string/split.js +19 -19
- package/server/helpers/string/str_replace.js +60 -60
- package/server/helpers/string/substr.js +31 -31
- package/server/helpers/string/translit.js +23 -23
- package/server/helpers/string/utils/alphabet.js +75 -75
- package/server/helpers/utils/button.js +5 -5
- package/server/helpers/utils/mdToHTML.js +17 -17
- package/server/plugins/cron/funcs/addCron.js +52 -52
- package/server/plugins/cron/index.js +76 -76
- package/server/plugins/crud/funcs/dataDelete.js +2 -2
- package/server/plugins/crud/funcs/getOpt.js +14 -14
- package/server/plugins/crud/funcs/setOpt.js +21 -21
- package/server/plugins/crud/funcs/setToken.js +43 -43
- package/server/plugins/crud/funcs/utils/getFolder.js +11 -11
- package/server/plugins/crud/index.js +23 -23
- package/server/plugins/hook/index.js +8 -8
- package/server/plugins/logger/errorStatus.js +19 -19
- package/server/plugins/logger/index.js +26 -26
- package/server/plugins/migration/index.js +7 -7
- package/server/plugins/policy/sqlInjection.js +33 -33
- package/server/plugins/redis/client.js +8 -8
- package/server/plugins/redis/funcs/redisClients.js +3 -3
- package/server/plugins/redis/index.js +17 -17
- package/server/plugins/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
- package/server/plugins/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
- package/server/plugins/table/funcs/getTemplates.js +19 -19
- package/server/plugins/table/funcs/gisIRColumn.js +82 -82
- package/server/plugins/table/funcs/loadTemplate.js +1 -1
- package/server/plugins/table/funcs/loadTemplatePath.js +1 -1
- package/server/plugins/table/funcs/userTemplateDir.js +1 -1
- package/server/plugins/util/index.js +7 -7
- package/server/routes/logger/controllers/utils/getRootDir.js +26 -26
- package/server/routes/table/controllers/form.js +42 -42
- package/server/routes/table/controllers/search.js +74 -74
- package/server/routes/util/controllers/status.monitor.js +8 -8
package/README.md
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
# fastify-table
|
|
2
|
-
|
|
3
|
-
<!--  -->
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@opengis/fastify-table)
|
|
6
|
-
[]()
|
|
7
|
-
[]()
|
|
8
|
-
[](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>
|
|
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>
|
|
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>
|
|
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>
|
|
83
|
-
</p>
|
|
84
|
-
|
|
85
|
-
### License
|
|
86
|
-
|
|
1
|
+
# fastify-table
|
|
2
|
+
|
|
3
|
+
<!--  -->
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@opengis/fastify-table)
|
|
6
|
+
[]()
|
|
7
|
+
[]()
|
|
8
|
+
[](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>
|
|
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>
|
|
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>
|
|
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>
|
|
83
|
+
</p>
|
|
84
|
+
|
|
85
|
+
### License
|
|
86
|
+
|
|
87
87
|
Copyright © SOFTPRO. All rights reserved.
|
package/package.json
CHANGED
|
@@ -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
|
+
};
|