@opengis/fastify-table 1.0.70 → 1.0.72

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 (44) hide show
  1. package/.eslintrc.cjs +42 -42
  2. package/Changelog.md +229 -225
  3. package/README.md +26 -26
  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/utils/checkXSS.js +45 -45
  9. package/crud/controllers/utils/xssInjection.js +72 -72
  10. package/crud/funcs/isFileExists.js +13 -13
  11. package/crud/funcs/setToken.js +53 -53
  12. package/index.js +97 -89
  13. package/migration/exec.migrations.js +75 -75
  14. package/notification/controllers/testEmail.js +49 -49
  15. package/notification/funcs/utils/sendEmail.js +39 -39
  16. package/notification/index.js +31 -31
  17. package/package.json +27 -25
  18. package/pg/funcs/getPG.js +29 -29
  19. package/redis/funcs/getRedis.js +23 -23
  20. package/server/migrations/crm.sql +150 -150
  21. package/server/migrations/log.sql +43 -43
  22. package/server.js +14 -14
  23. package/table/controllers/filter.js +37 -37
  24. package/table/controllers/form.js +19 -1
  25. package/table/controllers/search.js +72 -72
  26. package/table/controllers/suggest.js +1 -1
  27. package/table/controllers/utils/getTemplate.js +28 -28
  28. package/table/controllers/utils/getTemplates.js +18 -18
  29. package/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
  30. package/test/api/notification.test.js +37 -37
  31. package/test/api/table.test.js +57 -57
  32. package/test/api/widget.test.js +114 -114
  33. package/test/config.example +18 -18
  34. package/test/funcs/crud.test.js +76 -76
  35. package/test/funcs/notification.test.js +31 -31
  36. package/test/funcs/pg.test.js +34 -34
  37. package/test/funcs/redis.test.js +19 -19
  38. package/test/templates/cls/test.json +9 -9
  39. package/test/templates/form/cp_building.form.json +32 -32
  40. package/test/templates/select/account_id.json +3 -3
  41. package/test/templates/select/storage.data.json +2 -2
  42. package/test/templates/table/gis.dataset.table.json +20 -20
  43. package/util/controllers/next.id.js +4 -4
  44. package/util/index.js +13 -13
