@opengis/gis 0.2.175 → 0.2.176

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 (158) hide show
  1. package/README.md +181 -181
  2. package/dist/{CardIcon-Cg8bUM4G.js → CardIcon-c1Q2M3wQ.js} +1 -1
  3. package/dist/{EntityTablePage-DHQGlLRk.js → EntityTablePage-B5gpkH4S.js} +2 -2
  4. package/dist/{ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-BIL1ocLY.js → ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-DnGSvmMU.js} +1 -1
  5. package/dist/{HeaderActions.vue_vue_type_script_setup_true_lang-Buff9gTO.js → HeaderActions.vue_vue_type_script_setup_true_lang-C2B61JP6.js} +1 -1
  6. package/dist/{MapSettings-De-z7r5t.js → MapSettings-6-Xru5Q8.js} +2 -2
  7. package/dist/{RastersTablePage-Cdgkri9K.js → RastersTablePage-CXNOcTy-.js} +2 -2
  8. package/dist/{cartocss-BT50SVhy.js → cartocss-BFVqWvfP.js} +6 -6
  9. package/dist/{import-utils-CMWiuRPp.js → import-utils-uxk4LdUJ.js} +1 -1
  10. package/dist/{index-CHFLgCGW.js → index-CahlV-Xs.js} +39 -39
  11. package/dist/index.css +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/index.umd.cjs +19 -19
  14. package/dist/{raster-dSEb1SIG.js → raster-CEi56f0P.js} +3 -3
  15. package/dist/{register-D7Puupgo.js → register-NFAGBNa3.js} +3 -3
  16. package/dist/{service-Cz6T0O3Z.js → service-BYspag8U.js} +829 -832
  17. package/dist/{vs-datatable-DqVncrSg.js → vs-datatable-CHcBr6zy.js} +2 -2
  18. package/module/gis/cls/service_type.json +42 -42
  19. package/module/gis/form/gis.registers.form.json +127 -127
  20. package/module/test/map/addr.json +302 -302
  21. package/module/test/map/addr1.yml +23 -23
  22. package/module/test/select/address.str_id.sql +3 -3
  23. package/package.json +77 -77
  24. package/plugin.js +64 -64
  25. package/server/migrations/array_intersect.sql +13 -13
  26. package/server/migrations/cartocss.sql +27 -27
  27. package/server/migrations/group_list.sql +74 -74
  28. package/server/migrations/maps.sql +30 -30
  29. package/server/migrations/metadata.sql +415 -415
  30. package/server/migrations/ogc.sql +106 -106
  31. package/server/migrations/rasters.sql +265 -265
  32. package/server/migrations/services.sql +247 -247
  33. package/server/migrations/services_users_rel.sql +22 -22
  34. package/server/migrations/widgets.sql +20 -20
  35. package/server/plugins/crons.js +21 -21
  36. package/server/plugins/mapnik/funcs/checkRasterFile.js +107 -107
  37. package/server/plugins/mapnik/funcs/mapnik.js +151 -151
  38. package/server/plugins/mapnik/funcs/rootFolder.mjs +8 -8
  39. package/server/plugins/mapnik/map.proto +437 -437
  40. package/server/plugins/vite.js +74 -74
  41. package/server/routes/cartocss/cartocss.route.js +31 -31
  42. package/server/routes/cartocss/cartocss.route.test.js +78 -78
  43. package/server/routes/cartocss/cartocss.schema.js +73 -73
  44. package/server/routes/cartocss/functions/add.cartocss.js +39 -39
  45. package/server/routes/cartocss/functions/get.cartocss.js +57 -57
  46. package/server/routes/gis/functions/checkXML.js +107 -107
  47. package/server/routes/gis/functions/dashboard.js +24 -24
  48. package/server/routes/gis/gis.route.js +26 -26
  49. package/server/routes/gis/gis.route.test.js +33 -33
  50. package/server/routes/map/functions/clearTiles.js +35 -35
  51. package/server/routes/map/functions/geojson.js +187 -187
  52. package/server/routes/map/functions/gis.convert.js +65 -65
  53. package/server/routes/map/functions/gis.icon.js +220 -220
  54. package/server/routes/map/functions/jsonData.js +206 -206
  55. package/server/routes/map/functions/layerList.js +102 -102
  56. package/server/routes/map/functions/map.js +122 -122
  57. package/server/routes/map/functions/mapCatalog.js +72 -72
  58. package/server/routes/map/functions/mapCatalogAttribute.js +53 -53
  59. package/server/routes/map/functions/mapFeatures.js +133 -133
  60. package/server/routes/map/functions/mapFormat.js +232 -231
  61. package/server/routes/map/functions/mapTiles.js +162 -162
  62. package/server/routes/map/functions/maps.js +15 -15
  63. package/server/routes/map/functions/marker_icon.js +43 -43
  64. package/server/routes/map/functions/parseGeoFile.js +85 -85
  65. package/server/routes/map/functions/pointHeight.js +51 -51
  66. package/server/routes/map/functions/vtile.js +174 -174
  67. package/server/routes/map/functions/vtile1.js +185 -185
  68. package/server/routes/map/map.route.js +280 -280
  69. package/server/routes/map/map.route.test.js +503 -503
  70. package/server/routes/map/map.schema.js +356 -356
  71. package/server/routes/map/pin/circle1.svg +76 -76
  72. package/server/routes/map/pin/circle2.svg +18 -18
  73. package/server/routes/map/pin/none.svg +12 -12
  74. package/server/routes/map/pin/pin.svg +14 -14
  75. package/server/routes/map/pin/pin1.svg +16 -16
  76. package/server/routes/map/pin/pin2.svg +7 -7
  77. package/server/routes/map/pin/pin3.svg +34 -34
  78. package/server/routes/map/pin/pin4.svg +14 -14
  79. package/server/routes/map/pin/pin5.svg +7 -7
  80. package/server/routes/map/pin/pin6.svg +12 -12
  81. package/server/routes/map/pin/pin7.svg +12 -12
  82. package/server/routes/mapnik/functions/cartoBounds.js +32 -32
  83. package/server/routes/mapnik/functions/clearTiles.js +103 -103
  84. package/server/routes/mapnik/functions/convertBoundToTile.js +27 -27
  85. package/server/routes/mapnik/functions/createXml.js +76 -76
  86. package/server/routes/mapnik/functions/createXmlMulti.js +72 -72
  87. package/server/routes/mapnik/functions/fileSearch.js +35 -35
  88. package/server/routes/mapnik/functions/fileStat.js +28 -28
  89. package/server/routes/mapnik/functions/pretile.js +138 -138
  90. package/server/routes/mapnik/functions/rasterInfo.js +66 -66
  91. package/server/routes/mapnik/functions/readDir.js +22 -22
  92. package/server/routes/mapnik/functions/rtile.js +164 -164
  93. package/server/routes/mapnik/functions/uploadRaster.js +152 -152
  94. package/server/routes/mapnik/functions/uploadXML.js +140 -140
  95. package/server/routes/mapnik/mapnik.route.js +102 -102
  96. package/server/routes/mapnik/mapnik.route.test.js +370 -370
  97. package/server/routes/mapnik/mapnik.schema.mjs +195 -195
  98. package/server/routes/mapnik.prefixless/functions/mapnikLogger.js +31 -31
  99. package/server/routes/mapnik.prefixless/functions/mapnikStat.js +21 -21
  100. package/server/routes/mapnik.prefixless/mapnik.prefixless.route.js +20 -20
  101. package/server/routes/mapnik.prefixless/mapnik.prefixless.route.test.js +91 -91
  102. package/server/routes/mapnik.prefixless/mapnik.prefixless.schema.mjs +27 -27
  103. package/server/routes/maps/functions/add.map.js +42 -42
  104. package/server/routes/maps/functions/del.map.js +17 -17
  105. package/server/routes/maps/functions/get.map.js +119 -119
  106. package/server/routes/maps/maps.route.js +58 -58
  107. package/server/routes/maps/maps.route.test.js +231 -231
  108. package/server/routes/maps/maps.schema.js +9 -9
  109. package/server/routes/metadata/functions/editMetadata.js +35 -35
  110. package/server/routes/metadata/functions/metadataXML.js +19 -19
  111. package/server/routes/metadata/metadata.route.js +26 -26
  112. package/server/routes/metadata/metadata.route.test.js +46 -46
  113. package/server/routes/metadata/metadata.schema.js +53 -53
  114. package/server/routes/ogc/functions/map.info.point.js +117 -117
  115. package/server/routes/ogc/ogc.route.js +21 -21
  116. package/server/routes/ogc/ogc.route.test.js +53 -53
  117. package/server/routes/ogc/ogc.schema.js +16 -16
  118. package/server/routes/permissions/functions/catalog.permissions.edit.js +20 -20
  119. package/server/routes/permissions/functions/catalog.permissions.js +12 -12
  120. package/server/routes/permissions/functions/get.permissions.js +59 -59
  121. package/server/routes/permissions/functions/gis.catalog.js +80 -80
  122. package/server/routes/permissions/permissions.route.js +35 -35
  123. package/server/routes/permissions/permissions.route.test.js +35 -35
  124. package/server/routes/permissions/permissions.schema.js +43 -43
  125. package/server/routes/registers/functions/add.registry.js +37 -37
  126. package/server/routes/registers/functions/classifiers.js +100 -100
  127. package/server/routes/registers/functions/columns.js +3 -3
  128. package/server/routes/registers/functions/content.type.js +9 -9
  129. package/server/routes/registers/functions/del.registry.js +14 -14
  130. package/server/routes/registers/functions/get.info.js +93 -93
  131. package/server/routes/registers/functions/gis.export.js +159 -159
  132. package/server/routes/registers/functions/gis.registry.js +71 -71
  133. package/server/routes/registers/functions/gis.registry.list.js +61 -61
  134. package/server/routes/registers/functions/handleRegistryRequest.js +147 -147
  135. package/server/routes/registers/functions/map.registry.js +87 -87
  136. package/server/routes/registers/registers.route.js +80 -80
  137. package/server/routes/registers/registers.route.test.js +144 -144
  138. package/server/routes/registers/registers.schema.js +246 -246
  139. package/server/routes/root.mjs +3 -3
  140. package/server/routes/services/functions/add.service.js +62 -62
  141. package/server/routes/services/functions/create.route.js +93 -93
  142. package/server/routes/services/functions/del.service.js +12 -12
  143. package/server/routes/services/functions/get.layer.geom.js +27 -27
  144. package/server/routes/services/functions/get.service.users.js +76 -76
  145. package/server/routes/services/functions/get.services.col.js +34 -34
  146. package/server/routes/services/functions/get.services.js +89 -89
  147. package/server/routes/services/functions/legend.auto.js +77 -77
  148. package/server/routes/services/services.route.js +76 -76
  149. package/server/routes/services/services.route.test.js +167 -167
  150. package/server/routes/services/services.schema.js +278 -278
  151. package/server/routes/widgets/functions/add.widget.js +38 -38
  152. package/server/routes/widgets/functions/del.widget.js +17 -17
  153. package/server/routes/widgets/functions/get.widget.js +41 -41
  154. package/server/routes/widgets/widgets.route.js +61 -61
  155. package/server/routes/widgets/widgets.route.test.js +144 -144
  156. package/server/routes/widgets/widgets.schema.js +24 -24
  157. package/server/shared/listFiles.js +15 -0
  158. package/utils.js +13 -13
