@opengis/fastify-table 1.1.46 → 1.1.47

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 (126) hide show
  1. package/README.md +26 -26
  2. package/config.js +10 -10
  3. package/cron/controllers/cronApi.js +22 -22
  4. package/cron/controllers/utils/cronList.js +1 -1
  5. package/cron/index.js +10 -10
  6. package/crud/controllers/deleteCrud.js +9 -4
  7. package/crud/controllers/insert.js +9 -6
  8. package/crud/controllers/update.js +13 -10
  9. package/crud/controllers/utils/xssInjection.js +72 -72
  10. package/crud/funcs/getAccess.js +12 -10
  11. package/crud/funcs/getToken.js +27 -27
  12. package/crud/funcs/isFileExists.js +13 -13
  13. package/crud/funcs/setToken.js +53 -53
  14. package/docs/.vitepress/abbr.mjs +26 -0
  15. package/docs/.vitepress/config.mjs +127 -0
  16. package/docs/.vitepress/navigation.mjs +82 -0
  17. package/docs/.vitepress/theme/Layout.vue +17 -0
  18. package/docs/.vitepress/theme/components/NavigationLinks.vue +102 -0
  19. package/docs/.vitepress/theme/components/Panzoom.vue +169 -0
  20. package/docs/.vitepress/theme/index.mjs +15 -0
  21. package/docs/.vitepress/theme/style.scss +163 -0
  22. package/docs/abbr.json +4 -0
  23. package/docs/api/cron/cronApi.md +56 -0
  24. package/docs/api/crud/deleteCrud.md +58 -0
  25. package/docs/api/crud/insert.md +82 -0
  26. package/docs/api/crud/update.md +85 -0
  27. package/docs/api/index.md +47 -0
  28. package/docs/api/notification/testEmail.md +91 -0
  29. package/docs/api/table/card.md +73 -0
  30. package/docs/api/table/data.md +134 -0
  31. package/docs/api/table/export.md +60 -0
  32. package/docs/api/table/filter.md +104 -0
  33. package/docs/api/table/form.md +126 -0
  34. package/docs/api/table/search.md +123 -0
  35. package/docs/api/table/suggest.md +156 -0
  36. package/docs/api/table/table.md +107 -0
  37. package/docs/api/user/user.cls.id.md +77 -0
  38. package/docs/api/user/user.cls.md +49 -0
  39. package/docs/api/user/user.cls.post.md +62 -0
  40. package/docs/api/user/user.info.md +37 -0
  41. package/docs/api/utils/logger.file.md +61 -0
  42. package/docs/api/utils/next.id.md +34 -0
  43. package/docs/api/utils/properties.add.md +127 -0
  44. package/docs/api/utils/properties.get.md +73 -0
  45. package/docs/api/utils/status.monitor.md +36 -0
  46. package/docs/api/widget/widget.del.md +76 -0
  47. package/docs/api/widget/widget.get.md +233 -0
  48. package/docs/api/widget/widget.set.md +88 -0
  49. package/docs/db/admin.md +947 -0
  50. package/docs/db/crm.md +564 -0
  51. package/docs/db/index.md +9 -0
  52. package/docs/db/log.md +204 -0
  53. package/docs/hook/card/afterCard.md +20 -0
  54. package/docs/hook/card/preCard.md +25 -0
  55. package/docs/hook/data/afterData.md +26 -0
  56. package/docs/hook/data/preData.md +26 -0
  57. package/docs/hook/deleteCrud/afterDelete.md +21 -0
  58. package/docs/hook/deleteCrud/preDelete.md +26 -0
  59. package/docs/hook/form/afterForm.md +19 -0
  60. package/docs/hook/form/preForm.md +26 -0
  61. package/docs/hook/getTemplate/afterTemplate.md +24 -0
  62. package/docs/hook/getTemplate/preTemplate.md +29 -0
  63. package/docs/hook/index.md +45 -0
  64. package/docs/hook/insert/afterInsert.md +41 -0
  65. package/docs/hook/insert/preInsert.md +25 -0
  66. package/docs/hook/table/afterTable.md +20 -0
  67. package/docs/hook/table/preTable.md +25 -0
  68. package/docs/hook/update/afterUpdate.md +41 -0
  69. package/docs/hook/update/preUpdate.md +25 -0
  70. package/docs/index.md +42 -0
  71. package/docs/public/fastify-dark.svg +4 -0
  72. package/docs/public/fastify.svg +1 -0
  73. package/docs/public/logo-short-dark.svg +12 -0
  74. package/docs/public/logo-short.svg +11 -0
  75. package/docs/public/logo.svg +19 -0
  76. package/docs/readme/index.md +121 -0
  77. package/docs/templates/card.md +83 -0
  78. package/docs/templates/cls.md +29 -0
  79. package/docs/templates/filters.md +91 -0
  80. package/docs/templates/forms.md +139 -0
  81. package/docs/templates/image.png +0 -0
  82. package/docs/templates/index.md +28 -0
  83. package/docs/templates/select.md +90 -0
  84. package/docs/templates/table.md +162 -0
  85. package/docs/utils/cron/addCron.md +29 -0
  86. package/docs/utils/crud/dataInsert.md +52 -0
  87. package/docs/utils/crud/dataUpdate.md +53 -0
  88. package/docs/utils/crud/getOpt.md +34 -0
  89. package/docs/utils/crud/isFileExists.md +38 -0
  90. package/docs/utils/crud/setOpt.md +38 -0
  91. package/docs/utils/hook/addHook.md +74 -0
  92. package/docs/utils/hook/applyHook.md +64 -0
  93. package/docs/utils/index.md +48 -0
  94. package/docs/utils/notification/addNotification.md +28 -0
  95. package/docs/utils/notification/notification.md +41 -0
  96. package/docs/utils/pg/autoIndex.md +22 -0
  97. package/docs/utils/pg/getMeta.md +59 -0
  98. package/docs/utils/pg/getPG.md +34 -0
  99. package/docs/utils/pg/init.md +30 -0
  100. package/docs/utils/pg/pg.md +70 -0
  101. package/docs/utils/redis/getRedis.md +36 -0
  102. package/docs/utils/redis/rclient.md +74 -0
  103. package/docs/utils/table/getForm.md +69 -0
  104. package/docs/utils/table/getMeta.md +56 -0
  105. package/docs/utils/table/getSelect.md +39 -0
  106. package/docs/utils/table/getSelectMeta.md +47 -0
  107. package/docs/utils/table/getTable.md +78 -0
  108. package/logger/createFileStream.js +1 -1
  109. package/package.json +15 -3
  110. package/redis/funcs/getRedis.js +23 -23
  111. package/server/migrations/log.sql +80 -80
  112. package/table/controllers/data.js +31 -23
  113. package/table/controllers/table.js +26 -22
  114. package/table/index.js +3 -50
  115. package/table/schema.js +54 -0
  116. package/test/config.example +18 -18
  117. package/test/funcs/pg.test.js +34 -34
  118. package/test/funcs/redis.test.js +19 -19
  119. package/test/templates/cls/test.json +9 -9
  120. package/test/templates/form/cp_building.form.json +32 -32
  121. package/test/templates/select/account_id.json +3 -3
  122. package/test/templates/select/storage.data.json +2 -2
  123. package/test/templates/table/gis.dataset.table.json +20 -20
  124. package/util/controllers/next.id.js +4 -4
  125. package/util/controllers/properties.get.js +19 -19
  126. package/util/index.js +23 -23
