@opengis/fastify-table 1.0.92 → 1.0.94

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 (54) hide show
  1. package/Changelog.md +285 -277
  2. package/crud/controllers/deleteCrud.js +22 -22
  3. package/crud/controllers/insert.js +58 -58
  4. package/crud/controllers/update.js +61 -61
  5. package/crud/funcs/dataDelete.js +19 -19
  6. package/crud/funcs/dataInsert.js +30 -30
  7. package/crud/funcs/getAccess.js +53 -53
  8. package/crud/funcs/getOpt.js +10 -10
  9. package/crud/funcs/setOpt.js +16 -16
  10. package/crud/funcs/utils/logChanges.js +71 -71
  11. package/crud/index.js +36 -36
  12. package/helper.js +28 -28
  13. package/index.js +97 -97
  14. package/notification/controllers/userNotifications.js +19 -19
  15. package/notification/funcs/addNotification.js +8 -8
  16. package/package.json +26 -26
  17. package/pg/funcs/getMeta.js +27 -27
  18. package/pg/pgClients.js +20 -20
  19. package/policy/funcs/checkPolicy.js +83 -83
  20. package/policy/funcs/sqlInjection.js +33 -33
  21. package/policy/index.js +14 -14
  22. package/redis/client.js +8 -8
  23. package/redis/funcs/redisClients.js +2 -2
  24. package/redis/index.js +19 -19
  25. package/server/migrations/0.sql +78 -78
  26. package/server/templates/form/test.dataset.form.json +411 -411
  27. package/server/templates/table/test.dataset.table.json +28 -28
  28. package/server/templates/table/test.gis.map.table.json +44 -44
  29. package/table/controllers/data.js +103 -103
  30. package/table/controllers/suggest.js +79 -79
  31. package/table/controllers/table.js +52 -52
  32. package/table/controllers/utils/getSelectMeta.js +66 -66
  33. package/table/controllers/utils/getTemplate.js +28 -28
  34. package/table/controllers/utils/gisIRColumn.js +68 -68
  35. package/table/funcs/getFilterSQL/index.js +79 -75
  36. package/table/funcs/getFilterSQL/util/formatValue.js +142 -142
  37. package/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
  38. package/table/funcs/getFilterSQL/util/getFilterQuery.js +73 -73
  39. package/table/funcs/getFilterSQL/util/getOptimizedQuery.js +12 -12
  40. package/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
  41. package/table/funcs/metaFormat/getSelectVal.js +20 -20
  42. package/table/funcs/metaFormat/index.js +28 -28
  43. package/test/api/crud.test.js +88 -88
  44. package/test/api/table.test.js +89 -89
  45. package/test/api/widget.test.js +117 -117
  46. package/test/funcs/crud.test.js +122 -122
  47. package/util/controllers/properties.add.js +57 -57
  48. package/util/controllers/status.monitor.js +8 -8
  49. package/widget/controllers/utils/historyFormat.js +76 -76
  50. package/widget/controllers/utils/obj2db.js +13 -13
  51. package/widget/controllers/widget.del.js +44 -44
  52. package/widget/controllers/widget.get.js +98 -98
  53. package/widget/controllers/widget.set.js +76 -76
  54. package/widget/index.js +40 -40
