@opengis/fastify-table 1.0.82 → 1.0.84

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