@@ -1,246 +1,246 @@
1
- const queryFilterSchema = { type: 'string', pattern: '^([\\w\\d_-]+)=([А-Яа-яҐґЄєІіЇї\\d\\w\\s\\/\\[\\]\\(\\)\\{\\}\\|,.!?;:—_=-@%#$&^*+=`~]+)$' };
2
- const querySearchSchema = { type: 'string', pattern: '^([А-Яа-яҐґЄєІіЇї\\d\\w\\s\\/\\[\\]\\(\\)\\{\\}\\|,.!?;:—_=-@%#$&^*+=`~]+)$' };
3
-
4
- const registerSchema = {
5
- type: 'object',
6
- additionalProperties: false,
7
- properties: {
8
- id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
9
- register_id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
10
- service_id: { type: ['string', 'null'], pattern: '^([\\d\\w._-]+)$' },
11
-
12
- name: { type: 'string' },
13
- description: { type: ['string', 'null'] },
14
- keywords: { type: ['array', 'string', 'null'] },
15
- holder: { type: ['string', 'null'] },
16
-
17
- table_name: { type: 'string' },
18
- pk: { type: 'string' },
19
- query: { type: ['string', 'null'] },
20
- geometry_column: { type: ['string', 'null'] },
21
- sql_list: { type: ['array', 'string', 'null'] },
22
-
23
- is_active: { type: 'boolean' },
24
- is_public: { type: 'boolean' },
25
-
26
- filters: {
27
- type: 'array',
28
- items: {
29
- type: 'object',
30
- additionalProperties: false,
31
- // ? ua / label
32
- required: ['name', 'type'],
33
- properties: {
34
- ua: { type: 'string' },
35
- data: { type: 'string' },
36
- name: { type: 'string' },
37
- type: { type: 'string' },
38
- label: { type: 'string' },
39
- },
40
- },
41
- },
42
-
43
- columns: {
44
- type: 'array',
45
- items: {
46
- type: 'object',
47
- },
48
- },
49
-
50
- metadata: {
51
- type: ['object', 'null'],
52
- },
53
-
54
- created_at: { type: 'string' },
55
- created_by: { type: 'string' },
56
- updated_by: { type: 'string' },
57
- updated_at: { type: 'string' },
58
-
59
- image: { type: ['string', 'null'] },
60
- order: { type: ['string', 'null'] },
61
- register_key: { type: ['string', 'null'] },
62
-
63
- is_files: { type: 'boolean' },
64
- view: { type: 'string' },
65
-
66
- card: {
67
- type: 'array',
68
- items: {
69
- type: 'object',
70
- additionalProperties: false,
71
- // ? ua / title / label
72
- // ? format / type
73
- required: ['name'],
74
- properties: {
75
- name: { type: 'string' },
76
- title: { type: 'string' },
77
- type: { type: 'string' },
78
- label: { type: 'string' },
79
- format: { type: 'string' },
80
- meta: { type: 'string' },
81
-
82
- ua: { type: 'string' },
83
- data: { type: 'string' },
84
- },
85
- },
86
- },
87
-
88
- is_downloadable: { type: 'boolean' },
89
- is_map: { type: 'boolean' },
90
- is_register: { type: 'boolean' },
91
-
92
- group_id: { type: ['string', 'null'] },
93
-
94
- geom_type: { type: 'string' },
95
-
96
- // This is a JSON string containing a GeoJSON Polygon
97
- bbox: { type: 'string' },
98
-
99
- keywords_text: { type: ['string', 'null'] },
100
-
101
- token: { type: 'string' },
102
-
103
- is_public_data: {
104
- type: 'object',
105
- additionalProperties: false,
106
- required: ['id', 'text'],
107
- properties: {
108
- id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
109
- text: { type: 'string' },
110
- icon: { type: ['string', 'null'] },
111
- color: { type: 'string' },
112
- },
113
- },
114
-
115
- view_text: { type: 'string' },
116
-
117
- is_active_data: {
118
- type: 'object',
119
- additionalProperties: false,
120
- required: ['id', 'text'],
121
- properties: {
122
- id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
123
- text: { type: 'string' },
124
- icon: { type: ['string', 'null'] },
125
- color: { type: 'string' },
126
- },
127
- },
128
-
129
- is_downloadable_data: {
130
- type: 'object',
131
- additionalProperties: false,
132
- required: ['id', 'text'],
133
- properties: {
134
- id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
135
- text: { type: 'string' },
136
- icon: { type: ['string', 'null'] },
137
- color: { type: 'string' },
138
- },
139
- },
140
-
141
- service_id_text: { type: 'string' },
142
- geom_type_text: { type: 'string' },
143
-
144
- tableData: {
145
- type: 'array',
146
- items: {
147
- type: 'object',
148
- },
149
- },
150
- },
151
- };
152
-
153
- export const gisRegistrySchema = {
154
- params: {
155
- type: 'object',
156
- required: ['slug'],
157
- properties: {
158
- slug: { type: 'string' },
159
- objectId: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
160
- },
161
- },
162
- querystring: {
163
- type: 'object',
164
- additionalProperties: false,
165
- properties: {
166
- filter: queryFilterSchema,
167
- search: querySearchSchema,
168
- limit: {
169
- type: 'number',
170
- minimum: 1,
171
- },
172
- page: {
173
- type: 'number',
174
- minimum: 1,
175
- },
176
- sql: {
177
- type: 'string',
178
- pattern: "^(\\d)$"
179
- }
180
- },
181
- },
182
- };
183
-
184
- export const gisRegistryListSchema = {
185
- querystring: {
186
- type: 'object',
187
- additionalProperties: false,
188
- properties: {
189
- search: querySearchSchema,
190
- limit: {
191
- type: 'number',
192
- minimum: 1,
193
- },
194
- page: {
195
- type: 'number',
196
- minimum: 1,
197
- },
198
- },
199
- },
200
- };
201
-
202
- export const addGisRegistrySchema = {
203
- body: { ...registerSchema, required: ['name', 'register_key', 'table_name'] },
204
- };
205
-
206
- export const editGisRegistrySchema = {
207
- params: {
208
- type: 'object',
209
- required: ['slug'],
210
- properties: {
211
- slug: { type: 'string' },
212
- },
213
- },
214
- body: registerSchema
215
- };
216
-
217
- export const deleteGisRegistrySchema = {
218
- params: {
219
- type: 'object',
220
- required: ['slug'],
221
- properties: {
222
- slug: { type: 'string' },
223
- },
224
- },
225
- };
226
-
227
- export const mapRegistrySchema = {};
228
-
229
- export const gisExportSchema = {
230
- params: {
231
- type: 'object',
232
- required: ['slug'],
233
- properties: {
234
- slug: { type: 'string' },
235
- type: { type: 'string', enum: ['register', 'service'] },
236
- },
237
- },
238
- querystring: {
239
- type: 'object',
240
- properties: {
241
- format: { type: 'string', enum: ['csv', 'xlsx', 'shp', 'geojson'], default: 'csv' },
242
- },
243
- },
244
- };
245
-
246
- export default null;
1
+ const queryFilterSchema = { type: 'string', pattern: '^([\\w\\d_-]+)=([А-Яа-яҐґЄєІіЇї\\d\\w\\s\\/\\[\\]\\(\\)\\{\\}\\|,.!?;:—_=-@%#$&^*+=`~]+)$' };
2
+ const querySearchSchema = { type: 'string', pattern: '^([А-Яа-яҐґЄєІіЇї\\d\\w\\s\\/\\[\\]\\(\\)\\{\\}\\|,.!?;:—_=-@%#$&^*+=`~]+)$' };
3
+
4
+ const registerSchema = {
5
+ type: 'object',
6
+ additionalProperties: false,
7
+ properties: {
8
+ id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
9
+ register_id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
10
+ service_id: { type: ['string', 'null'], pattern: '^([\\d\\w._-]+)$' },
11
+
12
+ name: { type: 'string' },
13
+ description: { type: ['string', 'null'] },
14
+ keywords: { type: ['array', 'string', 'null'] },
15
+ holder: { type: ['string', 'null'] },
16
+
17
+ table_name: { type: 'string' },
18
+ pk: { type: 'string' },
19
+ query: { type: ['string', 'null'] },
20
+ geometry_column: { type: ['string', 'null'] },
21
+ sql_list: { type: ['array', 'string', 'null'] },
22
+
23
+ is_active: { type: 'boolean' },
24
+ is_public: { type: 'boolean' },
25
+
26
+ filters: {
27
+ type: 'array',
28
+ items: {
29
+ type: 'object',
30
+ additionalProperties: false,
31
+ // ? ua / label
32
+ required: ['name', 'type'],
33
+ properties: {
34
+ ua: { type: 'string' },
35
+ data: { type: 'string' },
36
+ name: { type: 'string' },
37
+ type: { type: 'string' },
38
+ label: { type: 'string' },
39
+ },
40
+ },
41
+ },
42
+
43
+ columns: {
44
+ type: 'array',
45
+ items: {
46
+ type: 'object',
47
+ },
48
+ },
49
+
50
+ metadata: {
51
+ type: ['object', 'null'],
52
+ },
53
+
54
+ created_at: { type: 'string' },
55
+ created_by: { type: 'string' },
56
+ updated_by: { type: 'string' },
57
+ updated_at: { type: 'string' },
58
+
59
+ image: { type: ['string', 'null'] },
60
+ order: { type: ['string', 'null'] },
61
+ register_key: { type: ['string', 'null'] },
62
+
63
+ is_files: { type: 'boolean' },
64
+ view: { type: 'string' },
65
+
66
+ card: {
67
+ type: 'array',
68
+ items: {
69
+ type: 'object',
70
+ additionalProperties: false,
71
+ // ? ua / title / label
72
+ // ? format / type
73
+ required: ['name'],
74
+ properties: {
75
+ name: { type: 'string' },
76
+ title: { type: 'string' },
77
+ type: { type: 'string' },
78
+ label: { type: 'string' },
79
+ format: { type: 'string' },
80
+ meta: { type: 'string' },
81
+
82
+ ua: { type: 'string' },
83
+ data: { type: 'string' },
84
+ },
85
+ },
86
+ },
87
+
88
+ is_downloadable: { type: 'boolean' },
89
+ is_map: { type: 'boolean' },
90
+ is_register: { type: 'boolean' },
91
+
92
+ group_id: { type: ['string', 'null'] },
93
+
94
+ geom_type: { type: 'string' },
95
+
96
+ // This is a JSON string containing a GeoJSON Polygon
97
+ bbox: { type: 'string' },
98
+
99
+ keywords_text: { type: ['string', 'null'] },
100
+
101
+ token: { type: 'string' },
102
+
103
+ is_public_data: {
104
+ type: 'object',
105
+ additionalProperties: false,
106
+ required: ['id', 'text'],
107
+ properties: {
108
+ id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
109
+ text: { type: 'string' },
110
+ icon: { type: ['string', 'null'] },
111
+ color: { type: 'string' },
112
+ },
113
+ },
114
+
115
+ view_text: { type: 'string' },
116
+
117
+ is_active_data: {
118
+ type: 'object',
119
+ additionalProperties: false,
120
+ required: ['id', 'text'],
121
+ properties: {
122
+ id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
123
+ text: { type: 'string' },
124
+ icon: { type: ['string', 'null'] },
125
+ color: { type: 'string' },
126
+ },
127
+ },
128
+
129
+ is_downloadable_data: {
130
+ type: 'object',
131
+ additionalProperties: false,
132
+ required: ['id', 'text'],
133
+ properties: {
134
+ id: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
135
+ text: { type: 'string' },
136
+ icon: { type: ['string', 'null'] },
137
+ color: { type: 'string' },
138
+ },
139
+ },
140
+
141
+ service_id_text: { type: 'string' },
142
+ geom_type_text: { type: 'string' },
143
+
144
+ tableData: {
145
+ type: 'array',
146
+ items: {
147
+ type: 'object',
148
+ },
149
+ },
150
+ },
151
+ };
152
+
153
+ export const gisRegistrySchema = {
154
+ params: {
155
+ type: 'object',
156
+ required: ['slug'],
157
+ properties: {
158
+ slug: { type: 'string' },
159
+ objectId: { type: 'string', pattern: '^([\\d\\w._-]+)$' },
160
+ },
161
+ },
162
+ querystring: {
163
+ type: 'object',
164
+ additionalProperties: false,
165
+ properties: {
166
+ filter: queryFilterSchema,
167
+ search: querySearchSchema,
168
+ limit: {
169
+ type: 'number',
170
+ minimum: 1,
171
+ },
172
+ page: {
173
+ type: 'number',
174
+ minimum: 1,
175
+ },
176
+ sql: {
177
+ type: 'string',
178
+ pattern: "^(\\d)$"
179
+ }
180
+ },
181
+ },
182
+ };
183
+
184
+ export const gisRegistryListSchema = {
185
+ querystring: {
186
+ type: 'object',
187
+ additionalProperties: false,
188
+ properties: {
189
+ search: querySearchSchema,
190
+ limit: {
191
+ type: 'number',
192
+ minimum: 1,
193
+ },
194
+ page: {
195
+ type: 'number',
196
+ minimum: 1,
197
+ },
198
+ },
199
+ },
200
+ };
201
+
202
+ export const addGisRegistrySchema = {
203
+ body: { ...registerSchema, required: ['name', 'register_key', 'table_name'] },
204
+ };
205
+
206
+ export const editGisRegistrySchema = {
207
+ params: {
208
+ type: 'object',
209
+ required: ['slug'],
210
+ properties: {
211
+ slug: { type: 'string' },
212
+ },
213
+ },
214
+ body: registerSchema
215
+ };
216
+
217
+ export const deleteGisRegistrySchema = {
218
+ params: {
219
+ type: 'object',
220
+ required: ['slug'],
221
+ properties: {
222
+ slug: { type: 'string' },
223
+ },
224
+ },
225
+ };
226
+
227
+ export const mapRegistrySchema = {};
228
+
229
+ export const gisExportSchema = {
230
+ params: {
231
+ type: 'object',
232
+ required: ['slug'],
233
+ properties: {
234
+ slug: { type: 'string' },
235
+ type: { type: 'string', enum: ['register', 'service'] },
236
+ },
237
+ },
238
+ querystring: {
239
+ type: 'object',
240
+ properties: {
241
+ format: { type: 'string', enum: ['csv', 'xlsx', 'shp', 'geojson'], default: 'csv' },
242
+ },
243
+ },
244
+ };
245
+
246
+ export default null;
@@ -1,3 +1,3 @@
1
- export default async function (fastify, opts) {
2
- fastify.get(`/test`, () => { return { test: true } });
3
- }
1
+ export default async function (fastify, opts) {
2
+ fastify.get(`/test`, () => { return { test: true } });
3
+ }
@@ -1,63 +1,63 @@
1
- import { BadRequestError } from "@opengis/fastify-table/errors.js";
2
- import { dataDelete, dataInsert, dataUpdate, pgClients } from "@opengis/fastify-table/utils.js";
3
-
4
- async function updateTemplate(client, body, uid, id) {
5
- if (!body || !id) return;
6
-
7
- await dataDelete({
8
- pg: client,
9
- id,
10
- table: 'admin.templates',
11
- uid,
12
- });
13
- const rowCount = await dataInsert({
14
- pg: client,
15
- id,
16
- table: 'admin.templates',
17
- data: { body, name: id },
18
- uid,
19
- }).then(el => el.rowCount);
20
- return rowCount;
21
- }
22
- export default async function addService({
23
- method, id, body, uid = '0'
24
- }, pg = pgClients.client) {
25
- if (method === 'PUT' && !id) {
26
- throw BadRequestError('not enough params: id');
27
- }
28
-
29
- const client = await pg.connect();
30
- try {
31
- await client.query('begin');
32
-
33
- if (method === 'POST') {
34
- const row = await dataInsert({
35
- pg: client,
36
- id,
37
- table: 'gis.services',
38
- data: body,
39
- uid,
40
- }).then(r => r.rows[0]);
41
- await updateTemplate(client, body.html, uid, row.service_id);
42
- await client.query('commit');
43
- return row;
44
- }
45
-
46
- const row = await dataUpdate({
47
- pg: client,
48
- id,
49
- table: 'gis.services',
50
- data: body,
51
- uid,
52
- });
53
- await updateTemplate(client, body.html, uid, id);
54
- await client.query('commit');
55
- return row;
56
-
57
- } catch (err) {
58
- await client.query('rollback');
59
- throw err;
60
- } finally {
61
- client.release();
62
- }
1
+ import { BadRequestError } from "@opengis/fastify-table/errors.js";
2
+ import { dataDelete, dataInsert, dataUpdate, pgClients } from "@opengis/fastify-table/utils.js";
3
+
4
+ async function updateTemplate(client, body, uid, id) {
5
+ if (!body || !id) return;
6
+
7
+ await dataDelete({
8
+ pg: client,
9
+ id,
10
+ table: 'admin.templates',
11
+ uid,
12
+ });
13
+ const rowCount = await dataInsert({
14
+ pg: client,
15
+ id,
16
+ table: 'admin.templates',
17
+ data: { body, name: id },
18
+ uid,
19
+ }).then(el => el.rowCount);
20
+ return rowCount;
21
+ }
22
+ export default async function addService({
23
+ method, id, body, uid = '0'
24
+ }, pg = pgClients.client) {
25
+ if (method === 'PUT' && !id) {
26
+ throw BadRequestError('not enough params: id');
27
+ }
28
+
29
+ const client = await pg.connect();
30
+ try {
31
+ await client.query('begin');
32
+
33
+ if (method === 'POST') {
34
+ const row = await dataInsert({
35
+ pg: client,
36
+ id,
37
+ table: 'gis.services',
38
+ data: body,
39
+ uid,
40
+ }).then(r => r.rows[0]);
41
+ await updateTemplate(client, body.html, uid, row.service_id);
42
+ await client.query('commit');
43
+ return row;
44
+ }
45
+
46
+ const row = await dataUpdate({
47
+ pg: client,
48
+ id,
49
+ table: 'gis.services',
50
+ data: body,
51
+ uid,
52
+ });
53
+ await updateTemplate(client, body.html, uid, id);
54
+ await client.query('commit');
55
+ return row;
56
+
57
+ } catch (err) {
58
+ await client.query('rollback');
59
+ throw err;
60
+ } finally {
61
+ client.release();
62
+ }
63
63
  }