package/.eslintrc.cjs CHANGED
@@ -1,42 +1,42 @@
1
- /* eslint-env node */
2
-
3
- module.exports = {
4
- env: {
5
- node: true,
6
- },
7
- root: true,
8
- extends: [
9
- 'eslint:recommended',
10
- 'airbnb-base',
11
-
12
- ],
13
- rules: {
14
- 'brace-style': [2, 'stroustrup', { allowSingleLine: true }],
15
- 'vue/max-attributes-per-line': 0,
16
- 'vue/valid-v-for': 0,
17
-
18
- // allow async-await
19
- 'generator-star-spacing': 'off',
20
-
21
- // allow paren-less arrow functions
22
- 'arrow-parens': 0,
23
- 'one-var': 0,
24
- 'max-len': 0,
25
- 'import/first': 0,
26
- 'import/named': 2,
27
- 'import/namespace': 2,
28
- 'import/default': 2,
29
- 'import/export': 2,
30
- 'import/extensions': 0,
31
- 'no-console': ['warn', { allow: ['warn', 'error'] }],
32
- 'import/no-unresolved': 0,
33
- 'import/no-extraneous-dependencies': 0,
34
- 'linebreak-style': ['error', 'unix'],
35
- // allow debugger during development
36
- 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
37
- },
38
-
39
- parserOptions: {
40
- ecmaVersion: 'latest',
41
- },
42
- };
1
+ /* eslint-env node */
2
+
3
+ module.exports = {
4
+ env: {
5
+ node: true,
6
+ },
7
+ root: true,
8
+ extends: [
9
+ 'eslint:recommended',
10
+ 'airbnb-base',
11
+
12
+ ],
13
+ rules: {
14
+ 'brace-style': [2, 'stroustrup', { allowSingleLine: true }],
15
+ 'vue/max-attributes-per-line': 0,
16
+ 'vue/valid-v-for': 0,
17
+
18
+ // allow async-await
19
+ 'generator-star-spacing': 'off',
20
+
21
+ // allow paren-less arrow functions
22
+ 'arrow-parens': 0,
23
+ 'one-var': 0,
24
+ 'max-len': 0,
25
+ 'import/first': 0,
26
+ 'import/named': 2,
27
+ 'import/namespace': 2,
28
+ 'import/default': 2,
29
+ 'import/export': 2,
30
+ 'import/extensions': 0,
31
+ 'no-console': ['warn', { allow: ['warn', 'error'] }],
32
+ 'import/no-unresolved': 0,
33
+ 'import/no-extraneous-dependencies': 0,
34
+ 'linebreak-style': ['error', 'unix'],
35
+ // allow debugger during development
36
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
37
+ },
38
+
39
+ parserOptions: {
40
+ ecmaVersion: 'latest',
41
+ },
42
+ };
package/Changelog.md CHANGED
@@ -1,225 +1,229 @@
1
- # fastify-table
2
-
3
- ## 1.0.70 - 29.07.2024
4
-
5
- - add cron funcs and API
6
-
7
- ## 1.0.69 - 26.07.2024
8
-
9
- - add column classifier mode for data API
10
-
11
- ## 1.0.68 - 26.07.2024
12
-
13
- - code optimization
14
-
15
- ## 1.0.66 - 25.07.2024
16
-
17
- - add notification compile template from data params support
18
-
19
- ## 1.0.65 - 23.07.2024
20
-
21
- - add rest API token support
22
-
23
- ## 1.0.62 - 22.07.2024
24
-
25
- - add email notification func and test api
26
-
27
- ## 1.0.61 - 18.07.2024
28
-
29
- - add custom actions for table
30
-
31
- ## 1.0.60 - 12.07.2024
32
-
33
- - code optimization
34
-
35
- ## 1.0.59 - 12.07.2024
36
-
37
- - code optimization
38
-
39
- ## 1.0.58 - 08.07.2024
40
-
41
- - code optimization
42
-
43
- ## 1.0.57 - 04.07.2024
44
-
45
- - fix crud update boolean column
46
-
47
- ## 1.0.56 - 04.07.2024
48
-
49
- - code optimization
50
-
51
- ## 1.0.55 - 02.07.2024
52
-
53
- - callback support
54
-
55
- ## 1.0.54 - 01.07.2024
56
-
57
- - code optimization
58
-
59
- ## 1.0.53 - 28.06.2024
60
-
61
- - add migrations support
62
-
63
- ## 1.0.52 - 28.06.2024
64
-
65
- - add table get api
66
-
67
- ## 1.0.51 - 27.06.2024
68
-
69
- - add next-id api
70
-
71
- ## 1.0.50 - 27.06.2024
72
-
73
- - refactor search api
74
-
75
- ## 1.0.49 - 26.06.2024
76
-
77
- - refactor - npm settings
78
-
79
- ## 1.0.48 - 26.06.2024
80
-
81
- - search api no specified table mode support
82
-
83
- ## 1.0.47 - 25.06.2024
84
-
85
- - add extra properties support
86
-
87
- ## 1.0.46 - 24.06.2024
88
-
89
- - fix data api edit geometry
90
-
91
- ## 1.0.45 - 19.06.2024
92
-
93
- - fix data api table template order
94
-
95
- ## 1.0.44 - 18.06.2024
96
-
97
- - add extra data support (form DataTable)
98
-
99
- ## 1.0.43 - 14.06.2024
100
-
101
- - add settings api, funcs, migration
102
-
103
- ## 1.0.42 - 12.06.2024
104
-
105
- - table cardSql support
106
-
107
- ## 1.0.41 - 12.06.2024
108
-
109
- - cls to db (crm.cls)
110
-
111
- ## 1.0.40 - 12.06.2024
112
-
113
- - fix widget GET API
114
-
115
- ## 1.0.39 - 29.05.2024
116
-
117
- - add getFolder func
118
-
119
- ## 1.0.37 - 23.05.2024
120
-
121
- - add gallery widget
122
-
123
- ## 1.0.36 - 22.05.2024
124
-
125
- - fix filter api array processing
126
-
127
- ## 1.0.31 - 20.05.2024
128
-
129
- - widget db structure refactor
130
-
131
- ## 1.0.30 - 17.05.2024
132
-
133
- - code optimization
134
-
135
- ## 1.0.29 - 17.05.2024
136
-
137
- - widget api post (file)
138
-
139
- ## 1.0.28 - 14.05.2024
140
-
141
- - dblist api set
142
-
143
- ## 1.0.27 - 12.05.2024
144
-
145
- - code optimization
146
-
147
- ## 1.0.26 - 09.05.2024
148
-
149
- - fix getTableSql
150
-
151
- ## 1.0.25 - 08.05.2024
152
-
153
- - decorator to hook
154
-
155
- ## 1.0.24 - 07.05.2024
156
-
157
- - getTemplate page
158
-
159
- ## 1.0.23 - 07.05.2024
160
-
161
- - getTemplate funcs
162
- - dblist api
163
-
164
- ## 1.0.22 - 03.05.2024
165
-
166
- - getFilterSQL funcs
167
-
168
- ## 1.0.21 - 03.05.2024
169
-
170
- - fix widget db structure
171
-
172
- ## 1.0.20 - 03.05.2024
173
-
174
- - fix filter separator
175
-
176
- ## 1.0.19 - 02.05.2024
177
-
178
- - widget plugin
179
- - notification plugin
180
-
181
- ## 1.0.9 - 29.04.2024
182
-
183
- - crud token support
184
- - security - xss restriction
185
-
186
- ## 1.0.8 - 29.04.2024
187
-
188
- - filter fix
189
-
190
- ## 1.0.7 - 26.04.2024
191
-
192
- - code optimization
193
-
194
- ## 1.0.6 - 25.04.2024
195
-
196
- - code optimization
197
-
198
- ## 1.0.5 - 24.04.2024
199
-
200
- - code optimization
201
-
202
- ## 1.0.4 - 20.04.2024
203
-
204
- - data api - order
205
- - suggest api - db support
206
- - del api fix
207
-
208
- ## 1.0.3 - 17.04.2024
209
-
210
- - fix unit test
211
-
212
- ## 1.0.2 - 14.04.2024
213
-
214
- - fix redis
215
-
216
- ## 1.0.1 - 14.04.2024
217
-
218
- - fix redis
219
-
220
- ## 1.0.0 - 14.04.2024
221
-
222
- - crud
223
- - pg
224
- - redis
225
- - table
1
+ # fastify-table
2
+
3
+ ## 1.0.71 - 01.08.2024
4
+
5
+ - add compile settings to form
6
+
7
+ ## 1.0.70 - 29.07.2024
8
+
9
+ - add cron funcs and API
10
+
11
+ ## 1.0.69 - 26.07.2024
12
+
13
+ - add column classifier mode for data API
14
+
15
+ ## 1.0.68 - 26.07.2024
16
+
17
+ - code optimization
18
+
19
+ ## 1.0.66 - 25.07.2024
20
+
21
+ - add notification compile template from data params support
22
+
23
+ ## 1.0.65 - 23.07.2024
24
+
25
+ - add rest API token support
26
+
27
+ ## 1.0.62 - 22.07.2024
28
+
29
+ - add email notification func and test api
30
+
31
+ ## 1.0.61 - 18.07.2024
32
+
33
+ - add custom actions for table
34
+
35
+ ## 1.0.60 - 12.07.2024
36
+
37
+ - code optimization
38
+
39
+ ## 1.0.59 - 12.07.2024
40
+
41
+ - code optimization
42
+
43
+ ## 1.0.58 - 08.07.2024
44
+
45
+ - code optimization
46
+
47
+ ## 1.0.57 - 04.07.2024
48
+
49
+ - fix crud update boolean column
50
+
51
+ ## 1.0.56 - 04.07.2024
52
+
53
+ - code optimization
54
+
55
+ ## 1.0.55 - 02.07.2024
56
+
57
+ - callback support
58
+
59
+ ## 1.0.54 - 01.07.2024
60
+
61
+ - code optimization
62
+
63
+ ## 1.0.53 - 28.06.2024
64
+
65
+ - add migrations support
66
+
67
+ ## 1.0.52 - 28.06.2024
68
+
69
+ - add table get api
70
+
71
+ ## 1.0.51 - 27.06.2024
72
+
73
+ - add next-id api
74
+
75
+ ## 1.0.50 - 27.06.2024
76
+
77
+ - refactor search api
78
+
79
+ ## 1.0.49 - 26.06.2024
80
+
81
+ - refactor - npm settings
82
+
83
+ ## 1.0.48 - 26.06.2024
84
+
85
+ - search api no specified table mode support
86
+
87
+ ## 1.0.47 - 25.06.2024
88
+
89
+ - add extra properties support
90
+
91
+ ## 1.0.46 - 24.06.2024
92
+
93
+ - fix data api edit geometry
94
+
95
+ ## 1.0.45 - 19.06.2024
96
+
97
+ - fix data api table template order
98
+
99
+ ## 1.0.44 - 18.06.2024
100
+
101
+ - add extra data support (form DataTable)
102
+
103
+ ## 1.0.43 - 14.06.2024
104
+
105
+ - add settings api, funcs, migration
106
+
107
+ ## 1.0.42 - 12.06.2024
108
+
109
+ - table cardSql support
110
+
111
+ ## 1.0.41 - 12.06.2024
112
+
113
+ - cls to db (crm.cls)
114
+
115
+ ## 1.0.40 - 12.06.2024
116
+
117
+ - fix widget GET API
118
+
119
+ ## 1.0.39 - 29.05.2024
120
+
121
+ - add getFolder func
122
+
123
+ ## 1.0.37 - 23.05.2024
124
+
125
+ - add gallery widget
126
+
127
+ ## 1.0.36 - 22.05.2024
128
+
129
+ - fix filter api array processing
130
+
131
+ ## 1.0.31 - 20.05.2024
132
+
133
+ - widget db structure refactor
134
+
135
+ ## 1.0.30 - 17.05.2024
136
+
137
+ - code optimization
138
+
139
+ ## 1.0.29 - 17.05.2024
140
+
141
+ - widget api post (file)
142
+
143
+ ## 1.0.28 - 14.05.2024
144
+
145
+ - dblist api set
146
+
147
+ ## 1.0.27 - 12.05.2024
148
+
149
+ - code optimization
150
+
151
+ ## 1.0.26 - 09.05.2024
152
+
153
+ - fix getTableSql
154
+
155
+ ## 1.0.25 - 08.05.2024
156
+
157
+ - decorator to hook
158
+
159
+ ## 1.0.24 - 07.05.2024
160
+
161
+ - getTemplate page
162
+
163
+ ## 1.0.23 - 07.05.2024
164
+
165
+ - getTemplate funcs
166
+ - dblist api
167
+
168
+ ## 1.0.22 - 03.05.2024
169
+
170
+ - getFilterSQL funcs
171
+
172
+ ## 1.0.21 - 03.05.2024
173
+
174
+ - fix widget db structure
175
+
176
+ ## 1.0.20 - 03.05.2024
177
+
178
+ - fix filter separator
179
+
180
+ ## 1.0.19 - 02.05.2024
181
+
182
+ - widget plugin
183
+ - notification plugin
184
+
185
+ ## 1.0.9 - 29.04.2024
186
+
187
+ - crud token support
188
+ - security - xss restriction
189
+
190
+ ## 1.0.8 - 29.04.2024
191
+
192
+ - filter fix
193
+
194
+ ## 1.0.7 - 26.04.2024
195
+
196
+ - code optimization
197
+
198
+ ## 1.0.6 - 25.04.2024
199
+
200
+ - code optimization
201
+
202
+ ## 1.0.5 - 24.04.2024
203
+
204
+ - code optimization
205
+
206
+ ## 1.0.4 - 20.04.2024
207
+
208
+ - data api - order
209
+ - suggest api - db support
210
+ - del api fix
211
+
212
+ ## 1.0.3 - 17.04.2024
213
+
214
+ - fix unit test
215
+
216
+ ## 1.0.2 - 14.04.2024
217
+
218
+ - fix redis
219
+
220
+ ## 1.0.1 - 14.04.2024
221
+
222
+ - fix redis
223
+
224
+ ## 1.0.0 - 14.04.2024
225
+
226
+ - crud
227
+ - pg
228
+ - redis
229
+ - table
package/README.md CHANGED
@@ -1,26 +1,26 @@
1
- # fastify-table
2
-
3
- [![NPM version](https://img.shields.io/npm/v/@opengis/fastify-table)](https://www.npmjs.com/package/@opengis/fastify-table)
4
- [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
5
-
6
- It standardizes the entire form building process, while taking care of everything from rendering to validation and processing:
7
-
8
- - pg
9
- - redis
10
- - crud
11
-
12
- ## Install
13
-
14
- ```bash
15
- npm i @opengis/fastify-table
16
- ```
17
-
18
- ## Usage
19
-
20
- ```js
21
- fastify.register(import('@opengis/fastify-table'), config);
22
- ```
23
-
24
- ## Documenation
25
-
26
- For a detailed understanding fastify-table, its features, and how to use them, refer to our [Documentation](https://apidocs.softpro.ua/gis.storage/).
1
+ # fastify-table
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/@opengis/fastify-table)](https://www.npmjs.com/package/@opengis/fastify-table)
4
+ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
5
+
6
+ It standardizes the entire form building process, while taking care of everything from rendering to validation and processing:
7
+
8
+ - pg
9
+ - redis
10
+ - crud
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm i @opengis/fastify-table
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```js
21
+ fastify.register(import('@opengis/fastify-table'), config);
22
+ ```
23
+
24
+ ## Documenation
25
+
26
+ For a detailed understanding fastify-table, its features, and how to use them, refer to our [Documentation](https://apidocs.softpro.ua/gis.storage/).
@@ -1,22 +1,22 @@
1
- import cronList from './utils/cronList.js';
2
-
3
- export default async function cronApi(req) {
4
- const {
5
- params = {}, user = {}, hostname,
6
- } = req;
7
-
8
- if ((!user.uid || !user.user_type?.includes('admin')) && !hostname?.includes('localhost')) {
9
- return { message: 'access restricted', status: 403 };
10
- }
11
-
12
- if (params.name === 'list') {
13
- return { data: Object.keys(cronList || {}) };
14
- }
15
-
16
- if (!cronList[params.name]) {
17
- return { message: `cron not found: ${params.name}`, status: 404 };
18
- }
19
-
20
- const result = await cronList[params.name](req);
21
- return result;
22
- }
1
+ import cronList from './utils/cronList.js';
2
+
3
+ export default async function cronApi(req) {
4
+ const {
5
+ params = {}, user = {}, hostname,
6
+ } = req;
7
+
8
+ if ((!user.uid || !user.user_type?.includes('admin')) && !hostname?.includes('localhost')) {
9
+ return { message: 'access restricted', status: 403 };
10
+ }
11
+
12
+ if (params.name === 'list') {
13
+ return { data: Object.keys(cronList || {}) };
14
+ }
15
+
16
+ if (!cronList[params.name]) {
17
+ return { message: `cron not found: ${params.name}`, status: 404 };
18
+ }
19
+
20
+ const result = await cronList[params.name](req);
21
+ return result;
22
+ }
@@ -1 +1 @@
1
- export default {};
1
+ export default {};