@opengis/fastify-table 1.0.81 → 1.0.82

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 (65) hide show
  1. package/.eslintrc.cjs +42 -42
  2. package/Changelog.md +245 -241
  3. package/README.md +26 -26
  4. package/config.js +10 -10
  5. package/cron/controllers/cronApi.js +22 -22
  6. package/cron/controllers/utils/cronList.js +1 -1
  7. package/cron/funcs/addCron.js +131 -131
  8. package/cron/index.js +10 -10
  9. package/crud/controllers/utils/checkXSS.js +45 -45
  10. package/crud/controllers/utils/xssInjection.js +72 -72
  11. package/crud/funcs/dataDelete.js +15 -15
  12. package/crud/funcs/dataUpdate.js +24 -24
  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/crud/index.js +36 -36
  17. package/index.js +97 -97
  18. package/migration/exec.migrations.js +75 -75
  19. package/notification/controllers/testEmail.js +49 -49
  20. package/notification/funcs/sendNotification.js +111 -111
  21. package/notification/funcs/utils/sendEmail.js +39 -39
  22. package/notification/index.js +38 -38
  23. package/package.json +26 -26
  24. package/pg/funcs/getPG.js +30 -30
  25. package/redis/funcs/getRedis.js +23 -23
  26. package/server/migrations/crm.sql +150 -150
  27. package/server/migrations/log.sql +43 -43
  28. package/server/templates/select/test.storage.data.json +3 -2
  29. package/server/templates/select/test.storage.data.sql +1 -1
  30. package/server/templates/select/test.suggest.ato_new.json +3 -0
  31. package/server/templates/select/test.suggest.ato_new.sql +26 -0
  32. package/server/templates/select/test.suggest.data.json +5 -0
  33. package/server/templates/select/test.suggest.data.sql +1 -0
  34. package/server/templates/select/test.suggest.parent.sql +3 -0
  35. package/server.js +14 -14
  36. package/table/controllers/card.js +44 -44
  37. package/table/controllers/data.js +6 -5
  38. package/table/controllers/filter.js +37 -37
  39. package/table/controllers/form.js +28 -28
  40. package/table/controllers/search.js +72 -72
  41. package/table/controllers/suggest.js +62 -62
  42. package/table/controllers/utils/getSelectMeta.js +66 -66
  43. package/table/controllers/utils/getTemplate.js +28 -28
  44. package/table/controllers/utils/getTemplates.js +18 -18
  45. package/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
  46. package/table/funcs/metaFormat/index.js +27 -27
  47. package/test/api/crud.xss.test.js +72 -72
  48. package/test/api/notification.test.js +37 -37
  49. package/test/api/suggest.test.js +66 -0
  50. package/test/api/table.test.js +57 -57
  51. package/test/api/widget.test.js +114 -114
  52. package/test/config.example +18 -18
  53. package/test/funcs/crud.test.js +76 -76
  54. package/test/funcs/notification.test.js +31 -31
  55. package/test/funcs/pg.test.js +34 -34
  56. package/test/funcs/redis.test.js +19 -19
  57. package/test/templates/cls/test.json +9 -9
  58. package/test/templates/form/cp_building.form.json +32 -32
  59. package/test/templates/select/account_id.json +3 -3
  60. package/test/templates/select/storage.data.json +2 -2
  61. package/test/templates/table/gis.dataset.table.json +20 -20
  62. package/util/controllers/next.id.js +4 -4
  63. package/util/controllers/properties.add.js +50 -50
  64. package/util/controllers/properties.get.js +19 -19
  65. package/widget/index.js +40 -40
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,241 +1,245 @@
1
- # fastify-table
2
-
3
- ## 1.0.81 - 15.08.2024
4
-
5
- - refactor /table API
6
-
7
- ## 1.0.77 - 13.08.2024
8
-
9
- - add statusMonitor API
10
-
11
- ## 1.0.75 - 12.08.2024
12
-
13
- - something do
14
-
15
- ## 1.0.71 - 01.08.2024
16
-
17
- - add compile settings to form
18
-
19
- ## 1.0.70 - 29.07.2024
20
-
21
- - add cron funcs and API
22
-
23
- ## 1.0.69 - 26.07.2024
24
-
25
- - add column classifier mode for data API
26
-
27
- ## 1.0.68 - 26.07.2024
28
-
29
- - code optimization
30
-
31
- ## 1.0.66 - 25.07.2024
32
-
33
- - add notification compile template from data params support
34
-
35
- ## 1.0.65 - 23.07.2024
36
-
37
- - add rest API token support
38
-
39
- ## 1.0.62 - 22.07.2024
40
-
41
- - add email notification func and test api
42
-
43
- ## 1.0.61 - 18.07.2024
44
-
45
- - add custom actions for table
46
-
47
- ## 1.0.60 - 12.07.2024
48
-
49
- - code optimization
50
-
51
- ## 1.0.59 - 12.07.2024
52
-
53
- - code optimization
54
-
55
- ## 1.0.58 - 08.07.2024
56
-
57
- - code optimization
58
-
59
- ## 1.0.57 - 04.07.2024
60
-
61
- - fix crud update boolean column
62
-
63
- ## 1.0.56 - 04.07.2024
64
-
65
- - code optimization
66
-
67
- ## 1.0.55 - 02.07.2024
68
-
69
- - callback support
70
-
71
- ## 1.0.54 - 01.07.2024
72
-
73
- - code optimization
74
-
75
- ## 1.0.53 - 28.06.2024
76
-
77
- - add migrations support
78
-
79
- ## 1.0.52 - 28.06.2024
80
-
81
- - add table get api
82
-
83
- ## 1.0.51 - 27.06.2024
84
-
85
- - add next-id api
86
-
87
- ## 1.0.50 - 27.06.2024
88
-
89
- - refactor search api
90
-
91
- ## 1.0.49 - 26.06.2024
92
-
93
- - refactor - npm settings
94
-
95
- ## 1.0.48 - 26.06.2024
96
-
97
- - search api no specified table mode support
98
-
99
- ## 1.0.47 - 25.06.2024
100
-
101
- - add extra properties support
102
-
103
- ## 1.0.46 - 24.06.2024
104
-
105
- - fix data api edit geometry
106
-
107
- ## 1.0.45 - 19.06.2024
108
-
109
- - fix data api table template order
110
-
111
- ## 1.0.44 - 18.06.2024
112
-
113
- - add extra data support (form DataTable)
114
-
115
- ## 1.0.43 - 14.06.2024
116
-
117
- - add settings api, funcs, migration
118
-
119
- ## 1.0.42 - 12.06.2024
120
-
121
- - table cardSql support
122
-
123
- ## 1.0.41 - 12.06.2024
124
-
125
- - cls to db (crm.cls)
126
-
127
- ## 1.0.40 - 12.06.2024
128
-
129
- - fix widget GET API
130
-
131
- ## 1.0.39 - 29.05.2024
132
-
133
- - add getFolder func
134
-
135
- ## 1.0.37 - 23.05.2024
136
-
137
- - add gallery widget
138
-
139
- ## 1.0.36 - 22.05.2024
140
-
141
- - fix filter api array processing
142
-
143
- ## 1.0.31 - 20.05.2024
144
-
145
- - widget db structure refactor
146
-
147
- ## 1.0.30 - 17.05.2024
148
-
149
- - code optimization
150
-
151
- ## 1.0.29 - 17.05.2024
152
-
153
- - widget api post (file)
154
-
155
- ## 1.0.28 - 14.05.2024
156
-
157
- - dblist api set
158
-
159
- ## 1.0.27 - 12.05.2024
160
-
161
- - code optimization
162
-
163
- ## 1.0.26 - 09.05.2024
164
-
165
- - fix getTableSql
166
-
167
- ## 1.0.25 - 08.05.2024
168
-
169
- - decorator to hook
170
-
171
- ## 1.0.24 - 07.05.2024
172
-
173
- - getTemplate page
174
-
175
- ## 1.0.23 - 07.05.2024
176
-
177
- - getTemplate funcs
178
- - dblist api
179
-
180
- ## 1.0.22 - 03.05.2024
181
-
182
- - getFilterSQL funcs
183
-
184
- ## 1.0.21 - 03.05.2024
185
-
186
- - fix widget db structure
187
-
188
- ## 1.0.20 - 03.05.2024
189
-
190
- - fix filter separator
191
-
192
- ## 1.0.19 - 02.05.2024
193
-
194
- - widget plugin
195
- - notification plugin
196
-
197
- ## 1.0.9 - 29.04.2024
198
-
199
- - crud token support
200
- - security - xss restriction
201
-
202
- ## 1.0.8 - 29.04.2024
203
-
204
- - filter fix
205
-
206
- ## 1.0.7 - 26.04.2024
207
-
208
- - code optimization
209
-
210
- ## 1.0.6 - 25.04.2024
211
-
212
- - code optimization
213
-
214
- ## 1.0.5 - 24.04.2024
215
-
216
- - code optimization
217
-
218
- ## 1.0.4 - 20.04.2024
219
-
220
- - data api - order
221
- - suggest api - db support
222
- - del api fix
223
-
224
- ## 1.0.3 - 17.04.2024
225
-
226
- - fix unit test
227
-
228
- ## 1.0.2 - 14.04.2024
229
-
230
- - fix redis
231
-
232
- ## 1.0.1 - 14.04.2024
233
-
234
- - fix redis
235
-
236
- ## 1.0.0 - 14.04.2024
237
-
238
- - crud
239
- - pg
240
- - redis
241
- - table
1
+ # fastify-table
2
+
3
+ ## 1.0.81 - 15.08.2024
4
+
5
+ - refactor /table API
6
+
7
+ ## 1.0.78 - 14.08.2024
8
+
9
+ - add sqlColumns to /api/data/:table/?:id
10
+
11
+ ## 1.0.77 - 13.08.2024
12
+
13
+ - add statusMonitor API
14
+
15
+ ## 1.0.75 - 12.08.2024
16
+
17
+ - something do
18
+
19
+ ## 1.0.71 - 01.08.2024
20
+
21
+ - add compile settings to form
22
+
23
+ ## 1.0.70 - 29.07.2024
24
+
25
+ - add cron funcs and API
26
+
27
+ ## 1.0.69 - 26.07.2024
28
+
29
+ - add column classifier mode for data API
30
+
31
+ ## 1.0.68 - 26.07.2024
32
+
33
+ - code optimization
34
+
35
+ ## 1.0.66 - 25.07.2024
36
+
37
+ - add notification compile template from data params support
38
+
39
+ ## 1.0.65 - 23.07.2024
40
+
41
+ - add rest API token support
42
+
43
+ ## 1.0.62 - 22.07.2024
44
+
45
+ - add email notification func and test api
46
+
47
+ ## 1.0.61 - 18.07.2024
48
+
49
+ - add custom actions for table
50
+
51
+ ## 1.0.60 - 12.07.2024
52
+
53
+ - code optimization
54
+
55
+ ## 1.0.59 - 12.07.2024
56
+
57
+ - code optimization
58
+
59
+ ## 1.0.58 - 08.07.2024
60
+
61
+ - code optimization
62
+
63
+ ## 1.0.57 - 04.07.2024
64
+
65
+ - fix crud update boolean column
66
+
67
+ ## 1.0.56 - 04.07.2024
68
+
69
+ - code optimization
70
+
71
+ ## 1.0.55 - 02.07.2024
72
+
73
+ - callback support
74
+
75
+ ## 1.0.54 - 01.07.2024
76
+
77
+ - code optimization
78
+
79
+ ## 1.0.53 - 28.06.2024
80
+
81
+ - add migrations support
82
+
83
+ ## 1.0.52 - 28.06.2024
84
+
85
+ - add table get api
86
+
87
+ ## 1.0.51 - 27.06.2024
88
+
89
+ - add next-id api
90
+
91
+ ## 1.0.50 - 27.06.2024
92
+
93
+ - refactor search api
94
+
95
+ ## 1.0.49 - 26.06.2024
96
+
97
+ - refactor - npm settings
98
+
99
+ ## 1.0.48 - 26.06.2024
100
+
101
+ - search api no specified table mode support
102
+
103
+ ## 1.0.47 - 25.06.2024
104
+
105
+ - add extra properties support
106
+
107
+ ## 1.0.46 - 24.06.2024
108
+
109
+ - fix data api edit geometry
110
+
111
+ ## 1.0.45 - 19.06.2024
112
+
113
+ - fix data api table template order
114
+
115
+ ## 1.0.44 - 18.06.2024
116
+
117
+ - add extra data support (form DataTable)
118
+
119
+ ## 1.0.43 - 14.06.2024
120
+
121
+ - add settings api, funcs, migration
122
+
123
+ ## 1.0.42 - 12.06.2024
124
+
125
+ - table cardSql support
126
+
127
+ ## 1.0.41 - 12.06.2024
128
+
129
+ - cls to db (crm.cls)
130
+
131
+ ## 1.0.40 - 12.06.2024
132
+
133
+ - fix widget GET API
134
+
135
+ ## 1.0.39 - 29.05.2024
136
+
137
+ - add getFolder func
138
+
139
+ ## 1.0.37 - 23.05.2024
140
+
141
+ - add gallery widget
142
+
143
+ ## 1.0.36 - 22.05.2024
144
+
145
+ - fix filter api array processing
146
+
147
+ ## 1.0.31 - 20.05.2024
148
+
149
+ - widget db structure refactor
150
+
151
+ ## 1.0.30 - 17.05.2024
152
+
153
+ - code optimization
154
+
155
+ ## 1.0.29 - 17.05.2024
156
+
157
+ - widget api post (file)
158
+
159
+ ## 1.0.28 - 14.05.2024
160
+
161
+ - dblist api set
162
+
163
+ ## 1.0.27 - 12.05.2024
164
+
165
+ - code optimization
166
+
167
+ ## 1.0.26 - 09.05.2024
168
+
169
+ - fix getTableSql
170
+
171
+ ## 1.0.25 - 08.05.2024
172
+
173
+ - decorator to hook
174
+
175
+ ## 1.0.24 - 07.05.2024
176
+
177
+ - getTemplate page
178
+
179
+ ## 1.0.23 - 07.05.2024
180
+
181
+ - getTemplate funcs
182
+ - dblist api
183
+
184
+ ## 1.0.22 - 03.05.2024
185
+
186
+ - getFilterSQL funcs
187
+
188
+ ## 1.0.21 - 03.05.2024
189
+
190
+ - fix widget db structure
191
+
192
+ ## 1.0.20 - 03.05.2024
193
+
194
+ - fix filter separator
195
+
196
+ ## 1.0.19 - 02.05.2024
197
+
198
+ - widget plugin
199
+ - notification plugin
200
+
201
+ ## 1.0.9 - 29.04.2024
202
+
203
+ - crud token support
204
+ - security - xss restriction
205
+
206
+ ## 1.0.8 - 29.04.2024
207
+
208
+ - filter fix
209
+
210
+ ## 1.0.7 - 26.04.2024
211
+
212
+ - code optimization
213
+
214
+ ## 1.0.6 - 25.04.2024
215
+
216
+ - code optimization
217
+
218
+ ## 1.0.5 - 24.04.2024
219
+
220
+ - code optimization
221
+
222
+ ## 1.0.4 - 20.04.2024
223
+
224
+ - data api - order
225
+ - suggest api - db support
226
+ - del api fix
227
+
228
+ ## 1.0.3 - 17.04.2024
229
+
230
+ - fix unit test
231
+
232
+ ## 1.0.2 - 14.04.2024
233
+
234
+ - fix redis
235
+
236
+ ## 1.0.1 - 14.04.2024
237
+
238
+ - fix redis
239
+
240
+ ## 1.0.0 - 14.04.2024
241
+
242
+ - crud
243
+ - pg
244
+ - redis
245
+ - 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/).
package/config.js CHANGED
@@ -1,10 +1,10 @@
1
- import fs from 'fs';
2
-
3
- const fileName = ['config.json', '/data/local/config.json'].find(el => (fs.existsSync(el) ? el : null));
4
- const config = fileName ? JSON.parse(fs.readFileSync(fileName)) : {};
5
-
6
- Object.assign(config, {
7
- allTemplates: config?.allTemplates || {},
8
- });
9
-
10
- export default config;
1
+ import fs from 'fs';
2
+
3
+ const fileName = ['config.json', '/data/local/config.json'].find(el => (fs.existsSync(el) ? el : null));
4
+ const config = fileName ? JSON.parse(fs.readFileSync(fileName)) : {};
5
+
6
+ Object.assign(config, {
7
+ allTemplates: config?.allTemplates || {},
8
+ });
9
+
10
+ export default config;