@@ -0,0 +1,233 @@
1
+ # `GET` WIDGET
2
+
3
+ ## Опис
4
+
5
+ Отримання даних віджету по id
6
+
7
+ ```example
8
+ /api/widget/comment/1
9
+ ```
10
+
11
+ ## Параметри
12
+
13
+ ```scheme-api
14
+ /api/widget/:type/:id
15
+ ```
16
+
17
+ ::: tabs
18
+
19
+ ===params
20
+
21
+ | Назва | Тип | Опис |
22
+ | ----- | ------ | ------------- |
23
+ | type | String | Віджет |
24
+ | id | String | ID об'єкту |
25
+
26
+ :::
27
+
28
+ ## Віджети
29
+
30
+ - comment
31
+ - history
32
+ - checklist
33
+ - file
34
+ - gallery
35
+
36
+ ## Відповідь
37
+
38
+ ::: details comment
39
+
40
+ ```json
41
+ {
42
+ "time": {
43
+ "data": 13,
44
+ "format": 5
45
+ },
46
+ "rows": [
47
+ {
48
+ "body": "body",
49
+ "cdate": "2024-05-03T09:23:01.336Z",
50
+ "comment_id": "3359796548786455946",
51
+ "object_id": "1",
52
+ "uid": "0",
53
+ "username": " ",
54
+ "avatar": null
55
+ }
56
+ ],
57
+ "user": {
58
+ "uid": "1"
59
+ },
60
+ "data": {
61
+ "author": "",
62
+ "cdate": "2022-08-03T04:41:00.000Z",
63
+ "edate": "2023-05-26T13:57:06.235Z"
64
+ },
65
+ "objectid": "1"
66
+ }
67
+ ```
68
+
69
+ :::
70
+
71
+ ::: details history
72
+
73
+ ```json
74
+ {
75
+ "time": {
76
+ "data": 2,
77
+ "format": 2
78
+ },
79
+ "rows": [
80
+ {
81
+ "object_id": "1",
82
+ "table_name": "gis.dataset",
83
+ "change_key": "1",
84
+ "change_date": null,
85
+ "json_old": null,
86
+ "json_new": null,
87
+ "date_old": null,
88
+ "date_new": null,
89
+ "number_old": null,
90
+ "number_new": null,
91
+ "bool_old": null,
92
+ "bool_new": null,
93
+ "text_old": null,
94
+ "text_new": null,
95
+ "uid": null,
96
+ "cdate": "2024-05-03T08:27:49.476Z"
97
+ }
98
+ ],
99
+ "user": {
100
+ "uid": "1"
101
+ },
102
+ "data": {
103
+ "author": "",
104
+ "cdate": "2022-08-03T04:41:00.000Z",
105
+ "edate": "2023-05-26T13:57:06.235Z"
106
+ },
107
+ "objectid": "1"
108
+ }
109
+ ```
110
+
111
+ :::
112
+
113
+ ::: details checklist
114
+
115
+ ```json
116
+ {
117
+ "time": {
118
+ "data": 3,
119
+ "format": 2
120
+ },
121
+ "rows": [
122
+ {
123
+ "checklist_id": "3359774917577934117",
124
+ "title": null,
125
+ "is_done": false,
126
+ "done_date": null,
127
+ "uid": "0",
128
+ "cdate": "2024-05-03T08:40:02.695Z",
129
+ "username": " ",
130
+ "avatar": null
131
+ }
132
+ ],
133
+ "user": {
134
+ "uid": "1"
135
+ },
136
+ "data": {
137
+ "author": "",
138
+ "cdate": "2022-08-03T04:41:00.000Z",
139
+ "edate": "2023-05-26T13:57:06.235Z"
140
+ },
141
+ "objectid": "1"
142
+ }
143
+ ```
144
+
145
+ :::
146
+
147
+ ::: details file
148
+
149
+ ```json
150
+ {
151
+ "time": {
152
+ "data": 6,
153
+ "format": 10
154
+ },
155
+ "rows": [
156
+ {
157
+ "file_id": "3359776025234900264",
158
+ "file_path": "/files/uploads/2024-05-01/52a452addac501a8ffe7dc301.png",
159
+ "uploaded_name": null,
160
+ "ext": "png",
161
+ "size": "9923",
162
+ "uid": null,
163
+ "cdate": "2024-05-01T08:11:55.734Z",
164
+ "file_type": null,
165
+ "ismain": null,
166
+ "username": " ",
167
+ "isverified": null,
168
+ "avatar": null,
169
+ "author": null,
170
+ "file_status": "1"
171
+ }
172
+ ],
173
+ "user": {
174
+ "uid": "1"
175
+ },
176
+ "data": {
177
+ "author": "",
178
+ "cdate": "2022-08-03T04:41:00.000Z",
179
+ "edate": "2023-05-26T13:57:06.235Z"
180
+ },
181
+ "objectid": "1"
182
+ }
183
+ ```
184
+
185
+ :::
186
+
187
+ ::: details gallery
188
+
189
+ ```json
190
+ {
191
+ "time": {
192
+ "data": 6,
193
+ "format": 10
194
+ },
195
+ "rows": [
196
+ {
197
+ "file_id": "3359776025234900264",
198
+ "file_path": "/files/uploads/2024-05-01/52a452addac501a8ffe7dc301.png",
199
+ "uploaded_name": null,
200
+ "ext": "png",
201
+ "size": "9923",
202
+ "uid": null,
203
+ "cdate": "2024-05-01T08:11:55.734Z",
204
+ "file_type": null,
205
+ "ismain": null,
206
+ "username": " ",
207
+ "isverified": null,
208
+ "avatar": null,
209
+ "author": null,
210
+ "file_status": "1"
211
+ }
212
+ ],
213
+ "user": {
214
+ "uid": "1"
215
+ },
216
+ "data": {
217
+ "author": "",
218
+ "cdate": "2022-08-03T04:41:00.000Z",
219
+ "edate": "2023-05-26T13:57:06.235Z"
220
+ },
221
+ "objectid": "1"
222
+ }
223
+ ```
224
+
225
+ :::
226
+
227
+ ## Статус коди
228
+
229
+ | Ключ | Опис |
230
+ | ---------------------------------------------------------- | ----------------------------------------- |
231
+ | <Badge type="code_2xx" text="200" /> Success | Успішний запит |
232
+ | <Badge type="code_4xx" text="404" /> Not Found | Інформації не знайдено |
233
+ | <Badge type="code_5xx" text="500" /> Internal Server Error | Помилка на стороні сервера |
@@ -0,0 +1,88 @@
1
+ # `POST` WIDGET
2
+
3
+ ## Опис
4
+
5
+ Внесення / оновлення даних віджету
6
+
7
+ За наявності параметру `id` виконується оновлення існуючого запису в БД
8
+
9
+ Структура body має відповідати структурі таблиці, що використовується у віджеті
10
+
11
+ Віджет gallery використовує ту ж таблицю, що й віджет file, проте наявні обмеження по розширенню завантажуваних файлів
12
+
13
+ Перелік підтримуваних розширень файлі віджету gallery:
14
+
15
+ - png
16
+ - svg
17
+ - jpg
18
+ - jpeg
19
+ - gif
20
+ - mp4
21
+ - mov
22
+ - avi
23
+
24
+ ```example
25
+ /api/widget/comment/1
26
+ ```
27
+
28
+ ## Параметри
29
+
30
+ ```scheme-api
31
+ /api/widget/:type/:id?
32
+ ```
33
+
34
+ ::: tabs
35
+
36
+ ===params
37
+
38
+ | Назва | Тип | Опис |
39
+ | ----- | ------ | ------------- |
40
+ | type | String | Віджет |
41
+ | id | String | ID об'єкту |
42
+
43
+ :::
44
+
45
+ ## Віджети
46
+
47
+ - comment
48
+ - history
49
+ - checklist
50
+ - file
51
+ - gallery
52
+
53
+ ## Відповідь
54
+
55
+ ::: tabs
56
+
57
+ ==200
58
+ ::: details Приклад відповіді
59
+
60
+ ```json
61
+ {
62
+ "rowCount": 1,
63
+ "data": "ok",
64
+ "command": "INSERT",
65
+ "id": "3374171120805611106",
66
+ "entity_id": "3064823525807228447"
67
+ }
68
+ ```
69
+
70
+ ==403
71
+
72
+ ```text
73
+ access restricted
74
+ ```
75
+
76
+ :::
77
+
78
+ ## Статус коди
79
+
80
+ | Ключ | Опис |
81
+ | ---------------------------------------------------------- | ----------------------------------------- |
82
+ | <Badge type="code_2xx" text="200" /> Success | Успішний запит |
83
+ | <Badge type="code_4xx" text="404" /> Not Found | Інформації не знайдено |
84
+ | <Badge type="code_5xx" text="500" /> Internal Server Error | Помилка на стороні сервера |
85
+
86
+ ## Посилання
87
+
88
+ - [Опис таблиць віджетів](db.md)