package/Changelog.md CHANGED
@@ -1,277 +1,285 @@
1
- # fastify-table
2
-
3
- ## 1.0.92 - 03.08.2024
4
-
5
- - fix getTemplate
6
-
7
- ## 1.0.91 - 30.08.2024
8
-
9
- - add CRUD and Auth logs
10
-
11
- ## 1.0.90 - 27.08.2024
12
-
13
- - logger file API to core
14
-
15
- ## 1.0.89 - 26.08.2024
16
-
17
- - data API meta bbox polyline support
18
-
19
- ## 1.0.87 - 26.08.2024
20
-
21
- - change of null handling method of update crud API
22
-
23
- ## 1.0.86 - 23.08.2024
24
-
25
- - data API meta cls support
26
-
27
- ## 1.0.84 - 22.08.2024
28
-
29
- - suggest table:column support
30
-
31
- ## 1.0.83 - 20.08.2024
32
-
33
- - code optimization
34
-
35
- ## 1.0.81 - 15.08.2024
36
-
37
- - refactor /table API
38
-
39
- ## 1.0.78 - 14.08.2024
40
-
41
- - add sqlColumns to /api/data/:table/?:id
42
-
43
- ## 1.0.77 - 13.08.2024
44
-
45
- - add statusMonitor API
46
-
47
- ## 1.0.75 - 12.08.2024
48
-
49
- - something do
50
-
51
- ## 1.0.71 - 01.08.2024
52
-
53
- - add compile settings to form
54
-
55
- ## 1.0.70 - 29.07.2024
56
-
57
- - add cron funcs and API
58
-
59
- ## 1.0.69 - 26.07.2024
60
-
61
- - add column classifier mode for data API
62
-
63
- ## 1.0.68 - 26.07.2024
64
-
65
- - code optimization
66
-
67
- ## 1.0.66 - 25.07.2024
68
-
69
- - add notification compile template from data params support
70
-
71
- ## 1.0.65 - 23.07.2024
72
-
73
- - add rest API token support
74
-
75
- ## 1.0.62 - 22.07.2024
76
-
77
- - add email notification func and test api
78
-
79
- ## 1.0.61 - 18.07.2024
80
-
81
- - add custom actions for table
82
-
83
- ## 1.0.60 - 12.07.2024
84
-
85
- - code optimization
86
-
87
- ## 1.0.59 - 12.07.2024
88
-
89
- - code optimization
90
-
91
- ## 1.0.58 - 08.07.2024
92
-
93
- - code optimization
94
-
95
- ## 1.0.57 - 04.07.2024
96
-
97
- - fix crud update boolean column
98
-
99
- ## 1.0.56 - 04.07.2024
100
-
101
- - code optimization
102
-
103
- ## 1.0.55 - 02.07.2024
104
-
105
- - callback support
106
-
107
- ## 1.0.54 - 01.07.2024
108
-
109
- - code optimization
110
-
111
- ## 1.0.53 - 28.06.2024
112
-
113
- - add migrations support
114
-
115
- ## 1.0.52 - 28.06.2024
116
-
117
- - add table get api
118
-
119
- ## 1.0.51 - 27.06.2024
120
-
121
- - add next-id api
122
-
123
- ## 1.0.50 - 27.06.2024
124
-
125
- - refactor search api
126
-
127
- ## 1.0.49 - 26.06.2024
128
-
129
- - refactor - npm settings
130
-
131
- ## 1.0.48 - 26.06.2024
132
-
133
- - search api no specified table mode support
134
-
135
- ## 1.0.47 - 25.06.2024
136
-
137
- - add extra properties support
138
-
139
- ## 1.0.46 - 24.06.2024
140
-
141
- - fix data api edit geometry
142
-
143
- ## 1.0.45 - 19.06.2024
144
-
145
- - fix data api table template order
146
-
147
- ## 1.0.44 - 18.06.2024
148
-
149
- - add extra data support (form DataTable)
150
-
151
- ## 1.0.43 - 14.06.2024
152
-
153
- - add settings api, funcs, migration
154
-
155
- ## 1.0.42 - 12.06.2024
156
-
157
- - table cardSql support
158
-
159
- ## 1.0.41 - 12.06.2024
160
-
161
- - cls to db (crm.cls)
162
-
163
- ## 1.0.40 - 12.06.2024
164
-
165
- - fix widget GET API
166
-
167
- ## 1.0.39 - 29.05.2024
168
-
169
- - add getFolder func
170
-
171
- ## 1.0.37 - 23.05.2024
172
-
173
- - add gallery widget
174
-
175
- ## 1.0.36 - 22.05.2024
176
-
177
- - fix filter api array processing
178
-
179
- ## 1.0.31 - 20.05.2024
180
-
181
- - widget db structure refactor
182
-
183
- ## 1.0.30 - 17.05.2024
184
-
185
- - code optimization
186
-
187
- ## 1.0.29 - 17.05.2024
188
-
189
- - widget api post (file)
190
-
191
- ## 1.0.28 - 14.05.2024
192
-
193
- - dblist api set
194
-
195
- ## 1.0.27 - 12.05.2024
196
-
197
- - code optimization
198
-
199
- ## 1.0.26 - 09.05.2024
200
-
201
- - fix getTableSql
202
-
203
- ## 1.0.25 - 08.05.2024
204
-
205
- - decorator to hook
206
-
207
- ## 1.0.24 - 07.05.2024
208
-
209
- - getTemplate page
210
-
211
- ## 1.0.23 - 07.05.2024
212
-
213
- - getTemplate funcs
214
- - dblist api
215
-
216
- ## 1.0.22 - 03.05.2024
217
-
218
- - getFilterSQL funcs
219
-
220
- ## 1.0.21 - 03.05.2024
221
-
222
- - fix widget db structure
223
-
224
- ## 1.0.20 - 03.05.2024
225
-
226
- - fix filter separator
227
-
228
- ## 1.0.19 - 02.05.2024
229
-
230
- - widget plugin
231
- - notification plugin
232
-
233
- ## 1.0.9 - 29.04.2024
234
-
235
- - crud token support
236
- - security - xss restriction
237
-
238
- ## 1.0.8 - 29.04.2024
239
-
240
- - filter fix
241
-
242
- ## 1.0.7 - 26.04.2024
243
-
244
- - code optimization
245
-
246
- ## 1.0.6 - 25.04.2024
247
-
248
- - code optimization
249
-
250
- ## 1.0.5 - 24.04.2024
251
-
252
- - code optimization
253
-
254
- ## 1.0.4 - 20.04.2024
255
-
256
- - data api - order
257
- - suggest api - db support
258
- - del api fix
259
-
260
- ## 1.0.3 - 17.04.2024
261
-
262
- - fix unit test
263
-
264
- ## 1.0.2 - 14.04.2024
265
-
266
- - fix redis
267
-
268
- ## 1.0.1 - 14.04.2024
269
-
270
- - fix redis
271
-
272
- ## 1.0.0 - 14.04.2024
273
-
274
- - crud
275
- - pg
276
- - redis
277
- - table
1
+ # fastify-table
2
+
3
+ ## 1.0.94 - 11.09.2024
4
+
5
+ - fix getMeta (public schema)
6
+
7
+ ## 1.0.93 - 05.09.2024
8
+
9
+ - fix data API with sql columns filter
10
+
11
+ ## 1.0.92 - 03.09.2024
12
+
13
+ - fix getTemplate
14
+
15
+ ## 1.0.91 - 30.08.2024
16
+
17
+ - add CRUD and Auth logs
18
+
19
+ ## 1.0.90 - 27.08.2024
20
+
21
+ - logger file API to core
22
+
23
+ ## 1.0.89 - 26.08.2024
24
+
25
+ - data API meta bbox polyline support
26
+
27
+ ## 1.0.87 - 26.08.2024
28
+
29
+ - change of null handling method of update crud API
30
+
31
+ ## 1.0.86 - 23.08.2024
32
+
33
+ - data API meta cls support
34
+
35
+ ## 1.0.84 - 22.08.2024
36
+
37
+ - suggest table:column support
38
+
39
+ ## 1.0.83 - 20.08.2024
40
+
41
+ - code optimization
42
+
43
+ ## 1.0.81 - 15.08.2024
44
+
45
+ - refactor /table API
46
+
47
+ ## 1.0.78 - 14.08.2024
48
+
49
+ - add sqlColumns to /api/data/:table/?:id
50
+
51
+ ## 1.0.77 - 13.08.2024
52
+
53
+ - add statusMonitor API
54
+
55
+ ## 1.0.75 - 12.08.2024
56
+
57
+ - something do
58
+
59
+ ## 1.0.71 - 01.08.2024
60
+
61
+ - add compile settings to form
62
+
63
+ ## 1.0.70 - 29.07.2024
64
+
65
+ - add cron funcs and API
66
+
67
+ ## 1.0.69 - 26.07.2024
68
+
69
+ - add column classifier mode for data API
70
+
71
+ ## 1.0.68 - 26.07.2024
72
+
73
+ - code optimization
74
+
75
+ ## 1.0.66 - 25.07.2024
76
+
77
+ - add notification compile template from data params support
78
+
79
+ ## 1.0.65 - 23.07.2024
80
+
81
+ - add rest API token support
82
+
83
+ ## 1.0.62 - 22.07.2024
84
+
85
+ - add email notification func and test api
86
+
87
+ ## 1.0.61 - 18.07.2024
88
+
89
+ - add custom actions for table
90
+
91
+ ## 1.0.60 - 12.07.2024
92
+
93
+ - code optimization
94
+
95
+ ## 1.0.59 - 12.07.2024
96
+
97
+ - code optimization
98
+
99
+ ## 1.0.58 - 08.07.2024
100
+
101
+ - code optimization
102
+
103
+ ## 1.0.57 - 04.07.2024
104
+
105
+ - fix crud update boolean column
106
+
107
+ ## 1.0.56 - 04.07.2024
108
+
109
+ - code optimization
110
+
111
+ ## 1.0.55 - 02.07.2024
112
+
113
+ - callback support
114
+
115
+ ## 1.0.54 - 01.07.2024
116
+
117
+ - code optimization
118
+
119
+ ## 1.0.53 - 28.06.2024
120
+
121
+ - add migrations support
122
+
123
+ ## 1.0.52 - 28.06.2024
124
+
125
+ - add table get api
126
+
127
+ ## 1.0.51 - 27.06.2024
128
+
129
+ - add next-id api
130
+
131
+ ## 1.0.50 - 27.06.2024
132
+
133
+ - refactor search api
134
+
135
+ ## 1.0.49 - 26.06.2024
136
+
137
+ - refactor - npm settings
138
+
139
+ ## 1.0.48 - 26.06.2024
140
+
141
+ - search api no specified table mode support
142
+
143
+ ## 1.0.47 - 25.06.2024
144
+
145
+ - add extra properties support
146
+
147
+ ## 1.0.46 - 24.06.2024
148
+
149
+ - fix data api edit geometry
150
+
151
+ ## 1.0.45 - 19.06.2024
152
+
153
+ - fix data api table template order
154
+
155
+ ## 1.0.44 - 18.06.2024
156
+
157
+ - add extra data support (form DataTable)
158
+
159
+ ## 1.0.43 - 14.06.2024
160
+
161
+ - add settings api, funcs, migration
162
+
163
+ ## 1.0.42 - 12.06.2024
164
+
165
+ - table cardSql support
166
+
167
+ ## 1.0.41 - 12.06.2024
168
+
169
+ - cls to db (crm.cls)
170
+
171
+ ## 1.0.40 - 12.06.2024
172
+
173
+ - fix widget GET API
174
+
175
+ ## 1.0.39 - 29.05.2024
176
+
177
+ - add getFolder func
178
+
179
+ ## 1.0.37 - 23.05.2024
180
+
181
+ - add gallery widget
182
+
183
+ ## 1.0.36 - 22.05.2024
184
+
185
+ - fix filter api array processing
186
+
187
+ ## 1.0.31 - 20.05.2024
188
+
189
+ - widget db structure refactor
190
+
191
+ ## 1.0.30 - 17.05.2024
192
+
193
+ - code optimization
194
+
195
+ ## 1.0.29 - 17.05.2024
196
+
197
+ - widget api post (file)
198
+
199
+ ## 1.0.28 - 14.05.2024
200
+
201
+ - dblist api set
202
+
203
+ ## 1.0.27 - 12.05.2024
204
+
205
+ - code optimization
206
+
207
+ ## 1.0.26 - 09.05.2024
208
+
209
+ - fix getTableSql
210
+
211
+ ## 1.0.25 - 08.05.2024
212
+
213
+ - decorator to hook
214
+
215
+ ## 1.0.24 - 07.05.2024
216
+
217
+ - getTemplate page
218
+
219
+ ## 1.0.23 - 07.05.2024
220
+
221
+ - getTemplate funcs
222
+ - dblist api
223
+
224
+ ## 1.0.22 - 03.05.2024
225
+
226
+ - getFilterSQL funcs
227
+
228
+ ## 1.0.21 - 03.05.2024
229
+
230
+ - fix widget db structure
231
+
232
+ ## 1.0.20 - 03.05.2024
233
+
234
+ - fix filter separator
235
+
236
+ ## 1.0.19 - 02.05.2024
237
+
238
+ - widget plugin
239
+ - notification plugin
240
+
241
+ ## 1.0.9 - 29.04.2024
242
+
243
+ - crud token support
244
+ - security - xss restriction
245
+
246
+ ## 1.0.8 - 29.04.2024
247
+
248
+ - filter fix
249
+
250
+ ## 1.0.7 - 26.04.2024
251
+
252
+ - code optimization
253
+
254
+ ## 1.0.6 - 25.04.2024
255
+
256
+ - code optimization
257
+
258
+ ## 1.0.5 - 24.04.2024
259
+
260
+ - code optimization
261
+
262
+ ## 1.0.4 - 20.04.2024
263
+
264
+ - data api - order
265
+ - suggest api - db support
266
+ - del api fix
267
+
268
+ ## 1.0.3 - 17.04.2024
269
+
270
+ - fix unit test
271
+
272
+ ## 1.0.2 - 14.04.2024
273
+
274
+ - fix redis
275
+
276
+ ## 1.0.1 - 14.04.2024
277
+
278
+ - fix redis
279
+
280
+ ## 1.0.0 - 14.04.2024
281
+
282
+ - crud
283
+ - pg
284
+ - redis
285
+ - table
@@ -1,22 +1,22 @@
1
- import dataDelete from '../funcs/dataDelete.js';
2
- import getTemplate from '../../table/controllers/utils/getTemplate.js';
3
- import getAccess from '../funcs/getAccess.js';
4
-
5
- export default async function deleteCrud(req) {
6
- const { actions = [], scope, my } = await getAccess(req, req.params.table, req.params.id) || {};
7
- if (!actions.includes('del') || (scope === 'my' && !my)) {
8
- return { message: 'access restricted', status: 403 };
9
- }
10
- const loadTemplate = await getTemplate('table', req.opt?.table || req.params.table);
11
- const { table } = loadTemplate || req.opt || req.params || {};
12
- const { id } = req.opt || req.params || {};
13
-
14
- if (!table) return { status: 404, message: 'table is required' };
15
-
16
- const { user = {} } = req;
17
- const data = await dataDelete({
18
- table, id, uid: user?.uid,
19
- });
20
-
21
- return { rowCount: data.rowCount, msg: !data.rowCount ? data : null };
22
- }
1
+ import dataDelete from '../funcs/dataDelete.js';
2
+ import getTemplate from '../../table/controllers/utils/getTemplate.js';
3
+ import getAccess from '../funcs/getAccess.js';
4
+
5
+ export default async function deleteCrud(req) {
6
+ const { actions = [], scope, my } = await getAccess(req, req.params.table, req.params.id) || {};
7
+ if (!actions.includes('del') || (scope === 'my' && !my)) {
8
+ return { message: 'access restricted', status: 403 };
9
+ }
10
+ const loadTemplate = await getTemplate('table', req.opt?.table || req.params.table);
11
+ const { table } = loadTemplate || req.opt || req.params || {};
12
+ const { id } = req.opt || req.params || {};
13
+
14
+ if (!table) return { status: 404, message: 'table is required' };
15
+
16
+ const { user = {} } = req;
17
+ const data = await dataDelete({
18
+ table, id, uid: user?.uid,
19
+ });
20
+
21
+ return { rowCount: data.rowCount, msg: !data.rowCount ? data : null };
22
+ }