open-meteo-mcp-server 1.2.2 → 1.2.4
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.
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +20 -20
- package/dist/client.js.map +1 -1
- package/dist/index.js +75 -61
- package/dist/index.js.map +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +517 -243
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +463 -141
- package/dist/types.js.map +1 -1
- package/package.json +5 -5
package/dist/types.js
CHANGED
|
@@ -13,7 +13,10 @@ export const GeocodingParamsSchema = z.object({
|
|
|
13
13
|
name: z.string().min(2, 'Le nom doit contenir au moins 2 caractères'),
|
|
14
14
|
count: z.number().min(1).max(100).default(10).optional(),
|
|
15
15
|
language: z.string().optional(),
|
|
16
|
-
countryCode: z
|
|
16
|
+
countryCode: z
|
|
17
|
+
.string()
|
|
18
|
+
.regex(/^[A-Z]{2}$/, 'Le code pays doit être au format ISO-3166-1 alpha2 (ex: FR, DE, US)')
|
|
19
|
+
.optional(),
|
|
17
20
|
format: z.enum(['json', 'protobuf']).default('json').optional(),
|
|
18
21
|
});
|
|
19
22
|
export const LocationSchema = z.object({
|
|
@@ -23,7 +26,10 @@ export const LocationSchema = z.object({
|
|
|
23
26
|
longitude: z.number().min(-180).max(180),
|
|
24
27
|
elevation: z.number().optional(),
|
|
25
28
|
feature_code: z.string().optional(),
|
|
26
|
-
country_code: z
|
|
29
|
+
country_code: z
|
|
30
|
+
.string()
|
|
31
|
+
.regex(/^[A-Z]{2}$/)
|
|
32
|
+
.optional(),
|
|
27
33
|
admin1_id: z.number().optional(),
|
|
28
34
|
admin2_id: z.number().optional(),
|
|
29
35
|
admin3_id: z.number().optional(),
|
|
@@ -46,62 +52,194 @@ export const GeocodingErrorSchema = z.object({
|
|
|
46
52
|
reason: z.string(),
|
|
47
53
|
});
|
|
48
54
|
// Weather variables schemas
|
|
49
|
-
export const HourlyVariablesSchema = z
|
|
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
|
-
|
|
55
|
+
export const HourlyVariablesSchema = z
|
|
56
|
+
.array(z.enum([
|
|
57
|
+
'temperature_2m',
|
|
58
|
+
'relative_humidity_2m',
|
|
59
|
+
'dewpoint_2m',
|
|
60
|
+
'apparent_temperature',
|
|
61
|
+
'precipitation_probability',
|
|
62
|
+
'precipitation',
|
|
63
|
+
'rain',
|
|
64
|
+
'showers',
|
|
65
|
+
'snowfall',
|
|
66
|
+
'snow_depth',
|
|
67
|
+
'weather_code',
|
|
68
|
+
'pressure_msl',
|
|
69
|
+
'surface_pressure',
|
|
70
|
+
'cloud_cover',
|
|
71
|
+
'cloud_cover_low',
|
|
72
|
+
'cloud_cover_mid',
|
|
73
|
+
'cloud_cover_high',
|
|
74
|
+
'visibility',
|
|
75
|
+
'evapotranspiration',
|
|
76
|
+
'et0_fao_evapotranspiration',
|
|
77
|
+
'vapour_pressure_deficit',
|
|
78
|
+
'wind_speed_10m',
|
|
79
|
+
'wind_speed_80m',
|
|
80
|
+
'wind_speed_120m',
|
|
81
|
+
'wind_speed_180m',
|
|
82
|
+
'wind_direction_10m',
|
|
83
|
+
'wind_direction_80m',
|
|
84
|
+
'wind_direction_120m',
|
|
85
|
+
'wind_direction_180m',
|
|
86
|
+
'wind_gusts_10m',
|
|
87
|
+
'temperature_80m',
|
|
88
|
+
'temperature_120m',
|
|
89
|
+
'temperature_180m',
|
|
90
|
+
'soil_temperature_0cm',
|
|
91
|
+
'soil_temperature_6cm',
|
|
92
|
+
'soil_temperature_18cm',
|
|
93
|
+
'soil_temperature_54cm',
|
|
94
|
+
'soil_moisture_0_to_1cm',
|
|
95
|
+
'soil_moisture_1_to_3cm',
|
|
96
|
+
'soil_moisture_3_to_9cm',
|
|
97
|
+
'soil_moisture_9_to_27cm',
|
|
98
|
+
'soil_moisture_27_to_81cm',
|
|
99
|
+
'uv_index',
|
|
100
|
+
'uv_index_clear_sky',
|
|
101
|
+
'is_day',
|
|
102
|
+
'sunshine_duration',
|
|
103
|
+
'wet_bulb_temperature_2m',
|
|
104
|
+
'total_column_integrated_water_vapour',
|
|
105
|
+
'cape',
|
|
106
|
+
'lifted_index',
|
|
107
|
+
'convective_inhibition',
|
|
108
|
+
'freezing_level_height',
|
|
109
|
+
'boundary_layer_height_pbl',
|
|
110
|
+
'shortwave_radiation',
|
|
111
|
+
'direct_radiation',
|
|
112
|
+
'diffuse_radiation',
|
|
113
|
+
'direct_normal_irradiance',
|
|
114
|
+
'global_tilted_irradiance',
|
|
115
|
+
'terrestrial_radiation',
|
|
116
|
+
'shortwave_radiation_instant',
|
|
117
|
+
'direct_radiation_instant',
|
|
118
|
+
'diffuse_radiation_instant',
|
|
119
|
+
'direct_normal_irradiance_instant',
|
|
120
|
+
'global_tilted_irradiance_instant',
|
|
121
|
+
'terrestrial_radiation_instant',
|
|
122
|
+
]))
|
|
123
|
+
.optional();
|
|
124
|
+
export const DailyVariablesSchema = z
|
|
125
|
+
.array(z.enum([
|
|
126
|
+
'weather_code',
|
|
127
|
+
'temperature_2m_max',
|
|
128
|
+
'temperature_2m_min',
|
|
129
|
+
'apparent_temperature_max',
|
|
130
|
+
'apparent_temperature_min',
|
|
131
|
+
'sunrise',
|
|
132
|
+
'sunset',
|
|
133
|
+
'daylight_duration',
|
|
134
|
+
'sunshine_duration',
|
|
135
|
+
'uv_index_max',
|
|
136
|
+
'uv_index_clear_sky_max',
|
|
137
|
+
'rain_sum',
|
|
138
|
+
'showers_sum',
|
|
139
|
+
'snowfall_sum',
|
|
140
|
+
'precipitation_sum',
|
|
141
|
+
'precipitation_hours',
|
|
142
|
+
'precipitation_probability_max',
|
|
143
|
+
'wind_speed_10m_max',
|
|
144
|
+
'wind_gusts_10m_max',
|
|
145
|
+
'wind_direction_10m_dominant',
|
|
146
|
+
'shortwave_radiation_sum',
|
|
147
|
+
'et0_fao_evapotranspiration',
|
|
148
|
+
'temperature_2m_mean',
|
|
149
|
+
'apparent_temperature_mean',
|
|
150
|
+
'cape_mean',
|
|
151
|
+
'cape_max',
|
|
152
|
+
'cape_min',
|
|
153
|
+
'cloud_cover_mean',
|
|
154
|
+
'cloud_cover_max',
|
|
155
|
+
'cloud_cover_min',
|
|
156
|
+
'dewpoint_2m_mean',
|
|
157
|
+
'dewpoint_2m_max',
|
|
158
|
+
'dewpoint_2m_min',
|
|
159
|
+
'et0_fao_evapotranspiration_sum',
|
|
160
|
+
'growing_degree_days_base_0_limit_50',
|
|
161
|
+
'leaf_wetness_probability_mean',
|
|
162
|
+
'leaf_wetness_probability_max',
|
|
163
|
+
'leaf_wetness_probability_min',
|
|
164
|
+
'precipitation_probability_mean',
|
|
165
|
+
'precipitation_probability_min',
|
|
166
|
+
'relative_humidity_2m_mean',
|
|
167
|
+
'relative_humidity_2m_max',
|
|
168
|
+
'relative_humidity_2m_min',
|
|
169
|
+
'snowfall_water_equivalent_sum',
|
|
170
|
+
'pressure_msl_mean',
|
|
171
|
+
'pressure_msl_max',
|
|
172
|
+
'pressure_msl_min',
|
|
173
|
+
'surface_pressure_mean',
|
|
174
|
+
'surface_pressure_max',
|
|
175
|
+
'surface_pressure_min',
|
|
176
|
+
'updraft_max',
|
|
177
|
+
'visibility_mean',
|
|
178
|
+
'visibility_max',
|
|
179
|
+
'visibility_min',
|
|
180
|
+
'wind_gusts_10m_mean',
|
|
181
|
+
'wind_gusts_10m_min',
|
|
182
|
+
'wind_speed_10m_mean',
|
|
183
|
+
'wind_speed_10m_min',
|
|
184
|
+
'wet_bulb_temperature_2m_mean',
|
|
185
|
+
'wet_bulb_temperature_2m_max',
|
|
186
|
+
'wet_bulb_temperature_2m_min',
|
|
187
|
+
'vapour_pressure_deficit_max',
|
|
188
|
+
]))
|
|
189
|
+
.optional();
|
|
190
|
+
export const ForecastModelsSchema = z
|
|
191
|
+
.array(z.enum([
|
|
192
|
+
'ecmwf_ifs_hres_9km',
|
|
193
|
+
'ecmwf_ifs_025',
|
|
194
|
+
'ecmwf_aifs_025_single',
|
|
195
|
+
'cma_grapes_global',
|
|
196
|
+
'bom_access_global',
|
|
197
|
+
'ncep_gfs_seamless',
|
|
198
|
+
'ncep_gfs_global',
|
|
199
|
+
'ncep_hrrr_us_conus',
|
|
200
|
+
'ncep_nbm_us_conus',
|
|
201
|
+
'ncep_nam_us_conus',
|
|
202
|
+
'ncep_gfs_graphcast',
|
|
203
|
+
'ncep_aigfs_025',
|
|
204
|
+
'ncep_hgefs_025_ensemble_mean',
|
|
205
|
+
'jma_seamless',
|
|
206
|
+
'jma_msm',
|
|
207
|
+
'jma_gsm',
|
|
208
|
+
'kma_seamless',
|
|
209
|
+
'kma_ldps',
|
|
210
|
+
'kma_gdps',
|
|
211
|
+
'dwd_icon_seamless',
|
|
212
|
+
'dwd_icon_global',
|
|
213
|
+
'dwd_icon_eu',
|
|
214
|
+
'dwd_icon_d2',
|
|
215
|
+
'gem_seamless',
|
|
216
|
+
'gem_global',
|
|
217
|
+
'gem_regional',
|
|
218
|
+
'gem_hrdps_continental',
|
|
219
|
+
'gem_hrdps_west',
|
|
220
|
+
'meteofrance_seamless',
|
|
221
|
+
'meteofrance_arpege_world',
|
|
222
|
+
'meteofrance_arpege_europe',
|
|
223
|
+
'meteofrance_arome_france',
|
|
224
|
+
'meteofrance_arome_france_hd',
|
|
225
|
+
'italiameteo_arpae_icon_2i',
|
|
226
|
+
'met_norway_nordic_seamless',
|
|
227
|
+
'met_norway_nordic',
|
|
228
|
+
'knmi_seamless',
|
|
229
|
+
'knmi_harmonie_arome_europe',
|
|
230
|
+
'knmi_harmonie_arome_netherlands',
|
|
231
|
+
'dmi_seamless',
|
|
232
|
+
'dmi_harmonie_arome_europe',
|
|
233
|
+
'uk_met_office_seamless',
|
|
234
|
+
'uk_met_office_global_10km',
|
|
235
|
+
'uk_met_office_uk_2km',
|
|
236
|
+
'meteoswiss_icon_seamless',
|
|
237
|
+
'meteoswiss_icon_ch1',
|
|
238
|
+
'meteoswiss_icon_ch2',
|
|
239
|
+
]))
|
|
240
|
+
.optional();
|
|
241
|
+
export const EnsembleModelsSchema = z
|
|
242
|
+
.array(z.enum([
|
|
105
243
|
'icon_seamless_eps',
|
|
106
244
|
'icon_global_eps',
|
|
107
245
|
'icon_eu_eps',
|
|
@@ -117,8 +255,9 @@ export const EnsembleModelsSchema = z.array(z.enum([
|
|
|
117
255
|
'ukmo_global_20km',
|
|
118
256
|
'ukmo_uk_2km',
|
|
119
257
|
'meteoswiss_icon_ch1',
|
|
120
|
-
'meteoswiss_icon_ch2'
|
|
121
|
-
]))
|
|
258
|
+
'meteoswiss_icon_ch2',
|
|
259
|
+
]))
|
|
260
|
+
.optional();
|
|
122
261
|
// Forecast parameters schema
|
|
123
262
|
export const ForecastParamsSchema = CoordinateSchema.extend({
|
|
124
263
|
hourly: HourlyVariablesSchema,
|
|
@@ -131,10 +270,22 @@ export const ForecastParamsSchema = CoordinateSchema.extend({
|
|
|
131
270
|
timezone: z.string().optional(),
|
|
132
271
|
past_days: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
133
272
|
forecast_days: z.number().min(1).max(16).optional(),
|
|
134
|
-
start_date: z
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
273
|
+
start_date: z
|
|
274
|
+
.string()
|
|
275
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
276
|
+
.optional(),
|
|
277
|
+
end_date: z
|
|
278
|
+
.string()
|
|
279
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
280
|
+
.optional(),
|
|
281
|
+
start_hour: z
|
|
282
|
+
.string()
|
|
283
|
+
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)
|
|
284
|
+
.optional(),
|
|
285
|
+
end_hour: z
|
|
286
|
+
.string()
|
|
287
|
+
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)
|
|
288
|
+
.optional(),
|
|
138
289
|
models: ForecastModelsSchema,
|
|
139
290
|
});
|
|
140
291
|
// Archive parameters schema
|
|
@@ -150,15 +301,42 @@ export const ArchiveParamsSchema = CoordinateSchema.extend({
|
|
|
150
301
|
timezone: z.string().optional(),
|
|
151
302
|
});
|
|
152
303
|
// Air quality variables
|
|
153
|
-
export const AirQualityVariablesSchema = z
|
|
154
|
-
|
|
155
|
-
'
|
|
156
|
-
'
|
|
157
|
-
'
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
'
|
|
161
|
-
|
|
304
|
+
export const AirQualityVariablesSchema = z
|
|
305
|
+
.array(z.enum([
|
|
306
|
+
'pm10',
|
|
307
|
+
'pm2_5',
|
|
308
|
+
'carbon_monoxide',
|
|
309
|
+
'nitrogen_dioxide',
|
|
310
|
+
'ozone',
|
|
311
|
+
'sulphur_dioxide',
|
|
312
|
+
'ammonia',
|
|
313
|
+
'dust',
|
|
314
|
+
'aerosol_optical_depth',
|
|
315
|
+
'carbon_dioxide',
|
|
316
|
+
'methane',
|
|
317
|
+
'alder_pollen',
|
|
318
|
+
'birch_pollen',
|
|
319
|
+
'grass_pollen',
|
|
320
|
+
'mugwort_pollen',
|
|
321
|
+
'olive_pollen',
|
|
322
|
+
'ragweed_pollen',
|
|
323
|
+
'european_aqi',
|
|
324
|
+
'european_aqi_pm2_5',
|
|
325
|
+
'european_aqi_pm10',
|
|
326
|
+
'european_aqi_nitrogen_dioxide',
|
|
327
|
+
'european_aqi_ozone',
|
|
328
|
+
'european_aqi_sulphur_dioxide',
|
|
329
|
+
'us_aqi',
|
|
330
|
+
'us_aqi_pm2_5',
|
|
331
|
+
'us_aqi_pm10',
|
|
332
|
+
'us_aqi_nitrogen_dioxide',
|
|
333
|
+
'us_aqi_ozone',
|
|
334
|
+
'us_aqi_sulphur_dioxide',
|
|
335
|
+
'us_aqi_carbon_monoxide',
|
|
336
|
+
'uv_index',
|
|
337
|
+
'uv_index_clear_sky',
|
|
338
|
+
]))
|
|
339
|
+
.optional();
|
|
162
340
|
export const AirQualityParamsSchema = CoordinateSchema.extend({
|
|
163
341
|
hourly: AirQualityVariablesSchema,
|
|
164
342
|
timezone: z.string().optional(),
|
|
@@ -167,21 +345,48 @@ export const AirQualityParamsSchema = CoordinateSchema.extend({
|
|
|
167
345
|
forecast_days: z.number().min(1).max(16).optional(),
|
|
168
346
|
});
|
|
169
347
|
// Marine variables
|
|
170
|
-
export const MarineHourlyVariablesSchema = z
|
|
171
|
-
|
|
172
|
-
'
|
|
173
|
-
'
|
|
174
|
-
'
|
|
175
|
-
'
|
|
176
|
-
'
|
|
177
|
-
'
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
'
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
'
|
|
184
|
-
|
|
348
|
+
export const MarineHourlyVariablesSchema = z
|
|
349
|
+
.array(z.enum([
|
|
350
|
+
'wave_height',
|
|
351
|
+
'wave_direction',
|
|
352
|
+
'wave_period',
|
|
353
|
+
'wave_peak_period',
|
|
354
|
+
'wind_wave_height',
|
|
355
|
+
'wind_wave_direction',
|
|
356
|
+
'wind_wave_period',
|
|
357
|
+
'wind_wave_peak_period',
|
|
358
|
+
'swell_wave_height',
|
|
359
|
+
'swell_wave_direction',
|
|
360
|
+
'swell_wave_period',
|
|
361
|
+
'swell_wave_peak_period',
|
|
362
|
+
'secondary_swell_wave_height',
|
|
363
|
+
'secondary_swell_wave_period',
|
|
364
|
+
'secondary_swell_wave_direction',
|
|
365
|
+
'tertiary_swell_wave_height',
|
|
366
|
+
'tertiary_swell_wave_period',
|
|
367
|
+
'tertiary_swell_wave_direction',
|
|
368
|
+
'sea_level_height_msl',
|
|
369
|
+
'sea_surface_temperature',
|
|
370
|
+
'ocean_current_velocity',
|
|
371
|
+
'ocean_current_direction',
|
|
372
|
+
'invert_barometer_height',
|
|
373
|
+
]))
|
|
374
|
+
.optional();
|
|
375
|
+
export const MarineDailyVariablesSchema = z
|
|
376
|
+
.array(z.enum([
|
|
377
|
+
'wave_height_max',
|
|
378
|
+
'wave_direction_dominant',
|
|
379
|
+
'wave_period_max',
|
|
380
|
+
'wind_wave_height_max',
|
|
381
|
+
'wind_wave_direction_dominant',
|
|
382
|
+
'wind_wave_period_max',
|
|
383
|
+
'wind_wave_peak_period_max',
|
|
384
|
+
'swell_wave_height_max',
|
|
385
|
+
'swell_wave_direction_dominant',
|
|
386
|
+
'swell_wave_period_max',
|
|
387
|
+
'swell_wave_peak_period_max',
|
|
388
|
+
]))
|
|
389
|
+
.optional();
|
|
185
390
|
export const MarineParamsSchema = CoordinateSchema.extend({
|
|
186
391
|
hourly: MarineHourlyVariablesSchema,
|
|
187
392
|
daily: MarineDailyVariablesSchema,
|
|
@@ -191,38 +396,78 @@ export const MarineParamsSchema = CoordinateSchema.extend({
|
|
|
191
396
|
forecast_days: z.number().min(1).max(16).optional(),
|
|
192
397
|
});
|
|
193
398
|
// Flood variables
|
|
194
|
-
export const FloodDailyVariablesSchema = z
|
|
195
|
-
|
|
196
|
-
'
|
|
197
|
-
|
|
399
|
+
export const FloodDailyVariablesSchema = z
|
|
400
|
+
.array(z.enum([
|
|
401
|
+
'river_discharge',
|
|
402
|
+
'river_discharge_mean',
|
|
403
|
+
'river_discharge_median',
|
|
404
|
+
'river_discharge_max',
|
|
405
|
+
'river_discharge_min',
|
|
406
|
+
'river_discharge_p25',
|
|
407
|
+
'river_discharge_p75',
|
|
408
|
+
]))
|
|
409
|
+
.optional();
|
|
198
410
|
export const FloodParamsSchema = CoordinateSchema.extend({
|
|
199
411
|
daily: FloodDailyVariablesSchema,
|
|
200
412
|
timezone: z.string().optional(),
|
|
201
413
|
timeformat: TimeFormatSchema,
|
|
202
414
|
past_days: z.number().min(1).max(7).optional(),
|
|
203
415
|
forecast_days: z.number().min(1).max(210).optional(),
|
|
204
|
-
start_date: z
|
|
205
|
-
|
|
416
|
+
start_date: z
|
|
417
|
+
.string()
|
|
418
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
419
|
+
.optional(),
|
|
420
|
+
end_date: z
|
|
421
|
+
.string()
|
|
422
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
423
|
+
.optional(),
|
|
206
424
|
ensemble: z.boolean().optional(),
|
|
207
425
|
cell_selection: z.enum(['land', 'sea', 'nearest']).default('nearest').optional(),
|
|
208
426
|
});
|
|
209
427
|
// Seasonal forecast parameters
|
|
210
428
|
export const SeasonalParamsSchema = CoordinateSchema.extend({
|
|
211
|
-
hourly: z
|
|
212
|
-
|
|
213
|
-
'
|
|
214
|
-
'
|
|
215
|
-
'
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
'
|
|
219
|
-
'
|
|
220
|
-
'
|
|
221
|
-
|
|
429
|
+
hourly: z
|
|
430
|
+
.array(z.enum([
|
|
431
|
+
'pressure_msl',
|
|
432
|
+
'temperature_2m',
|
|
433
|
+
'temperature_2m_max',
|
|
434
|
+
'temperature_2m_min',
|
|
435
|
+
'shortwave_radiation',
|
|
436
|
+
'cloud_cover',
|
|
437
|
+
'precipitation',
|
|
438
|
+
'showers',
|
|
439
|
+
'wind_speed_10m',
|
|
440
|
+
'wind_direction_10m',
|
|
441
|
+
'relative_humidity_2m',
|
|
442
|
+
'soil_temperature_0_to_10cm',
|
|
443
|
+
'soil_moisture_0_to_10cm',
|
|
444
|
+
'soil_moisture_10_to_40cm',
|
|
445
|
+
'soil_moisture_40_to_100cm',
|
|
446
|
+
'soil_moisture_100_to_200cm',
|
|
447
|
+
]))
|
|
448
|
+
.optional(),
|
|
449
|
+
daily: z
|
|
450
|
+
.array(z.enum([
|
|
451
|
+
'temperature_2m_max',
|
|
452
|
+
'temperature_2m_min',
|
|
453
|
+
'shortwave_radiation_sum',
|
|
454
|
+
'precipitation_sum',
|
|
455
|
+
'rain_sum',
|
|
456
|
+
'precipitation_hours',
|
|
457
|
+
'wind_speed_10m_max',
|
|
458
|
+
'wind_direction_10m_dominant',
|
|
459
|
+
]))
|
|
460
|
+
.optional(),
|
|
222
461
|
forecast_days: z.union([z.literal(45), z.literal(92), z.literal(183), z.literal(274)]).optional(),
|
|
223
462
|
past_days: z.number().min(0).max(92).optional(),
|
|
224
|
-
start_date: z
|
|
225
|
-
|
|
463
|
+
start_date: z
|
|
464
|
+
.string()
|
|
465
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
466
|
+
.optional(),
|
|
467
|
+
end_date: z
|
|
468
|
+
.string()
|
|
469
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
470
|
+
.optional(),
|
|
226
471
|
temperature_unit: TemperatureUnitSchema,
|
|
227
472
|
wind_speed_unit: WindSpeedUnitSchema,
|
|
228
473
|
precipitation_unit: PrecipitationUnitSchema,
|
|
@@ -230,17 +475,32 @@ export const SeasonalParamsSchema = CoordinateSchema.extend({
|
|
|
230
475
|
});
|
|
231
476
|
// Climate models
|
|
232
477
|
export const ClimateModelsSchema = z.array(z.enum([
|
|
233
|
-
'CMCC_CM2_VHR4',
|
|
234
|
-
'
|
|
478
|
+
'CMCC_CM2_VHR4',
|
|
479
|
+
'FGOALS_f3_H',
|
|
480
|
+
'HiRAM_SIT_HR',
|
|
481
|
+
'MRI_AGCM3_2_S',
|
|
482
|
+
'EC_Earth3P_HR',
|
|
483
|
+
'MPI_ESM1_2_XR',
|
|
484
|
+
'NICAM16_8S',
|
|
235
485
|
]));
|
|
236
486
|
// Climate projection parameters
|
|
237
487
|
export const ClimateParamsSchema = CoordinateSchema.extend({
|
|
238
488
|
daily: z.array(z.enum([
|
|
239
|
-
'temperature_2m_max',
|
|
240
|
-
'
|
|
241
|
-
'
|
|
242
|
-
'
|
|
243
|
-
'
|
|
489
|
+
'temperature_2m_max',
|
|
490
|
+
'temperature_2m_min',
|
|
491
|
+
'temperature_2m_mean',
|
|
492
|
+
'cloud_cover_mean',
|
|
493
|
+
'relative_humidity_2m_max',
|
|
494
|
+
'relative_humidity_2m_min',
|
|
495
|
+
'relative_humidity_2m_mean',
|
|
496
|
+
'soil_moisture_0_to_10cm_mean',
|
|
497
|
+
'precipitation_sum',
|
|
498
|
+
'rain_sum',
|
|
499
|
+
'snowfall_sum',
|
|
500
|
+
'wind_speed_10m_mean',
|
|
501
|
+
'wind_speed_10m_max',
|
|
502
|
+
'pressure_msl_mean',
|
|
503
|
+
'shortwave_radiation_sum',
|
|
244
504
|
])),
|
|
245
505
|
start_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
246
506
|
end_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
@@ -253,31 +513,91 @@ export const ClimateParamsSchema = CoordinateSchema.extend({
|
|
|
253
513
|
// Ensemble forecast parameters
|
|
254
514
|
export const EnsembleParamsSchema = CoordinateSchema.extend({
|
|
255
515
|
models: EnsembleModelsSchema,
|
|
256
|
-
hourly: z
|
|
257
|
-
|
|
258
|
-
'
|
|
259
|
-
'
|
|
260
|
-
'
|
|
261
|
-
'
|
|
262
|
-
'
|
|
263
|
-
'
|
|
264
|
-
'
|
|
265
|
-
'
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
'
|
|
269
|
-
'
|
|
270
|
-
'
|
|
271
|
-
'
|
|
272
|
-
'
|
|
273
|
-
'
|
|
274
|
-
'
|
|
275
|
-
'
|
|
276
|
-
'
|
|
277
|
-
'
|
|
278
|
-
'
|
|
279
|
-
'
|
|
280
|
-
|
|
516
|
+
hourly: z
|
|
517
|
+
.array(z.enum([
|
|
518
|
+
'temperature_2m',
|
|
519
|
+
'relative_humidity_2m',
|
|
520
|
+
'dew_point_2m',
|
|
521
|
+
'apparent_temperature',
|
|
522
|
+
'precipitation',
|
|
523
|
+
'rain',
|
|
524
|
+
'snowfall',
|
|
525
|
+
'snow_depth',
|
|
526
|
+
'weather_code',
|
|
527
|
+
'pressure_msl',
|
|
528
|
+
'surface_pressure',
|
|
529
|
+
'cloud_cover',
|
|
530
|
+
'visibility',
|
|
531
|
+
'wind_speed_10m',
|
|
532
|
+
'wind_direction_10m',
|
|
533
|
+
'wind_gusts_10m',
|
|
534
|
+
'wind_speed_80m',
|
|
535
|
+
'wind_direction_80m',
|
|
536
|
+
'wind_speed_100m',
|
|
537
|
+
'wind_direction_100m',
|
|
538
|
+
'surface_temperature',
|
|
539
|
+
'soil_temperature_0_to_10cm',
|
|
540
|
+
'cape',
|
|
541
|
+
'et0_fao_evapotranspiration',
|
|
542
|
+
'vapour_pressure_deficit',
|
|
543
|
+
'shortwave_radiation',
|
|
544
|
+
'uv_index',
|
|
545
|
+
'uv_index_clear_sky',
|
|
546
|
+
'temperature_3h_min_2m',
|
|
547
|
+
'temperature_3h_max_2m',
|
|
548
|
+
'wet_bulb_temperature_2m',
|
|
549
|
+
'convective_inhibition',
|
|
550
|
+
'freezing_level_height',
|
|
551
|
+
'snowfall_height',
|
|
552
|
+
'sunshine_duration',
|
|
553
|
+
'snowfall_water_equivalent',
|
|
554
|
+
'snow_depth_water_equivalent',
|
|
555
|
+
]))
|
|
556
|
+
.optional(),
|
|
557
|
+
daily: z
|
|
558
|
+
.array(z.enum([
|
|
559
|
+
'temperature_2m_mean',
|
|
560
|
+
'temperature_2m_min',
|
|
561
|
+
'temperature_2m_max',
|
|
562
|
+
'apparent_temperature_mean',
|
|
563
|
+
'apparent_temperature_min',
|
|
564
|
+
'apparent_temperature_max',
|
|
565
|
+
'wind_speed_10m_mean',
|
|
566
|
+
'wind_speed_10m_min',
|
|
567
|
+
'wind_speed_10m_max',
|
|
568
|
+
'wind_direction_10m_dominant',
|
|
569
|
+
'wind_gusts_10m_mean',
|
|
570
|
+
'wind_gusts_10m_min',
|
|
571
|
+
'wind_gusts_10m_max',
|
|
572
|
+
'wind_speed_100m_mean',
|
|
573
|
+
'wind_speed_100m_min',
|
|
574
|
+
'wind_speed_100m_max',
|
|
575
|
+
'wind_direction_100m_dominant',
|
|
576
|
+
'precipitation_sum',
|
|
577
|
+
'precipitation_hours',
|
|
578
|
+
'rain_sum',
|
|
579
|
+
'snowfall_sum',
|
|
580
|
+
'pressure_msl_mean',
|
|
581
|
+
'pressure_msl_min',
|
|
582
|
+
'pressure_msl_max',
|
|
583
|
+
'surface_pressure_mean',
|
|
584
|
+
'surface_pressure_min',
|
|
585
|
+
'surface_pressure_max',
|
|
586
|
+
'cloud_cover_mean',
|
|
587
|
+
'cloud_cover_min',
|
|
588
|
+
'cloud_cover_max',
|
|
589
|
+
'relative_humidity_2m_mean',
|
|
590
|
+
'relative_humidity_2m_min',
|
|
591
|
+
'relative_humidity_2m_max',
|
|
592
|
+
'dew_point_2m_mean',
|
|
593
|
+
'dew_point_2m_min',
|
|
594
|
+
'dew_point_2m_max',
|
|
595
|
+
'cape_mean',
|
|
596
|
+
'cape_min',
|
|
597
|
+
'cape_max',
|
|
598
|
+
'shortwave_radiation_sum',
|
|
599
|
+
]))
|
|
600
|
+
.optional(),
|
|
281
601
|
forecast_days: z.number().min(1).max(35).optional(),
|
|
282
602
|
temperature_unit: TemperatureUnitSchema,
|
|
283
603
|
wind_speed_unit: WindSpeedUnitSchema,
|
|
@@ -297,13 +617,15 @@ export const WeatherResponseSchema = z.object({
|
|
|
297
617
|
hourly_units: z.record(z.string()).optional(),
|
|
298
618
|
daily: z.record(z.array(z.union([z.number(), z.string()]))).optional(),
|
|
299
619
|
daily_units: z.record(z.string()).optional(),
|
|
300
|
-
current_weather: z
|
|
620
|
+
current_weather: z
|
|
621
|
+
.object({
|
|
301
622
|
time: z.string(),
|
|
302
623
|
temperature: z.number(),
|
|
303
624
|
wind_speed: z.number(),
|
|
304
625
|
wind_direction: z.number(),
|
|
305
626
|
weather_code: z.number(),
|
|
306
|
-
})
|
|
627
|
+
})
|
|
628
|
+
.optional(),
|
|
307
629
|
});
|
|
308
630
|
export const ElevationResponseSchema = z.object({
|
|
309
631
|
elevation: z.array(z.number()),
|