-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathqwc-data-service.json
278 lines (278 loc) · 9.99 KB
/
qwc-data-service.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/qwc-services/qwc-data-service/raw/master/schemas/qwc-data-service.json",
"title": "QWC Data Service",
"type": "object",
"properties": {
"$schema": {
"title": "JSON Schema",
"description": "Reference to JSON schema of this config",
"type": "string",
"format": "uri",
"default": "https://github.com/qwc-services/qwc-data-service/raw/master/schemas/qwc-data-service.json"
},
"service": {
"title": "Service name",
"type": "string",
"const": "data"
},
"config": {
"title": "Config options",
"type": "object",
"properties": {
"attachments_base_dir": {
"description": "Base dir where attachments are stored",
"type": "string"
},
"attachments_namespace_dir": {
"description": "The namespace dir, below attachments_base_dir. You can use {tenant}, {map}, {dataset}. Default is '{tenant}/{map}.{dataset}'",
"type": "string"
},
"attachment_store_pattern": {
"description": "The path pattern to use when saving attachments to disk. You can use {random}, {filename}, {ext} and {<field>}, where field refers to the value of the field <field> of the committed feature. Default is '{random}/{filename}'",
"type": "string"
},
"allowed_attachment_extensions": {
"description": "Comma separated list of allowed attachment file extensions, i.e. '.png,.jpg'",
"type": "string"
},
"recaptcha_site_secret_key": {
"description": "Captcha site secret key. Set to enable ReCAPTCHA verification for public users",
"type": "string"
},
"max_attachment_file_size": {
"description": "Maximum attachment file size in bytes",
"type": "number"
},
"clamd_host": {
"description": "Hostname of ClamD server listening on TCP port 3310. If set, uploaded files are checked by ClamAV",
"type": "string"
},
"upload_user_field_suffix": {
"description": "Field suffix where to log the username who last changed an upload field, i.e. <fieldname>__<suffix> for the field <fieldname>. If empty, username is not logged.",
"type": "string"
},
"create_timestamp_field": {
"description": "If specified, the timestamp of the creation of the record will be logged to the <create_timestamp_field> field of the record.",
"type": "string"
},
"edit_timestamp_field": {
"description": "If specified, the timestamp of the last mutation to a record will be logged to the <edit_timestamp_field> field of the record.",
"type": "string"
},
"write_utc_timestamps": {
"description": "Whether to write the create/edit timestamps in UTC, as opposed to local time. Default: `false`",
"type": "boolean"
},
"create_user_field": {
"description": "If specified, the username of the user who created a record with be logged to the <create_user_field> field of the record.",
"type": "string"
},
"edit_user_field": {
"description": "If specified, the username of the last user who performed a mutation to a record with be logged to the <edit_user_field> field of the record.",
"type": "string"
},
"geometry_default_allow_null": {
"description": "Whether to allow null geometries by default",
"type": "boolean"
},
"allowed_extensions_per_dataset": {
"description": "Loopup of allowed attachment file extensions per dataset, values as comma separated list, i.e. '.png,.jpg'",
"type": "object"
},
"max_attachment_file_size_per_dataset": {
"description": "Lookup of maximum attachment file size in bytes per dataset",
"type": "object"
}
}
},
"resources": {
"title": "Resources",
"type": "object",
"properties": {
"datasets": {
"title": "Datasets",
"type": "array",
"items": {
"title": "Dataset",
"description": "PostgreSQL metadata and field constraints for a dataset",
"type": "object",
"properties": {
"name": {
"description": "Dataset name",
"type": "string"
},
"db_url": {
"description": "DB connection string for read and write access (or read-only access if db_write_url is present)",
"type": "string"
},
"db_write_url": {
"description": "Optional DB connection string for write access",
"type": "string"
},
"schema": {
"type": "string"
},
"table_name": {
"type": "string"
},
"primary_key": {
"type": "string"
},
"fields": {
"description": "Dataset fields with optional constraints",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Field name",
"type": "string"
},
"data_type": {
"type": "string",
"enum": [
"USER-DEFINED",
"bigint",
"boolean",
"character",
"character varying",
"date",
"double precision",
"file",
"integer",
"json",
"jsonb",
"numeric",
"real",
"smallint",
"text",
"time",
"timestamp with time zone",
"timestamp without time zone",
"uuid"
],
"default": "text"
},
"constraints": {
"type": "object",
"properties": {
"maxlength": {
"type": "integer"
},
"pattern": {
"type": "string"
},
"min": {
"type": "number"
},
"max": {
"type": "number"
},
"numeric_precision": {
"type": "integer"
},
"numeric_scale": {
"type": "integer"
},
"step": {
"type": "number"
},
"values": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"label",
"value"
]
}
},
"readOnly": {
"type": "boolean"
},
"required": {
"type": "boolean"
}
}
}
},
"required": [
"name",
"data_type"
]
}
},
"geometry": {
"title": "PostGIS geometry metadata",
"type": "object",
"properties": {
"geometry_column": {
"type": "string"
},
"geometry_type": {
"type": "string",
"enum": [
"POINT",
"POINTZ",
"LINESTRING",
"LINESTRINGZ",
"POLYGON",
"POLYGONZ",
"MULTIPOINT",
"MULTIPOINTZ",
"MULTILINESTRING",
"MULTILINESTRINGZ",
"MULTIPOLYGON",
"MULTIPOLYGONZ"
]
},
"srid": {
"title": "SRID",
"description": "Spatial Reference System Identifier (EPSG code)",
"type": "integer"
},
"allow_null": {
"title": "Allow NULL geometries",
"description": "Allow setting geometry values to NULL",
"type": "boolean",
"default": false
}
},
"required": [
"geometry_column",
"geometry_type",
"srid"
]
}
},
"required": [
"name",
"db_url",
"schema",
"table_name",
"primary_key",
"fields"
]
}
}
},
"required": [
"datasets"
]
}
},
"required": [
"service",
"config",
"resources"
]
}