@mostlyrightmd/core 1.2.0 → 1.5.0

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.
@@ -56,9 +56,9 @@ function toJsonSafe(value, seen) {
56
56
  }
57
57
  return { _repr_only: true, value: String(value) };
58
58
  }
59
- var TradewindsError = class extends Error {
59
+ var MostlyRightError = class extends Error {
60
60
  /** Subclass override — the stable string enum surfaced via `errorCode`. */
61
- static defaultErrorCode = "TRADEWINDS_ERROR";
61
+ static defaultErrorCode = "MOSTLYRIGHT_ERROR";
62
62
  errorCode;
63
63
  source;
64
64
  requestId;
@@ -90,7 +90,7 @@ var TradewindsError = class extends Error {
90
90
  return safe;
91
91
  }
92
92
  };
93
- var SchemaValidationError = class extends TradewindsError {
93
+ var SchemaValidationError = class extends MostlyRightError {
94
94
  static defaultErrorCode = "SCHEMA_VALIDATION_FAILED";
95
95
  schemaId;
96
96
  violations;
@@ -113,7 +113,7 @@ var SchemaValidationError = class extends TradewindsError {
113
113
  };
114
114
  }
115
115
  };
116
- var SourceMismatchError = class extends TradewindsError {
116
+ var SourceMismatchError = class extends MostlyRightError {
117
117
  static defaultErrorCode = "SOURCE_MISMATCH";
118
118
  /** Canonical role-name vocabulary (design.md §R). */
119
119
  static VALID_ROLES = /* @__PURE__ */ new Set([
@@ -145,7 +145,7 @@ var SourceMismatchError = class extends TradewindsError {
145
145
 
146
146
  // src/schemas/validators/schema_forecast_iem_mos_v1.js
147
147
  var schema_forecast_iem_mos_v1 = validate21;
148
- var schema32 = { "$id": "https://mostlyright.dev/schemas/schema.forecast.iem_mos.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "imperialRenames": { "dew_point_c": "dew_point_F", "temp_c": "temp_F", "wind_speed_ms": "wind_speed_kt" }, "properties": { "dew_point_c": { "description": "units: celsius", "type": ["null", "number"] }, "forecast_hour": { "description": "units: hours \u2014 (valid_at - issued_at).total_seconds() / 3600", "type": "integer" }, "issued_at": { "description": "model run time (from source `runtime` field)", "format": "date-time", "type": "string" }, "model": { "description": "e.g. NBE, GFS, LAV, MET", "type": "string" }, "precip_probability": { "description": "units: probability \u2014 bounded [0, 1]", "type": ["null", "number"] }, "sky_cover_pct": { "description": "units: percent \u2014 bounded [0, 100]", "type": ["integer", "null"] }, "station": { "type": "string" }, "temp_c": { "description": "units: celsius", "type": ["null", "number"] }, "valid_at": { "description": "forecast target time (from source `ftime`)", "format": "date-time", "type": "string" }, "wind_dir_deg": { "description": "units: degrees", "type": ["integer", "null"] }, "wind_speed_ms": { "description": "units: m/s", "type": ["null", "number"] } }, "required": ["forecast_hour", "issued_at", "model", "station", "valid_at"], "title": "schema.forecast.iem_mos.v1", "type": "object", "version": "v1" };
148
+ var schema32 = { "$id": "https://mostlyright.dev/schemas/schema.forecast.iem_mos.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "imperialRenames": { "apparent_temp_c": "apparent_temp_F", "dew_point_c": "dew_point_F", "temp_c": "temp_F", "wind_gusts_ms": "wind_gusts_kt", "wind_speed_ms": "wind_speed_kt" }, "properties": { "apparent_temp_c": { "description": "units: celsius", "type": ["null", "number"] }, "cape_jkg": { "description": "units: J/kg", "type": ["null", "number"] }, "cloud_cover_pct": { "description": "units: percent", "type": ["integer", "null"] }, "dew_point_c": { "description": "units: celsius", "type": ["null", "number"] }, "direct_radiation_wm2": { "description": "units: W/m^2", "type": ["null", "number"] }, "forecast_hour": { "description": "units: hours \u2014 (valid_at - issued_at).total_seconds() / 3600", "type": "integer" }, "freezing_level_m": { "description": "units: meters", "type": ["integer", "null"] }, "issued_at": { "description": "model run time (knowledge_time). Nullable to accommodate Phase 20 open_meteo.seamless rows whose cycle is unrecoverable from the response. LeakageDetector + assert_issued_at_populated() are the runtime gates that reject null issued_at in training-data paths.", "format": "date-time", "type": ["null", "string"] }, "model": { "description": "e.g. NBE, GFS, LAV, MET, gfs_global, ecmwf_ifs025", "type": "string" }, "precip_probability": { "description": "units: probability \u2014 bounded [0, 1]", "type": ["null", "number"] }, "precipitation_mm": { "description": "units: mm", "type": ["null", "number"] }, "pressure_msl_hpa": { "description": "units: hPa", "type": ["null", "number"] }, "retrieved_at": { "description": "wall-clock time the row was fetched from upstream", "format": "date-time", "type": "string" }, "shortwave_radiation_wm2": { "description": "units: W/m^2", "type": ["null", "number"] }, "sky_cover_pct": { "description": "units: percent \u2014 bounded [0, 100]", "type": ["integer", "null"] }, "snow_depth_m": { "description": "units: meters", "type": ["null", "number"] }, "source": { "description": "iem.archive | open_meteo.previous_runs | open_meteo.single_run | open_meteo.live", "type": "string" }, "station": { "type": "string" }, "surface_pressure_hpa": { "description": "units: hPa", "type": ["null", "number"] }, "temp_c": { "description": "units: celsius", "type": ["null", "number"] }, "valid_at": { "description": "forecast target time (event_time)", "format": "date-time", "type": "string" }, "visibility_m": { "description": "units: meters", "type": ["integer", "null"] }, "weather_code": { "description": "units: WMO 4677 \u2014 WMO weather code (clear, fog, rain, snow, etc.)", "type": ["integer", "null"] }, "wind_dir_deg": { "description": "units: degrees", "type": ["integer", "null"] }, "wind_gusts_ms": { "description": "units: m/s", "type": ["null", "number"] }, "wind_speed_ms": { "description": "units: m/s", "type": ["null", "number"] } }, "required": ["forecast_hour", "model", "retrieved_at", "source", "station", "valid_at"], "title": "schema.forecast.iem_mos.v1", "type": "object", "version": "v1" };
149
149
  function validate21(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
150
150
  ;
151
151
  let vErrors = null;
@@ -167,8 +167,8 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
167
167
  }
168
168
  errors++;
169
169
  }
170
- if (data.issued_at === void 0) {
171
- const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "issued_at" }, message: "must have required property 'issued_at'" };
170
+ if (data.model === void 0) {
171
+ const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "model" }, message: "must have required property 'model'" };
172
172
  if (vErrors === null) {
173
173
  vErrors = [err1];
174
174
  } else {
@@ -176,8 +176,8 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
176
176
  }
177
177
  errors++;
178
178
  }
179
- if (data.model === void 0) {
180
- const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "model" }, message: "must have required property 'model'" };
179
+ if (data.retrieved_at === void 0) {
180
+ const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "retrieved_at" }, message: "must have required property 'retrieved_at'" };
181
181
  if (vErrors === null) {
182
182
  vErrors = [err2];
183
183
  } else {
@@ -185,8 +185,8 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
185
185
  }
186
186
  errors++;
187
187
  }
188
- if (data.station === void 0) {
189
- const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "station" }, message: "must have required property 'station'" };
188
+ if (data.source === void 0) {
189
+ const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "source" }, message: "must have required property 'source'" };
190
190
  if (vErrors === null) {
191
191
  vErrors = [err3];
192
192
  } else {
@@ -194,8 +194,8 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
194
194
  }
195
195
  errors++;
196
196
  }
197
- if (data.valid_at === void 0) {
198
- const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "valid_at" }, message: "must have required property 'valid_at'" };
197
+ if (data.station === void 0) {
198
+ const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "station" }, message: "must have required property 'station'" };
199
199
  if (vErrors === null) {
200
200
  vErrors = [err4];
201
201
  } else {
@@ -203,22 +203,409 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
203
203
  }
204
204
  errors++;
205
205
  }
206
- if (data.dew_point_c !== void 0) {
207
- let data0 = data.dew_point_c;
206
+ if (data.valid_at === void 0) {
207
+ const err5 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "valid_at" }, message: "must have required property 'valid_at'" };
208
+ if (vErrors === null) {
209
+ vErrors = [err5];
210
+ } else {
211
+ vErrors.push(err5);
212
+ }
213
+ errors++;
214
+ }
215
+ if (data.apparent_temp_c !== void 0) {
216
+ let data0 = data.apparent_temp_c;
208
217
  if (data0 !== null && !(typeof data0 == "number")) {
209
- const err5 = { instancePath: instancePath + "/dew_point_c", schemaPath: "#/properties/dew_point_c/type", keyword: "type", params: { type: schema32.properties.dew_point_c.type }, message: "must be null,number" };
218
+ const err6 = { instancePath: instancePath + "/apparent_temp_c", schemaPath: "#/properties/apparent_temp_c/type", keyword: "type", params: { type: schema32.properties.apparent_temp_c.type }, message: "must be null,number" };
210
219
  if (vErrors === null) {
211
- vErrors = [err5];
220
+ vErrors = [err6];
212
221
  } else {
213
- vErrors.push(err5);
222
+ vErrors.push(err6);
223
+ }
224
+ errors++;
225
+ }
226
+ }
227
+ if (data.cape_jkg !== void 0) {
228
+ let data1 = data.cape_jkg;
229
+ if (data1 !== null && !(typeof data1 == "number")) {
230
+ const err7 = { instancePath: instancePath + "/cape_jkg", schemaPath: "#/properties/cape_jkg/type", keyword: "type", params: { type: schema32.properties.cape_jkg.type }, message: "must be null,number" };
231
+ if (vErrors === null) {
232
+ vErrors = [err7];
233
+ } else {
234
+ vErrors.push(err7);
235
+ }
236
+ errors++;
237
+ }
238
+ }
239
+ if (data.cloud_cover_pct !== void 0) {
240
+ let data2 = data.cloud_cover_pct;
241
+ if (!(typeof data2 == "number" && (!(data2 % 1) && !isNaN(data2))) && data2 !== null) {
242
+ const err8 = { instancePath: instancePath + "/cloud_cover_pct", schemaPath: "#/properties/cloud_cover_pct/type", keyword: "type", params: { type: schema32.properties.cloud_cover_pct.type }, message: "must be integer,null" };
243
+ if (vErrors === null) {
244
+ vErrors = [err8];
245
+ } else {
246
+ vErrors.push(err8);
247
+ }
248
+ errors++;
249
+ }
250
+ }
251
+ if (data.dew_point_c !== void 0) {
252
+ let data3 = data.dew_point_c;
253
+ if (data3 !== null && !(typeof data3 == "number")) {
254
+ const err9 = { instancePath: instancePath + "/dew_point_c", schemaPath: "#/properties/dew_point_c/type", keyword: "type", params: { type: schema32.properties.dew_point_c.type }, message: "must be null,number" };
255
+ if (vErrors === null) {
256
+ vErrors = [err9];
257
+ } else {
258
+ vErrors.push(err9);
259
+ }
260
+ errors++;
261
+ }
262
+ }
263
+ if (data.direct_radiation_wm2 !== void 0) {
264
+ let data4 = data.direct_radiation_wm2;
265
+ if (data4 !== null && !(typeof data4 == "number")) {
266
+ const err10 = { instancePath: instancePath + "/direct_radiation_wm2", schemaPath: "#/properties/direct_radiation_wm2/type", keyword: "type", params: { type: schema32.properties.direct_radiation_wm2.type }, message: "must be null,number" };
267
+ if (vErrors === null) {
268
+ vErrors = [err10];
269
+ } else {
270
+ vErrors.push(err10);
214
271
  }
215
272
  errors++;
216
273
  }
217
274
  }
218
275
  if (data.forecast_hour !== void 0) {
219
- let data1 = data.forecast_hour;
220
- if (!(typeof data1 == "number" && (!(data1 % 1) && !isNaN(data1)))) {
221
- const err6 = { instancePath: instancePath + "/forecast_hour", schemaPath: "#/properties/forecast_hour/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
276
+ let data5 = data.forecast_hour;
277
+ if (!(typeof data5 == "number" && (!(data5 % 1) && !isNaN(data5)))) {
278
+ const err11 = { instancePath: instancePath + "/forecast_hour", schemaPath: "#/properties/forecast_hour/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
279
+ if (vErrors === null) {
280
+ vErrors = [err11];
281
+ } else {
282
+ vErrors.push(err11);
283
+ }
284
+ errors++;
285
+ }
286
+ }
287
+ if (data.freezing_level_m !== void 0) {
288
+ let data6 = data.freezing_level_m;
289
+ if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6))) && data6 !== null) {
290
+ const err12 = { instancePath: instancePath + "/freezing_level_m", schemaPath: "#/properties/freezing_level_m/type", keyword: "type", params: { type: schema32.properties.freezing_level_m.type }, message: "must be integer,null" };
291
+ if (vErrors === null) {
292
+ vErrors = [err12];
293
+ } else {
294
+ vErrors.push(err12);
295
+ }
296
+ errors++;
297
+ }
298
+ }
299
+ if (data.issued_at !== void 0) {
300
+ let data7 = data.issued_at;
301
+ if (data7 !== null && typeof data7 !== "string") {
302
+ const err13 = { instancePath: instancePath + "/issued_at", schemaPath: "#/properties/issued_at/type", keyword: "type", params: { type: schema32.properties.issued_at.type }, message: "must be null,string" };
303
+ if (vErrors === null) {
304
+ vErrors = [err13];
305
+ } else {
306
+ vErrors.push(err13);
307
+ }
308
+ errors++;
309
+ }
310
+ }
311
+ if (data.model !== void 0) {
312
+ if (typeof data.model !== "string") {
313
+ const err14 = { instancePath: instancePath + "/model", schemaPath: "#/properties/model/type", keyword: "type", params: { type: "string" }, message: "must be string" };
314
+ if (vErrors === null) {
315
+ vErrors = [err14];
316
+ } else {
317
+ vErrors.push(err14);
318
+ }
319
+ errors++;
320
+ }
321
+ }
322
+ if (data.precip_probability !== void 0) {
323
+ let data9 = data.precip_probability;
324
+ if (data9 !== null && !(typeof data9 == "number")) {
325
+ const err15 = { instancePath: instancePath + "/precip_probability", schemaPath: "#/properties/precip_probability/type", keyword: "type", params: { type: schema32.properties.precip_probability.type }, message: "must be null,number" };
326
+ if (vErrors === null) {
327
+ vErrors = [err15];
328
+ } else {
329
+ vErrors.push(err15);
330
+ }
331
+ errors++;
332
+ }
333
+ }
334
+ if (data.precipitation_mm !== void 0) {
335
+ let data10 = data.precipitation_mm;
336
+ if (data10 !== null && !(typeof data10 == "number")) {
337
+ const err16 = { instancePath: instancePath + "/precipitation_mm", schemaPath: "#/properties/precipitation_mm/type", keyword: "type", params: { type: schema32.properties.precipitation_mm.type }, message: "must be null,number" };
338
+ if (vErrors === null) {
339
+ vErrors = [err16];
340
+ } else {
341
+ vErrors.push(err16);
342
+ }
343
+ errors++;
344
+ }
345
+ }
346
+ if (data.pressure_msl_hpa !== void 0) {
347
+ let data11 = data.pressure_msl_hpa;
348
+ if (data11 !== null && !(typeof data11 == "number")) {
349
+ const err17 = { instancePath: instancePath + "/pressure_msl_hpa", schemaPath: "#/properties/pressure_msl_hpa/type", keyword: "type", params: { type: schema32.properties.pressure_msl_hpa.type }, message: "must be null,number" };
350
+ if (vErrors === null) {
351
+ vErrors = [err17];
352
+ } else {
353
+ vErrors.push(err17);
354
+ }
355
+ errors++;
356
+ }
357
+ }
358
+ if (data.retrieved_at !== void 0) {
359
+ if (!(typeof data.retrieved_at === "string")) {
360
+ const err18 = { instancePath: instancePath + "/retrieved_at", schemaPath: "#/properties/retrieved_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
361
+ if (vErrors === null) {
362
+ vErrors = [err18];
363
+ } else {
364
+ vErrors.push(err18);
365
+ }
366
+ errors++;
367
+ }
368
+ }
369
+ if (data.shortwave_radiation_wm2 !== void 0) {
370
+ let data13 = data.shortwave_radiation_wm2;
371
+ if (data13 !== null && !(typeof data13 == "number")) {
372
+ const err19 = { instancePath: instancePath + "/shortwave_radiation_wm2", schemaPath: "#/properties/shortwave_radiation_wm2/type", keyword: "type", params: { type: schema32.properties.shortwave_radiation_wm2.type }, message: "must be null,number" };
373
+ if (vErrors === null) {
374
+ vErrors = [err19];
375
+ } else {
376
+ vErrors.push(err19);
377
+ }
378
+ errors++;
379
+ }
380
+ }
381
+ if (data.sky_cover_pct !== void 0) {
382
+ let data14 = data.sky_cover_pct;
383
+ if (!(typeof data14 == "number" && (!(data14 % 1) && !isNaN(data14))) && data14 !== null) {
384
+ const err20 = { instancePath: instancePath + "/sky_cover_pct", schemaPath: "#/properties/sky_cover_pct/type", keyword: "type", params: { type: schema32.properties.sky_cover_pct.type }, message: "must be integer,null" };
385
+ if (vErrors === null) {
386
+ vErrors = [err20];
387
+ } else {
388
+ vErrors.push(err20);
389
+ }
390
+ errors++;
391
+ }
392
+ }
393
+ if (data.snow_depth_m !== void 0) {
394
+ let data15 = data.snow_depth_m;
395
+ if (data15 !== null && !(typeof data15 == "number")) {
396
+ const err21 = { instancePath: instancePath + "/snow_depth_m", schemaPath: "#/properties/snow_depth_m/type", keyword: "type", params: { type: schema32.properties.snow_depth_m.type }, message: "must be null,number" };
397
+ if (vErrors === null) {
398
+ vErrors = [err21];
399
+ } else {
400
+ vErrors.push(err21);
401
+ }
402
+ errors++;
403
+ }
404
+ }
405
+ if (data.source !== void 0) {
406
+ if (typeof data.source !== "string") {
407
+ const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/type", keyword: "type", params: { type: "string" }, message: "must be string" };
408
+ if (vErrors === null) {
409
+ vErrors = [err22];
410
+ } else {
411
+ vErrors.push(err22);
412
+ }
413
+ errors++;
414
+ }
415
+ }
416
+ if (data.station !== void 0) {
417
+ if (typeof data.station !== "string") {
418
+ const err23 = { instancePath: instancePath + "/station", schemaPath: "#/properties/station/type", keyword: "type", params: { type: "string" }, message: "must be string" };
419
+ if (vErrors === null) {
420
+ vErrors = [err23];
421
+ } else {
422
+ vErrors.push(err23);
423
+ }
424
+ errors++;
425
+ }
426
+ }
427
+ if (data.surface_pressure_hpa !== void 0) {
428
+ let data18 = data.surface_pressure_hpa;
429
+ if (data18 !== null && !(typeof data18 == "number")) {
430
+ const err24 = { instancePath: instancePath + "/surface_pressure_hpa", schemaPath: "#/properties/surface_pressure_hpa/type", keyword: "type", params: { type: schema32.properties.surface_pressure_hpa.type }, message: "must be null,number" };
431
+ if (vErrors === null) {
432
+ vErrors = [err24];
433
+ } else {
434
+ vErrors.push(err24);
435
+ }
436
+ errors++;
437
+ }
438
+ }
439
+ if (data.temp_c !== void 0) {
440
+ let data19 = data.temp_c;
441
+ if (data19 !== null && !(typeof data19 == "number")) {
442
+ const err25 = { instancePath: instancePath + "/temp_c", schemaPath: "#/properties/temp_c/type", keyword: "type", params: { type: schema32.properties.temp_c.type }, message: "must be null,number" };
443
+ if (vErrors === null) {
444
+ vErrors = [err25];
445
+ } else {
446
+ vErrors.push(err25);
447
+ }
448
+ errors++;
449
+ }
450
+ }
451
+ if (data.valid_at !== void 0) {
452
+ if (!(typeof data.valid_at === "string")) {
453
+ const err26 = { instancePath: instancePath + "/valid_at", schemaPath: "#/properties/valid_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
454
+ if (vErrors === null) {
455
+ vErrors = [err26];
456
+ } else {
457
+ vErrors.push(err26);
458
+ }
459
+ errors++;
460
+ }
461
+ }
462
+ if (data.visibility_m !== void 0) {
463
+ let data21 = data.visibility_m;
464
+ if (!(typeof data21 == "number" && (!(data21 % 1) && !isNaN(data21))) && data21 !== null) {
465
+ const err27 = { instancePath: instancePath + "/visibility_m", schemaPath: "#/properties/visibility_m/type", keyword: "type", params: { type: schema32.properties.visibility_m.type }, message: "must be integer,null" };
466
+ if (vErrors === null) {
467
+ vErrors = [err27];
468
+ } else {
469
+ vErrors.push(err27);
470
+ }
471
+ errors++;
472
+ }
473
+ }
474
+ if (data.weather_code !== void 0) {
475
+ let data22 = data.weather_code;
476
+ if (!(typeof data22 == "number" && (!(data22 % 1) && !isNaN(data22))) && data22 !== null) {
477
+ const err28 = { instancePath: instancePath + "/weather_code", schemaPath: "#/properties/weather_code/type", keyword: "type", params: { type: schema32.properties.weather_code.type }, message: "must be integer,null" };
478
+ if (vErrors === null) {
479
+ vErrors = [err28];
480
+ } else {
481
+ vErrors.push(err28);
482
+ }
483
+ errors++;
484
+ }
485
+ }
486
+ if (data.wind_dir_deg !== void 0) {
487
+ let data23 = data.wind_dir_deg;
488
+ if (!(typeof data23 == "number" && (!(data23 % 1) && !isNaN(data23))) && data23 !== null) {
489
+ const err29 = { instancePath: instancePath + "/wind_dir_deg", schemaPath: "#/properties/wind_dir_deg/type", keyword: "type", params: { type: schema32.properties.wind_dir_deg.type }, message: "must be integer,null" };
490
+ if (vErrors === null) {
491
+ vErrors = [err29];
492
+ } else {
493
+ vErrors.push(err29);
494
+ }
495
+ errors++;
496
+ }
497
+ }
498
+ if (data.wind_gusts_ms !== void 0) {
499
+ let data24 = data.wind_gusts_ms;
500
+ if (data24 !== null && !(typeof data24 == "number")) {
501
+ const err30 = { instancePath: instancePath + "/wind_gusts_ms", schemaPath: "#/properties/wind_gusts_ms/type", keyword: "type", params: { type: schema32.properties.wind_gusts_ms.type }, message: "must be null,number" };
502
+ if (vErrors === null) {
503
+ vErrors = [err30];
504
+ } else {
505
+ vErrors.push(err30);
506
+ }
507
+ errors++;
508
+ }
509
+ }
510
+ if (data.wind_speed_ms !== void 0) {
511
+ let data25 = data.wind_speed_ms;
512
+ if (data25 !== null && !(typeof data25 == "number")) {
513
+ const err31 = { instancePath: instancePath + "/wind_speed_ms", schemaPath: "#/properties/wind_speed_ms/type", keyword: "type", params: { type: schema32.properties.wind_speed_ms.type }, message: "must be null,number" };
514
+ if (vErrors === null) {
515
+ vErrors = [err31];
516
+ } else {
517
+ vErrors.push(err31);
518
+ }
519
+ errors++;
520
+ }
521
+ }
522
+ } else {
523
+ const err32 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
524
+ if (vErrors === null) {
525
+ vErrors = [err32];
526
+ } else {
527
+ vErrors.push(err32);
528
+ }
529
+ errors++;
530
+ }
531
+ validate21.errors = vErrors;
532
+ return errors === 0;
533
+ }
534
+ validate21.evaluated = { "props": { "apparent_temp_c": true, "cape_jkg": true, "cloud_cover_pct": true, "dew_point_c": true, "direct_radiation_wm2": true, "forecast_hour": true, "freezing_level_m": true, "issued_at": true, "model": true, "precip_probability": true, "precipitation_mm": true, "pressure_msl_hpa": true, "retrieved_at": true, "shortwave_radiation_wm2": true, "sky_cover_pct": true, "snow_depth_m": true, "source": true, "station": true, "surface_pressure_hpa": true, "temp_c": true, "valid_at": true, "visibility_m": true, "weather_code": true, "wind_dir_deg": true, "wind_gusts_ms": true, "wind_speed_ms": true }, "dynamicProps": false, "dynamicItems": false };
535
+
536
+ // src/schemas/validators/schema_forecast_station_v1.js
537
+ var schema_forecast_station_v1 = validate22;
538
+ var schema33 = { "$id": "https://mostlyright.dev/schemas/schema.forecast.station.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "imperialRenames": { "apparent_temp_c": "apparent_temp_F", "dew_point_c": "dew_point_F", "temp_c": "temp_F", "wind_gusts_ms": "wind_gusts_kt", "wind_speed_ms": "wind_speed_kt" }, "properties": { "apparent_temp_c": { "description": "units: celsius", "type": ["null", "number"] }, "cape_jkg": { "description": "units: J/kg", "type": ["null", "number"] }, "cloud_cover_pct": { "description": "units: percent", "type": ["integer", "null"] }, "dew_point_c": { "description": "units: celsius", "type": ["null", "number"] }, "direct_radiation_wm2": { "description": "units: W/m^2", "type": ["null", "number"] }, "forecast_hour": { "description": "units: hours \u2014 (valid_at - issued_at).total_seconds() / 3600", "type": "integer" }, "freezing_level_m": { "description": "units: meters", "type": ["integer", "null"] }, "issued_at": { "description": "model run time (knowledge_time). Nullable to accommodate Phase 20 open_meteo.seamless rows whose cycle is unrecoverable from the response. LeakageDetector + assert_issued_at_populated() are the runtime gates that reject null issued_at in training-data paths.", "format": "date-time", "type": ["null", "string"] }, "model": { "description": "e.g. NBE, GFS, LAV, MET, gfs_global, ecmwf_ifs025", "type": "string" }, "precip_probability": { "description": "units: probability \u2014 bounded [0, 1]", "type": ["null", "number"] }, "precipitation_mm": { "description": "units: mm", "type": ["null", "number"] }, "pressure_msl_hpa": { "description": "units: hPa", "type": ["null", "number"] }, "retrieved_at": { "description": "wall-clock time the row was fetched from upstream", "format": "date-time", "type": "string" }, "shortwave_radiation_wm2": { "description": "units: W/m^2", "type": ["null", "number"] }, "sky_cover_pct": { "description": "units: percent \u2014 bounded [0, 100]", "type": ["integer", "null"] }, "snow_depth_m": { "description": "units: meters", "type": ["null", "number"] }, "source": { "description": "iem.archive | open_meteo.previous_runs | open_meteo.single_run | open_meteo.live", "type": "string" }, "station": { "type": "string" }, "surface_pressure_hpa": { "description": "units: hPa", "type": ["null", "number"] }, "temp_c": { "description": "units: celsius", "type": ["null", "number"] }, "valid_at": { "description": "forecast target time (event_time)", "format": "date-time", "type": "string" }, "visibility_m": { "description": "units: meters", "type": ["integer", "null"] }, "weather_code": { "description": "units: WMO 4677 \u2014 WMO weather code (clear, fog, rain, snow, etc.)", "type": ["integer", "null"] }, "wind_dir_deg": { "description": "units: degrees", "type": ["integer", "null"] }, "wind_gusts_ms": { "description": "units: m/s", "type": ["null", "number"] }, "wind_speed_ms": { "description": "units: m/s", "type": ["null", "number"] } }, "required": ["forecast_hour", "model", "retrieved_at", "source", "station", "valid_at"], "title": "schema.forecast.station.v1", "type": "object", "version": "v1" };
539
+ function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
540
+ ;
541
+ let vErrors = null;
542
+ let errors = 0;
543
+ const evaluated0 = validate22.evaluated;
544
+ if (evaluated0.dynamicProps) {
545
+ evaluated0.props = void 0;
546
+ }
547
+ if (evaluated0.dynamicItems) {
548
+ evaluated0.items = void 0;
549
+ }
550
+ if (data && typeof data == "object" && !Array.isArray(data)) {
551
+ if (data.forecast_hour === void 0) {
552
+ const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "forecast_hour" }, message: "must have required property 'forecast_hour'" };
553
+ if (vErrors === null) {
554
+ vErrors = [err0];
555
+ } else {
556
+ vErrors.push(err0);
557
+ }
558
+ errors++;
559
+ }
560
+ if (data.model === void 0) {
561
+ const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "model" }, message: "must have required property 'model'" };
562
+ if (vErrors === null) {
563
+ vErrors = [err1];
564
+ } else {
565
+ vErrors.push(err1);
566
+ }
567
+ errors++;
568
+ }
569
+ if (data.retrieved_at === void 0) {
570
+ const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "retrieved_at" }, message: "must have required property 'retrieved_at'" };
571
+ if (vErrors === null) {
572
+ vErrors = [err2];
573
+ } else {
574
+ vErrors.push(err2);
575
+ }
576
+ errors++;
577
+ }
578
+ if (data.source === void 0) {
579
+ const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "source" }, message: "must have required property 'source'" };
580
+ if (vErrors === null) {
581
+ vErrors = [err3];
582
+ } else {
583
+ vErrors.push(err3);
584
+ }
585
+ errors++;
586
+ }
587
+ if (data.station === void 0) {
588
+ const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "station" }, message: "must have required property 'station'" };
589
+ if (vErrors === null) {
590
+ vErrors = [err4];
591
+ } else {
592
+ vErrors.push(err4);
593
+ }
594
+ errors++;
595
+ }
596
+ if (data.valid_at === void 0) {
597
+ const err5 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "valid_at" }, message: "must have required property 'valid_at'" };
598
+ if (vErrors === null) {
599
+ vErrors = [err5];
600
+ } else {
601
+ vErrors.push(err5);
602
+ }
603
+ errors++;
604
+ }
605
+ if (data.apparent_temp_c !== void 0) {
606
+ let data0 = data.apparent_temp_c;
607
+ if (data0 !== null && !(typeof data0 == "number")) {
608
+ const err6 = { instancePath: instancePath + "/apparent_temp_c", schemaPath: "#/properties/apparent_temp_c/type", keyword: "type", params: { type: schema33.properties.apparent_temp_c.type }, message: "must be null,number" };
222
609
  if (vErrors === null) {
223
610
  vErrors = [err6];
224
611
  } else {
@@ -227,9 +614,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
227
614
  errors++;
228
615
  }
229
616
  }
230
- if (data.issued_at !== void 0) {
231
- if (!(typeof data.issued_at === "string")) {
232
- const err7 = { instancePath: instancePath + "/issued_at", schemaPath: "#/properties/issued_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
617
+ if (data.cape_jkg !== void 0) {
618
+ let data1 = data.cape_jkg;
619
+ if (data1 !== null && !(typeof data1 == "number")) {
620
+ const err7 = { instancePath: instancePath + "/cape_jkg", schemaPath: "#/properties/cape_jkg/type", keyword: "type", params: { type: schema33.properties.cape_jkg.type }, message: "must be null,number" };
233
621
  if (vErrors === null) {
234
622
  vErrors = [err7];
235
623
  } else {
@@ -238,9 +626,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
238
626
  errors++;
239
627
  }
240
628
  }
241
- if (data.model !== void 0) {
242
- if (typeof data.model !== "string") {
243
- const err8 = { instancePath: instancePath + "/model", schemaPath: "#/properties/model/type", keyword: "type", params: { type: "string" }, message: "must be string" };
629
+ if (data.cloud_cover_pct !== void 0) {
630
+ let data2 = data.cloud_cover_pct;
631
+ if (!(typeof data2 == "number" && (!(data2 % 1) && !isNaN(data2))) && data2 !== null) {
632
+ const err8 = { instancePath: instancePath + "/cloud_cover_pct", schemaPath: "#/properties/cloud_cover_pct/type", keyword: "type", params: { type: schema33.properties.cloud_cover_pct.type }, message: "must be integer,null" };
244
633
  if (vErrors === null) {
245
634
  vErrors = [err8];
246
635
  } else {
@@ -249,10 +638,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
249
638
  errors++;
250
639
  }
251
640
  }
252
- if (data.precip_probability !== void 0) {
253
- let data4 = data.precip_probability;
254
- if (data4 !== null && !(typeof data4 == "number")) {
255
- const err9 = { instancePath: instancePath + "/precip_probability", schemaPath: "#/properties/precip_probability/type", keyword: "type", params: { type: schema32.properties.precip_probability.type }, message: "must be null,number" };
641
+ if (data.dew_point_c !== void 0) {
642
+ let data3 = data.dew_point_c;
643
+ if (data3 !== null && !(typeof data3 == "number")) {
644
+ const err9 = { instancePath: instancePath + "/dew_point_c", schemaPath: "#/properties/dew_point_c/type", keyword: "type", params: { type: schema33.properties.dew_point_c.type }, message: "must be null,number" };
256
645
  if (vErrors === null) {
257
646
  vErrors = [err9];
258
647
  } else {
@@ -261,10 +650,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
261
650
  errors++;
262
651
  }
263
652
  }
264
- if (data.sky_cover_pct !== void 0) {
265
- let data5 = data.sky_cover_pct;
266
- if (!(typeof data5 == "number" && (!(data5 % 1) && !isNaN(data5))) && data5 !== null) {
267
- const err10 = { instancePath: instancePath + "/sky_cover_pct", schemaPath: "#/properties/sky_cover_pct/type", keyword: "type", params: { type: schema32.properties.sky_cover_pct.type }, message: "must be integer,null" };
653
+ if (data.direct_radiation_wm2 !== void 0) {
654
+ let data4 = data.direct_radiation_wm2;
655
+ if (data4 !== null && !(typeof data4 == "number")) {
656
+ const err10 = { instancePath: instancePath + "/direct_radiation_wm2", schemaPath: "#/properties/direct_radiation_wm2/type", keyword: "type", params: { type: schema33.properties.direct_radiation_wm2.type }, message: "must be null,number" };
268
657
  if (vErrors === null) {
269
658
  vErrors = [err10];
270
659
  } else {
@@ -273,9 +662,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
273
662
  errors++;
274
663
  }
275
664
  }
276
- if (data.station !== void 0) {
277
- if (typeof data.station !== "string") {
278
- const err11 = { instancePath: instancePath + "/station", schemaPath: "#/properties/station/type", keyword: "type", params: { type: "string" }, message: "must be string" };
665
+ if (data.forecast_hour !== void 0) {
666
+ let data5 = data.forecast_hour;
667
+ if (!(typeof data5 == "number" && (!(data5 % 1) && !isNaN(data5)))) {
668
+ const err11 = { instancePath: instancePath + "/forecast_hour", schemaPath: "#/properties/forecast_hour/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
279
669
  if (vErrors === null) {
280
670
  vErrors = [err11];
281
671
  } else {
@@ -284,10 +674,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
284
674
  errors++;
285
675
  }
286
676
  }
287
- if (data.temp_c !== void 0) {
288
- let data7 = data.temp_c;
289
- if (data7 !== null && !(typeof data7 == "number")) {
290
- const err12 = { instancePath: instancePath + "/temp_c", schemaPath: "#/properties/temp_c/type", keyword: "type", params: { type: schema32.properties.temp_c.type }, message: "must be null,number" };
677
+ if (data.freezing_level_m !== void 0) {
678
+ let data6 = data.freezing_level_m;
679
+ if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6))) && data6 !== null) {
680
+ const err12 = { instancePath: instancePath + "/freezing_level_m", schemaPath: "#/properties/freezing_level_m/type", keyword: "type", params: { type: schema33.properties.freezing_level_m.type }, message: "must be integer,null" };
291
681
  if (vErrors === null) {
292
682
  vErrors = [err12];
293
683
  } else {
@@ -296,9 +686,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
296
686
  errors++;
297
687
  }
298
688
  }
299
- if (data.valid_at !== void 0) {
300
- if (!(typeof data.valid_at === "string")) {
301
- const err13 = { instancePath: instancePath + "/valid_at", schemaPath: "#/properties/valid_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
689
+ if (data.issued_at !== void 0) {
690
+ let data7 = data.issued_at;
691
+ if (data7 !== null && typeof data7 !== "string") {
692
+ const err13 = { instancePath: instancePath + "/issued_at", schemaPath: "#/properties/issued_at/type", keyword: "type", params: { type: schema33.properties.issued_at.type }, message: "must be null,string" };
302
693
  if (vErrors === null) {
303
694
  vErrors = [err13];
304
695
  } else {
@@ -307,10 +698,9 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
307
698
  errors++;
308
699
  }
309
700
  }
310
- if (data.wind_dir_deg !== void 0) {
311
- let data9 = data.wind_dir_deg;
312
- if (!(typeof data9 == "number" && (!(data9 % 1) && !isNaN(data9))) && data9 !== null) {
313
- const err14 = { instancePath: instancePath + "/wind_dir_deg", schemaPath: "#/properties/wind_dir_deg/type", keyword: "type", params: { type: schema32.properties.wind_dir_deg.type }, message: "must be integer,null" };
701
+ if (data.model !== void 0) {
702
+ if (typeof data.model !== "string") {
703
+ const err14 = { instancePath: instancePath + "/model", schemaPath: "#/properties/model/type", keyword: "type", params: { type: "string" }, message: "must be string" };
314
704
  if (vErrors === null) {
315
705
  vErrors = [err14];
316
706
  } else {
@@ -319,10 +709,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
319
709
  errors++;
320
710
  }
321
711
  }
322
- if (data.wind_speed_ms !== void 0) {
323
- let data10 = data.wind_speed_ms;
324
- if (data10 !== null && !(typeof data10 == "number")) {
325
- const err15 = { instancePath: instancePath + "/wind_speed_ms", schemaPath: "#/properties/wind_speed_ms/type", keyword: "type", params: { type: schema32.properties.wind_speed_ms.type }, message: "must be null,number" };
712
+ if (data.precip_probability !== void 0) {
713
+ let data9 = data.precip_probability;
714
+ if (data9 !== null && !(typeof data9 == "number")) {
715
+ const err15 = { instancePath: instancePath + "/precip_probability", schemaPath: "#/properties/precip_probability/type", keyword: "type", params: { type: schema33.properties.precip_probability.type }, message: "must be null,number" };
326
716
  if (vErrors === null) {
327
717
  vErrors = [err15];
328
718
  } else {
@@ -331,28 +721,216 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
331
721
  errors++;
332
722
  }
333
723
  }
724
+ if (data.precipitation_mm !== void 0) {
725
+ let data10 = data.precipitation_mm;
726
+ if (data10 !== null && !(typeof data10 == "number")) {
727
+ const err16 = { instancePath: instancePath + "/precipitation_mm", schemaPath: "#/properties/precipitation_mm/type", keyword: "type", params: { type: schema33.properties.precipitation_mm.type }, message: "must be null,number" };
728
+ if (vErrors === null) {
729
+ vErrors = [err16];
730
+ } else {
731
+ vErrors.push(err16);
732
+ }
733
+ errors++;
734
+ }
735
+ }
736
+ if (data.pressure_msl_hpa !== void 0) {
737
+ let data11 = data.pressure_msl_hpa;
738
+ if (data11 !== null && !(typeof data11 == "number")) {
739
+ const err17 = { instancePath: instancePath + "/pressure_msl_hpa", schemaPath: "#/properties/pressure_msl_hpa/type", keyword: "type", params: { type: schema33.properties.pressure_msl_hpa.type }, message: "must be null,number" };
740
+ if (vErrors === null) {
741
+ vErrors = [err17];
742
+ } else {
743
+ vErrors.push(err17);
744
+ }
745
+ errors++;
746
+ }
747
+ }
748
+ if (data.retrieved_at !== void 0) {
749
+ if (!(typeof data.retrieved_at === "string")) {
750
+ const err18 = { instancePath: instancePath + "/retrieved_at", schemaPath: "#/properties/retrieved_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
751
+ if (vErrors === null) {
752
+ vErrors = [err18];
753
+ } else {
754
+ vErrors.push(err18);
755
+ }
756
+ errors++;
757
+ }
758
+ }
759
+ if (data.shortwave_radiation_wm2 !== void 0) {
760
+ let data13 = data.shortwave_radiation_wm2;
761
+ if (data13 !== null && !(typeof data13 == "number")) {
762
+ const err19 = { instancePath: instancePath + "/shortwave_radiation_wm2", schemaPath: "#/properties/shortwave_radiation_wm2/type", keyword: "type", params: { type: schema33.properties.shortwave_radiation_wm2.type }, message: "must be null,number" };
763
+ if (vErrors === null) {
764
+ vErrors = [err19];
765
+ } else {
766
+ vErrors.push(err19);
767
+ }
768
+ errors++;
769
+ }
770
+ }
771
+ if (data.sky_cover_pct !== void 0) {
772
+ let data14 = data.sky_cover_pct;
773
+ if (!(typeof data14 == "number" && (!(data14 % 1) && !isNaN(data14))) && data14 !== null) {
774
+ const err20 = { instancePath: instancePath + "/sky_cover_pct", schemaPath: "#/properties/sky_cover_pct/type", keyword: "type", params: { type: schema33.properties.sky_cover_pct.type }, message: "must be integer,null" };
775
+ if (vErrors === null) {
776
+ vErrors = [err20];
777
+ } else {
778
+ vErrors.push(err20);
779
+ }
780
+ errors++;
781
+ }
782
+ }
783
+ if (data.snow_depth_m !== void 0) {
784
+ let data15 = data.snow_depth_m;
785
+ if (data15 !== null && !(typeof data15 == "number")) {
786
+ const err21 = { instancePath: instancePath + "/snow_depth_m", schemaPath: "#/properties/snow_depth_m/type", keyword: "type", params: { type: schema33.properties.snow_depth_m.type }, message: "must be null,number" };
787
+ if (vErrors === null) {
788
+ vErrors = [err21];
789
+ } else {
790
+ vErrors.push(err21);
791
+ }
792
+ errors++;
793
+ }
794
+ }
795
+ if (data.source !== void 0) {
796
+ if (typeof data.source !== "string") {
797
+ const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/type", keyword: "type", params: { type: "string" }, message: "must be string" };
798
+ if (vErrors === null) {
799
+ vErrors = [err22];
800
+ } else {
801
+ vErrors.push(err22);
802
+ }
803
+ errors++;
804
+ }
805
+ }
806
+ if (data.station !== void 0) {
807
+ if (typeof data.station !== "string") {
808
+ const err23 = { instancePath: instancePath + "/station", schemaPath: "#/properties/station/type", keyword: "type", params: { type: "string" }, message: "must be string" };
809
+ if (vErrors === null) {
810
+ vErrors = [err23];
811
+ } else {
812
+ vErrors.push(err23);
813
+ }
814
+ errors++;
815
+ }
816
+ }
817
+ if (data.surface_pressure_hpa !== void 0) {
818
+ let data18 = data.surface_pressure_hpa;
819
+ if (data18 !== null && !(typeof data18 == "number")) {
820
+ const err24 = { instancePath: instancePath + "/surface_pressure_hpa", schemaPath: "#/properties/surface_pressure_hpa/type", keyword: "type", params: { type: schema33.properties.surface_pressure_hpa.type }, message: "must be null,number" };
821
+ if (vErrors === null) {
822
+ vErrors = [err24];
823
+ } else {
824
+ vErrors.push(err24);
825
+ }
826
+ errors++;
827
+ }
828
+ }
829
+ if (data.temp_c !== void 0) {
830
+ let data19 = data.temp_c;
831
+ if (data19 !== null && !(typeof data19 == "number")) {
832
+ const err25 = { instancePath: instancePath + "/temp_c", schemaPath: "#/properties/temp_c/type", keyword: "type", params: { type: schema33.properties.temp_c.type }, message: "must be null,number" };
833
+ if (vErrors === null) {
834
+ vErrors = [err25];
835
+ } else {
836
+ vErrors.push(err25);
837
+ }
838
+ errors++;
839
+ }
840
+ }
841
+ if (data.valid_at !== void 0) {
842
+ if (!(typeof data.valid_at === "string")) {
843
+ const err26 = { instancePath: instancePath + "/valid_at", schemaPath: "#/properties/valid_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
844
+ if (vErrors === null) {
845
+ vErrors = [err26];
846
+ } else {
847
+ vErrors.push(err26);
848
+ }
849
+ errors++;
850
+ }
851
+ }
852
+ if (data.visibility_m !== void 0) {
853
+ let data21 = data.visibility_m;
854
+ if (!(typeof data21 == "number" && (!(data21 % 1) && !isNaN(data21))) && data21 !== null) {
855
+ const err27 = { instancePath: instancePath + "/visibility_m", schemaPath: "#/properties/visibility_m/type", keyword: "type", params: { type: schema33.properties.visibility_m.type }, message: "must be integer,null" };
856
+ if (vErrors === null) {
857
+ vErrors = [err27];
858
+ } else {
859
+ vErrors.push(err27);
860
+ }
861
+ errors++;
862
+ }
863
+ }
864
+ if (data.weather_code !== void 0) {
865
+ let data22 = data.weather_code;
866
+ if (!(typeof data22 == "number" && (!(data22 % 1) && !isNaN(data22))) && data22 !== null) {
867
+ const err28 = { instancePath: instancePath + "/weather_code", schemaPath: "#/properties/weather_code/type", keyword: "type", params: { type: schema33.properties.weather_code.type }, message: "must be integer,null" };
868
+ if (vErrors === null) {
869
+ vErrors = [err28];
870
+ } else {
871
+ vErrors.push(err28);
872
+ }
873
+ errors++;
874
+ }
875
+ }
876
+ if (data.wind_dir_deg !== void 0) {
877
+ let data23 = data.wind_dir_deg;
878
+ if (!(typeof data23 == "number" && (!(data23 % 1) && !isNaN(data23))) && data23 !== null) {
879
+ const err29 = { instancePath: instancePath + "/wind_dir_deg", schemaPath: "#/properties/wind_dir_deg/type", keyword: "type", params: { type: schema33.properties.wind_dir_deg.type }, message: "must be integer,null" };
880
+ if (vErrors === null) {
881
+ vErrors = [err29];
882
+ } else {
883
+ vErrors.push(err29);
884
+ }
885
+ errors++;
886
+ }
887
+ }
888
+ if (data.wind_gusts_ms !== void 0) {
889
+ let data24 = data.wind_gusts_ms;
890
+ if (data24 !== null && !(typeof data24 == "number")) {
891
+ const err30 = { instancePath: instancePath + "/wind_gusts_ms", schemaPath: "#/properties/wind_gusts_ms/type", keyword: "type", params: { type: schema33.properties.wind_gusts_ms.type }, message: "must be null,number" };
892
+ if (vErrors === null) {
893
+ vErrors = [err30];
894
+ } else {
895
+ vErrors.push(err30);
896
+ }
897
+ errors++;
898
+ }
899
+ }
900
+ if (data.wind_speed_ms !== void 0) {
901
+ let data25 = data.wind_speed_ms;
902
+ if (data25 !== null && !(typeof data25 == "number")) {
903
+ const err31 = { instancePath: instancePath + "/wind_speed_ms", schemaPath: "#/properties/wind_speed_ms/type", keyword: "type", params: { type: schema33.properties.wind_speed_ms.type }, message: "must be null,number" };
904
+ if (vErrors === null) {
905
+ vErrors = [err31];
906
+ } else {
907
+ vErrors.push(err31);
908
+ }
909
+ errors++;
910
+ }
911
+ }
334
912
  } else {
335
- const err16 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
913
+ const err32 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
336
914
  if (vErrors === null) {
337
- vErrors = [err16];
915
+ vErrors = [err32];
338
916
  } else {
339
- vErrors.push(err16);
917
+ vErrors.push(err32);
340
918
  }
341
919
  errors++;
342
920
  }
343
- validate21.errors = vErrors;
921
+ validate22.errors = vErrors;
344
922
  return errors === 0;
345
923
  }
346
- validate21.evaluated = { "props": { "dew_point_c": true, "forecast_hour": true, "issued_at": true, "model": true, "precip_probability": true, "sky_cover_pct": true, "station": true, "temp_c": true, "valid_at": true, "wind_dir_deg": true, "wind_speed_ms": true }, "dynamicProps": false, "dynamicItems": false };
924
+ validate22.evaluated = { "props": { "apparent_temp_c": true, "cape_jkg": true, "cloud_cover_pct": true, "dew_point_c": true, "direct_radiation_wm2": true, "forecast_hour": true, "freezing_level_m": true, "issued_at": true, "model": true, "precip_probability": true, "precipitation_mm": true, "pressure_msl_hpa": true, "retrieved_at": true, "shortwave_radiation_wm2": true, "sky_cover_pct": true, "snow_depth_m": true, "source": true, "station": true, "surface_pressure_hpa": true, "temp_c": true, "valid_at": true, "visibility_m": true, "weather_code": true, "wind_dir_deg": true, "wind_gusts_ms": true, "wind_speed_ms": true }, "dynamicProps": false, "dynamicItems": false };
347
925
 
348
926
  // src/schemas/validators/schema_observation_ledger_v1.js
349
- var schema_observation_ledger_v1 = validate23;
350
- var schema34 = { "$id": "https://mostlyright.dev/schemas/schema.observation_ledger.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "as_of_time": { "format": "date-time", "type": ["null", "string"] }, "dewpoint_c": { "description": "units: celsius", "type": ["null", "number"] }, "ingestion_id": { "type": ["null", "string"] }, "observation_kind": { "enum": ["METAR", "SPECI", null], "type": ["null", "string"] }, "observation_quality": { "description": "Lineage row-quality flag per LINEAGE-01; distinct from qc_status enum slot AND distinct from the obs_qc_status bitmask column per QC-05.", "enum": ["clean", "flagged", "suspect", null], "type": ["null", "string"] }, "observation_type": { "enum": ["METAR", "SPECI"], "type": "string" }, "observed_at": { "format": "date-time", "type": "string" }, "parser_name": { "enum": ["ghcnh", "iem", "mostlyright_v1", "ncei", null], "type": ["null", "string"] }, "parser_version": { "type": ["null", "string"] }, "provenance": { "enum": ["legacy", "reingested", null], "type": ["null", "string"] }, "qc_status": { "enum": ["clean", "flagged", "suspect", null], "type": ["null", "string"] }, "source": { "description": "ncei reserved per D-2.1-09; never written in v0.1.0.", "enum": ["awc", "ghcnh", "iem", "ncei"], "type": "string" }, "source_received_at": { "type": ["null", "string"] }, "station_code": { "type": "string" }, "temp_c": { "description": "units: celsius", "type": ["null", "number"] } }, "required": ["observation_type", "observed_at", "source", "station_code"], "title": "schema.observation_ledger.v1", "type": "object", "version": "v1" };
351
- function validate23(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
927
+ var schema_observation_ledger_v1 = validate24;
928
+ var schema35 = { "$id": "https://mostlyright.dev/schemas/schema.observation_ledger.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "as_of_time": { "format": "date-time", "type": ["null", "string"] }, "dewpoint_c": { "description": "units: celsius", "type": ["null", "number"] }, "ingestion_id": { "type": ["null", "string"] }, "observation_kind": { "enum": ["METAR", "SPECI", null], "type": ["null", "string"] }, "observation_quality": { "description": "Lineage row-quality flag per LINEAGE-01; distinct from qc_status enum slot AND distinct from the obs_qc_status bitmask column per QC-05.", "enum": ["clean", "flagged", "suspect", null], "type": ["null", "string"] }, "observation_type": { "enum": ["METAR", "SPECI"], "type": "string" }, "observed_at": { "format": "date-time", "type": "string" }, "parser_name": { "enum": ["ghcnh", "iem", "mostlyright_v1", "ncei", null], "type": ["null", "string"] }, "parser_version": { "type": ["null", "string"] }, "provenance": { "enum": ["legacy", "reingested", null], "type": ["null", "string"] }, "qc_status": { "enum": ["clean", "flagged", "suspect", null], "type": ["null", "string"] }, "source": { "description": "ncei reserved per D-2.1-09; never written in v0.1.0.", "enum": ["awc", "ghcnh", "iem", "ncei"], "type": "string" }, "source_received_at": { "type": ["null", "string"] }, "station_code": { "type": "string" }, "temp_c": { "description": "units: celsius", "type": ["null", "number"] } }, "required": ["observation_type", "observed_at", "source", "station_code"], "title": "schema.observation_ledger.v1", "type": "object", "version": "v1" };
929
+ function validate24(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
352
930
  ;
353
931
  let vErrors = null;
354
932
  let errors = 0;
355
- const evaluated0 = validate23.evaluated;
933
+ const evaluated0 = validate24.evaluated;
356
934
  if (evaluated0.dynamicProps) {
357
935
  evaluated0.props = void 0;
358
936
  }
@@ -399,7 +977,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
399
977
  if (data.as_of_time !== void 0) {
400
978
  let data0 = data.as_of_time;
401
979
  if (data0 !== null && typeof data0 !== "string") {
402
- const err4 = { instancePath: instancePath + "/as_of_time", schemaPath: "#/properties/as_of_time/type", keyword: "type", params: { type: schema34.properties.as_of_time.type }, message: "must be null,string" };
980
+ const err4 = { instancePath: instancePath + "/as_of_time", schemaPath: "#/properties/as_of_time/type", keyword: "type", params: { type: schema35.properties.as_of_time.type }, message: "must be null,string" };
403
981
  if (vErrors === null) {
404
982
  vErrors = [err4];
405
983
  } else {
@@ -411,7 +989,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
411
989
  if (data.dewpoint_c !== void 0) {
412
990
  let data1 = data.dewpoint_c;
413
991
  if (data1 !== null && !(typeof data1 == "number")) {
414
- const err5 = { instancePath: instancePath + "/dewpoint_c", schemaPath: "#/properties/dewpoint_c/type", keyword: "type", params: { type: schema34.properties.dewpoint_c.type }, message: "must be null,number" };
992
+ const err5 = { instancePath: instancePath + "/dewpoint_c", schemaPath: "#/properties/dewpoint_c/type", keyword: "type", params: { type: schema35.properties.dewpoint_c.type }, message: "must be null,number" };
415
993
  if (vErrors === null) {
416
994
  vErrors = [err5];
417
995
  } else {
@@ -423,7 +1001,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
423
1001
  if (data.ingestion_id !== void 0) {
424
1002
  let data2 = data.ingestion_id;
425
1003
  if (data2 !== null && typeof data2 !== "string") {
426
- const err6 = { instancePath: instancePath + "/ingestion_id", schemaPath: "#/properties/ingestion_id/type", keyword: "type", params: { type: schema34.properties.ingestion_id.type }, message: "must be null,string" };
1004
+ const err6 = { instancePath: instancePath + "/ingestion_id", schemaPath: "#/properties/ingestion_id/type", keyword: "type", params: { type: schema35.properties.ingestion_id.type }, message: "must be null,string" };
427
1005
  if (vErrors === null) {
428
1006
  vErrors = [err6];
429
1007
  } else {
@@ -435,7 +1013,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
435
1013
  if (data.observation_kind !== void 0) {
436
1014
  let data3 = data.observation_kind;
437
1015
  if (data3 !== null && typeof data3 !== "string") {
438
- const err7 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/type", keyword: "type", params: { type: schema34.properties.observation_kind.type }, message: "must be null,string" };
1016
+ const err7 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/type", keyword: "type", params: { type: schema35.properties.observation_kind.type }, message: "must be null,string" };
439
1017
  if (vErrors === null) {
440
1018
  vErrors = [err7];
441
1019
  } else {
@@ -444,7 +1022,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
444
1022
  errors++;
445
1023
  }
446
1024
  if (!(data3 === "METAR" || data3 === "SPECI" || data3 === null)) {
447
- const err8 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/enum", keyword: "enum", params: { allowedValues: schema34.properties.observation_kind.enum }, message: "must be equal to one of the allowed values" };
1025
+ const err8 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/enum", keyword: "enum", params: { allowedValues: schema35.properties.observation_kind.enum }, message: "must be equal to one of the allowed values" };
448
1026
  if (vErrors === null) {
449
1027
  vErrors = [err8];
450
1028
  } else {
@@ -456,7 +1034,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
456
1034
  if (data.observation_quality !== void 0) {
457
1035
  let data4 = data.observation_quality;
458
1036
  if (data4 !== null && typeof data4 !== "string") {
459
- const err9 = { instancePath: instancePath + "/observation_quality", schemaPath: "#/properties/observation_quality/type", keyword: "type", params: { type: schema34.properties.observation_quality.type }, message: "must be null,string" };
1037
+ const err9 = { instancePath: instancePath + "/observation_quality", schemaPath: "#/properties/observation_quality/type", keyword: "type", params: { type: schema35.properties.observation_quality.type }, message: "must be null,string" };
460
1038
  if (vErrors === null) {
461
1039
  vErrors = [err9];
462
1040
  } else {
@@ -465,7 +1043,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
465
1043
  errors++;
466
1044
  }
467
1045
  if (!(data4 === "clean" || data4 === "flagged" || data4 === "suspect" || data4 === null)) {
468
- const err10 = { instancePath: instancePath + "/observation_quality", schemaPath: "#/properties/observation_quality/enum", keyword: "enum", params: { allowedValues: schema34.properties.observation_quality.enum }, message: "must be equal to one of the allowed values" };
1046
+ const err10 = { instancePath: instancePath + "/observation_quality", schemaPath: "#/properties/observation_quality/enum", keyword: "enum", params: { allowedValues: schema35.properties.observation_quality.enum }, message: "must be equal to one of the allowed values" };
469
1047
  if (vErrors === null) {
470
1048
  vErrors = [err10];
471
1049
  } else {
@@ -486,7 +1064,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
486
1064
  errors++;
487
1065
  }
488
1066
  if (!(data5 === "METAR" || data5 === "SPECI")) {
489
- const err12 = { instancePath: instancePath + "/observation_type", schemaPath: "#/properties/observation_type/enum", keyword: "enum", params: { allowedValues: schema34.properties.observation_type.enum }, message: "must be equal to one of the allowed values" };
1067
+ const err12 = { instancePath: instancePath + "/observation_type", schemaPath: "#/properties/observation_type/enum", keyword: "enum", params: { allowedValues: schema35.properties.observation_type.enum }, message: "must be equal to one of the allowed values" };
490
1068
  if (vErrors === null) {
491
1069
  vErrors = [err12];
492
1070
  } else {
@@ -509,7 +1087,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
509
1087
  if (data.parser_name !== void 0) {
510
1088
  let data7 = data.parser_name;
511
1089
  if (data7 !== null && typeof data7 !== "string") {
512
- const err14 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/type", keyword: "type", params: { type: schema34.properties.parser_name.type }, message: "must be null,string" };
1090
+ const err14 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/type", keyword: "type", params: { type: schema35.properties.parser_name.type }, message: "must be null,string" };
513
1091
  if (vErrors === null) {
514
1092
  vErrors = [err14];
515
1093
  } else {
@@ -518,7 +1096,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
518
1096
  errors++;
519
1097
  }
520
1098
  if (!(data7 === "ghcnh" || data7 === "iem" || data7 === "mostlyright_v1" || data7 === "ncei" || data7 === null)) {
521
- const err15 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/enum", keyword: "enum", params: { allowedValues: schema34.properties.parser_name.enum }, message: "must be equal to one of the allowed values" };
1099
+ const err15 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/enum", keyword: "enum", params: { allowedValues: schema35.properties.parser_name.enum }, message: "must be equal to one of the allowed values" };
522
1100
  if (vErrors === null) {
523
1101
  vErrors = [err15];
524
1102
  } else {
@@ -530,7 +1108,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
530
1108
  if (data.parser_version !== void 0) {
531
1109
  let data8 = data.parser_version;
532
1110
  if (data8 !== null && typeof data8 !== "string") {
533
- const err16 = { instancePath: instancePath + "/parser_version", schemaPath: "#/properties/parser_version/type", keyword: "type", params: { type: schema34.properties.parser_version.type }, message: "must be null,string" };
1111
+ const err16 = { instancePath: instancePath + "/parser_version", schemaPath: "#/properties/parser_version/type", keyword: "type", params: { type: schema35.properties.parser_version.type }, message: "must be null,string" };
534
1112
  if (vErrors === null) {
535
1113
  vErrors = [err16];
536
1114
  } else {
@@ -542,7 +1120,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
542
1120
  if (data.provenance !== void 0) {
543
1121
  let data9 = data.provenance;
544
1122
  if (data9 !== null && typeof data9 !== "string") {
545
- const err17 = { instancePath: instancePath + "/provenance", schemaPath: "#/properties/provenance/type", keyword: "type", params: { type: schema34.properties.provenance.type }, message: "must be null,string" };
1123
+ const err17 = { instancePath: instancePath + "/provenance", schemaPath: "#/properties/provenance/type", keyword: "type", params: { type: schema35.properties.provenance.type }, message: "must be null,string" };
546
1124
  if (vErrors === null) {
547
1125
  vErrors = [err17];
548
1126
  } else {
@@ -551,7 +1129,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
551
1129
  errors++;
552
1130
  }
553
1131
  if (!(data9 === "legacy" || data9 === "reingested" || data9 === null)) {
554
- const err18 = { instancePath: instancePath + "/provenance", schemaPath: "#/properties/provenance/enum", keyword: "enum", params: { allowedValues: schema34.properties.provenance.enum }, message: "must be equal to one of the allowed values" };
1132
+ const err18 = { instancePath: instancePath + "/provenance", schemaPath: "#/properties/provenance/enum", keyword: "enum", params: { allowedValues: schema35.properties.provenance.enum }, message: "must be equal to one of the allowed values" };
555
1133
  if (vErrors === null) {
556
1134
  vErrors = [err18];
557
1135
  } else {
@@ -563,7 +1141,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
563
1141
  if (data.qc_status !== void 0) {
564
1142
  let data10 = data.qc_status;
565
1143
  if (data10 !== null && typeof data10 !== "string") {
566
- const err19 = { instancePath: instancePath + "/qc_status", schemaPath: "#/properties/qc_status/type", keyword: "type", params: { type: schema34.properties.qc_status.type }, message: "must be null,string" };
1144
+ const err19 = { instancePath: instancePath + "/qc_status", schemaPath: "#/properties/qc_status/type", keyword: "type", params: { type: schema35.properties.qc_status.type }, message: "must be null,string" };
567
1145
  if (vErrors === null) {
568
1146
  vErrors = [err19];
569
1147
  } else {
@@ -572,7 +1150,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
572
1150
  errors++;
573
1151
  }
574
1152
  if (!(data10 === "clean" || data10 === "flagged" || data10 === "suspect" || data10 === null)) {
575
- const err20 = { instancePath: instancePath + "/qc_status", schemaPath: "#/properties/qc_status/enum", keyword: "enum", params: { allowedValues: schema34.properties.qc_status.enum }, message: "must be equal to one of the allowed values" };
1153
+ const err20 = { instancePath: instancePath + "/qc_status", schemaPath: "#/properties/qc_status/enum", keyword: "enum", params: { allowedValues: schema35.properties.qc_status.enum }, message: "must be equal to one of the allowed values" };
576
1154
  if (vErrors === null) {
577
1155
  vErrors = [err20];
578
1156
  } else {
@@ -593,7 +1171,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
593
1171
  errors++;
594
1172
  }
595
1173
  if (!(data11 === "awc" || data11 === "ghcnh" || data11 === "iem" || data11 === "ncei")) {
596
- const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/enum", keyword: "enum", params: { allowedValues: schema34.properties.source.enum }, message: "must be equal to one of the allowed values" };
1174
+ const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/enum", keyword: "enum", params: { allowedValues: schema35.properties.source.enum }, message: "must be equal to one of the allowed values" };
597
1175
  if (vErrors === null) {
598
1176
  vErrors = [err22];
599
1177
  } else {
@@ -605,7 +1183,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
605
1183
  if (data.source_received_at !== void 0) {
606
1184
  let data12 = data.source_received_at;
607
1185
  if (data12 !== null && typeof data12 !== "string") {
608
- const err23 = { instancePath: instancePath + "/source_received_at", schemaPath: "#/properties/source_received_at/type", keyword: "type", params: { type: schema34.properties.source_received_at.type }, message: "must be null,string" };
1186
+ const err23 = { instancePath: instancePath + "/source_received_at", schemaPath: "#/properties/source_received_at/type", keyword: "type", params: { type: schema35.properties.source_received_at.type }, message: "must be null,string" };
609
1187
  if (vErrors === null) {
610
1188
  vErrors = [err23];
611
1189
  } else {
@@ -628,7 +1206,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
628
1206
  if (data.temp_c !== void 0) {
629
1207
  let data14 = data.temp_c;
630
1208
  if (data14 !== null && !(typeof data14 == "number")) {
631
- const err25 = { instancePath: instancePath + "/temp_c", schemaPath: "#/properties/temp_c/type", keyword: "type", params: { type: schema34.properties.temp_c.type }, message: "must be null,number" };
1209
+ const err25 = { instancePath: instancePath + "/temp_c", schemaPath: "#/properties/temp_c/type", keyword: "type", params: { type: schema35.properties.temp_c.type }, message: "must be null,number" };
632
1210
  if (vErrors === null) {
633
1211
  vErrors = [err25];
634
1212
  } else {
@@ -646,19 +1224,19 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
646
1224
  }
647
1225
  errors++;
648
1226
  }
649
- validate23.errors = vErrors;
1227
+ validate24.errors = vErrors;
650
1228
  return errors === 0;
651
1229
  }
652
- validate23.evaluated = { "props": { "as_of_time": true, "dewpoint_c": true, "ingestion_id": true, "observation_kind": true, "observation_quality": true, "observation_type": true, "observed_at": true, "parser_name": true, "parser_version": true, "provenance": true, "qc_status": true, "source": true, "source_received_at": true, "station_code": true, "temp_c": true }, "dynamicProps": false, "dynamicItems": false };
1230
+ validate24.evaluated = { "props": { "as_of_time": true, "dewpoint_c": true, "ingestion_id": true, "observation_kind": true, "observation_quality": true, "observation_type": true, "observed_at": true, "parser_name": true, "parser_version": true, "provenance": true, "qc_status": true, "source": true, "source_received_at": true, "station_code": true, "temp_c": true }, "dynamicProps": false, "dynamicItems": false };
653
1231
 
654
1232
  // src/schemas/validators/schema_observation_qc_v1.js
655
- var schema_observation_qc_v1 = validate24;
656
- var schema35 = { "$id": "https://mostlyright.dev/schemas/schema.observation_qc.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "as_of_time": { "format": "date-time", "type": ["null", "string"] }, "detector_metadata": { "description": "JSON-serialized detector payload; shape per qc_system.", "type": ["null", "string"] }, "field": { "description": "Observation column the rule evaluated (e.g. temp_c).", "type": "string" }, "flag": { "enum": ["clean", "flagged", "suspect"], "type": "string" }, "ingestion_id": { "type": ["null", "string"] }, "observation_kind": { "enum": ["METAR", "SPECI", null], "type": ["null", "string"] }, "observed_at": { "format": "date-time", "type": "string" }, "parser_name": { "type": ["null", "string"] }, "qc_system": { "type": "string" }, "qc_version": { "type": "string" }, "rule_id": { "type": "string" }, "source": { "enum": ["awc", "ghcnh", "iem", "ncei"], "type": "string" }, "station_code": { "type": "string" } }, "required": ["field", "flag", "observed_at", "qc_system", "qc_version", "rule_id", "source", "station_code"], "title": "schema.observation_qc.v1", "type": "object", "version": "v1" };
657
- function validate24(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1233
+ var schema_observation_qc_v1 = validate25;
1234
+ var schema36 = { "$id": "https://mostlyright.dev/schemas/schema.observation_qc.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "as_of_time": { "format": "date-time", "type": ["null", "string"] }, "detector_metadata": { "description": "JSON-serialized detector payload; shape per qc_system.", "type": ["null", "string"] }, "field": { "description": "Observation column the rule evaluated (e.g. temp_c).", "type": "string" }, "flag": { "enum": ["clean", "flagged", "suspect"], "type": "string" }, "ingestion_id": { "type": ["null", "string"] }, "observation_kind": { "enum": ["METAR", "SPECI", null], "type": ["null", "string"] }, "observed_at": { "format": "date-time", "type": "string" }, "parser_name": { "type": ["null", "string"] }, "qc_system": { "type": "string" }, "qc_version": { "type": "string" }, "rule_id": { "type": "string" }, "source": { "enum": ["awc", "ghcnh", "iem", "ncei"], "type": "string" }, "station_code": { "type": "string" } }, "required": ["field", "flag", "observed_at", "qc_system", "qc_version", "rule_id", "source", "station_code"], "title": "schema.observation_qc.v1", "type": "object", "version": "v1" };
1235
+ function validate25(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
658
1236
  ;
659
1237
  let vErrors = null;
660
1238
  let errors = 0;
661
- const evaluated0 = validate24.evaluated;
1239
+ const evaluated0 = validate25.evaluated;
662
1240
  if (evaluated0.dynamicProps) {
663
1241
  evaluated0.props = void 0;
664
1242
  }
@@ -741,7 +1319,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
741
1319
  if (data.as_of_time !== void 0) {
742
1320
  let data0 = data.as_of_time;
743
1321
  if (data0 !== null && typeof data0 !== "string") {
744
- const err8 = { instancePath: instancePath + "/as_of_time", schemaPath: "#/properties/as_of_time/type", keyword: "type", params: { type: schema35.properties.as_of_time.type }, message: "must be null,string" };
1322
+ const err8 = { instancePath: instancePath + "/as_of_time", schemaPath: "#/properties/as_of_time/type", keyword: "type", params: { type: schema36.properties.as_of_time.type }, message: "must be null,string" };
745
1323
  if (vErrors === null) {
746
1324
  vErrors = [err8];
747
1325
  } else {
@@ -753,7 +1331,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
753
1331
  if (data.detector_metadata !== void 0) {
754
1332
  let data1 = data.detector_metadata;
755
1333
  if (data1 !== null && typeof data1 !== "string") {
756
- const err9 = { instancePath: instancePath + "/detector_metadata", schemaPath: "#/properties/detector_metadata/type", keyword: "type", params: { type: schema35.properties.detector_metadata.type }, message: "must be null,string" };
1334
+ const err9 = { instancePath: instancePath + "/detector_metadata", schemaPath: "#/properties/detector_metadata/type", keyword: "type", params: { type: schema36.properties.detector_metadata.type }, message: "must be null,string" };
757
1335
  if (vErrors === null) {
758
1336
  vErrors = [err9];
759
1337
  } else {
@@ -785,7 +1363,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
785
1363
  errors++;
786
1364
  }
787
1365
  if (!(data3 === "clean" || data3 === "flagged" || data3 === "suspect")) {
788
- const err12 = { instancePath: instancePath + "/flag", schemaPath: "#/properties/flag/enum", keyword: "enum", params: { allowedValues: schema35.properties.flag.enum }, message: "must be equal to one of the allowed values" };
1366
+ const err12 = { instancePath: instancePath + "/flag", schemaPath: "#/properties/flag/enum", keyword: "enum", params: { allowedValues: schema36.properties.flag.enum }, message: "must be equal to one of the allowed values" };
789
1367
  if (vErrors === null) {
790
1368
  vErrors = [err12];
791
1369
  } else {
@@ -797,7 +1375,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
797
1375
  if (data.ingestion_id !== void 0) {
798
1376
  let data4 = data.ingestion_id;
799
1377
  if (data4 !== null && typeof data4 !== "string") {
800
- const err13 = { instancePath: instancePath + "/ingestion_id", schemaPath: "#/properties/ingestion_id/type", keyword: "type", params: { type: schema35.properties.ingestion_id.type }, message: "must be null,string" };
1378
+ const err13 = { instancePath: instancePath + "/ingestion_id", schemaPath: "#/properties/ingestion_id/type", keyword: "type", params: { type: schema36.properties.ingestion_id.type }, message: "must be null,string" };
801
1379
  if (vErrors === null) {
802
1380
  vErrors = [err13];
803
1381
  } else {
@@ -809,7 +1387,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
809
1387
  if (data.observation_kind !== void 0) {
810
1388
  let data5 = data.observation_kind;
811
1389
  if (data5 !== null && typeof data5 !== "string") {
812
- const err14 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/type", keyword: "type", params: { type: schema35.properties.observation_kind.type }, message: "must be null,string" };
1390
+ const err14 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/type", keyword: "type", params: { type: schema36.properties.observation_kind.type }, message: "must be null,string" };
813
1391
  if (vErrors === null) {
814
1392
  vErrors = [err14];
815
1393
  } else {
@@ -818,7 +1396,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
818
1396
  errors++;
819
1397
  }
820
1398
  if (!(data5 === "METAR" || data5 === "SPECI" || data5 === null)) {
821
- const err15 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/enum", keyword: "enum", params: { allowedValues: schema35.properties.observation_kind.enum }, message: "must be equal to one of the allowed values" };
1399
+ const err15 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/enum", keyword: "enum", params: { allowedValues: schema36.properties.observation_kind.enum }, message: "must be equal to one of the allowed values" };
822
1400
  if (vErrors === null) {
823
1401
  vErrors = [err15];
824
1402
  } else {
@@ -841,7 +1419,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
841
1419
  if (data.parser_name !== void 0) {
842
1420
  let data7 = data.parser_name;
843
1421
  if (data7 !== null && typeof data7 !== "string") {
844
- const err17 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/type", keyword: "type", params: { type: schema35.properties.parser_name.type }, message: "must be null,string" };
1422
+ const err17 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/type", keyword: "type", params: { type: schema36.properties.parser_name.type }, message: "must be null,string" };
845
1423
  if (vErrors === null) {
846
1424
  vErrors = [err17];
847
1425
  } else {
@@ -895,7 +1473,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
895
1473
  errors++;
896
1474
  }
897
1475
  if (!(data11 === "awc" || data11 === "ghcnh" || data11 === "iem" || data11 === "ncei")) {
898
- const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/enum", keyword: "enum", params: { allowedValues: schema35.properties.source.enum }, message: "must be equal to one of the allowed values" };
1476
+ const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/enum", keyword: "enum", params: { allowedValues: schema36.properties.source.enum }, message: "must be equal to one of the allowed values" };
899
1477
  if (vErrors === null) {
900
1478
  vErrors = [err22];
901
1479
  } else {
@@ -924,10 +1502,10 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
924
1502
  }
925
1503
  errors++;
926
1504
  }
927
- validate24.errors = vErrors;
1505
+ validate25.errors = vErrors;
928
1506
  return errors === 0;
929
1507
  }
930
- validate24.evaluated = { "props": { "as_of_time": true, "detector_metadata": true, "field": true, "flag": true, "ingestion_id": true, "observation_kind": true, "observed_at": true, "parser_name": true, "qc_system": true, "qc_version": true, "rule_id": true, "source": true, "station_code": true }, "dynamicProps": false, "dynamicItems": false };
1508
+ validate25.evaluated = { "props": { "as_of_time": true, "detector_metadata": true, "field": true, "flag": true, "ingestion_id": true, "observation_kind": true, "observed_at": true, "parser_name": true, "qc_system": true, "qc_version": true, "rule_id": true, "source": true, "station_code": true }, "dynamicProps": false, "dynamicItems": false };
931
1509
 
932
1510
  // src/schemas/validators/schema_observation_v1.js
933
1511
  var schema_observation_v1 = validate20;
@@ -1269,13 +1847,13 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
1269
1847
  validate20.evaluated = { "props": { "dew_point_c": true, "event_time": true, "metar_raw": true, "observation_type": true, "precip_mm_1h": true, "sky_base_1_m": true, "sky_base_2_m": true, "sky_base_3_m": true, "sky_base_4_m": true, "sky_cover_1": true, "sky_cover_2": true, "sky_cover_3": true, "sky_cover_4": true, "slp_hpa": true, "station": true, "temp_c": true, "visibility_m": true, "wind_dir_deg": true, "wind_gust_ms": true, "wind_speed_ms": true }, "dynamicProps": false, "dynamicItems": false };
1270
1848
 
1271
1849
  // src/schemas/validators/schema_settlement_cli_v1.js
1272
- var schema_settlement_cli_v1 = validate22;
1273
- var schema33 = { "$id": "https://mostlyright.dev/schemas/schema.settlement.cli.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "cli_data_quality": { "description": "NWS CLI data-quality marker (Pitfall 6/16). Allows downstream code to filter or weight settlement rows by issuer quality without re-parsing the product header.", "enum": ["clean", "flagged_instrument", "flagged_late", "flagged_other", "missing"], "type": "string" }, "event_time": { "description": "00:00 local time on observation_date converted to UTC; for sort/join only", "format": "date-time", "type": "string" }, "observation_date": { "description": "local climate day per NWS convention (no timezone applied to the date itself)", "format": "date", "type": "string" }, "precipitation_in": { "description": "units: inches", "type": ["null", "number"] }, "product_release_time": { "description": "parsed from CLI product header (_climate.py::_parse_product_timestamp)", "format": "date-time", "type": "string" }, "report_type": { "description": "preliminary | final | correction; dedup priority preliminary < final < correction", "enum": ["correction", "final", "preliminary"], "type": "string" }, "settlement_finality": { "description": "provisional | final | superseded. Kalshi NHIGH/NLOW settlement contractually requires 'final'; 'provisional' values are kept for early-look research only.", "enum": ["final", "provisional", "superseded"], "type": "string" }, "snowfall_in": { "description": "units: inches", "type": ["null", "number"] }, "station": { "description": "ICAO/ASOS station ID", "type": "string" }, "station_tz": { "description": "IANA timezone for the station (e.g. America/Chicago for KORD). Required for local-climate-day semantics; see \xA7U.", "type": "string" }, "temp_max_F": { "description": "units: fahrenheit \u2014 daily high (uppercase F for consistency with obs imperial mode)", "type": ["null", "number"] }, "temp_min_F": { "description": "units: fahrenheit \u2014 daily low", "type": ["null", "number"] } }, "required": ["cli_data_quality", "event_time", "observation_date", "product_release_time", "report_type", "settlement_finality", "station", "station_tz"], "title": "schema.settlement.cli.v1", "type": "object", "version": "v1" };
1274
- function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1850
+ var schema_settlement_cli_v1 = validate23;
1851
+ var schema34 = { "$id": "https://mostlyright.dev/schemas/schema.settlement.cli.v1.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "cli_data_quality": { "description": "NWS CLI data-quality marker (Pitfall 6/16). Allows downstream code to filter or weight settlement rows by issuer quality without re-parsing the product header.", "enum": ["clean", "flagged_instrument", "flagged_late", "flagged_other", "missing"], "type": "string" }, "event_time": { "description": "00:00 local time on observation_date converted to UTC; for sort/join only", "format": "date-time", "type": "string" }, "observation_date": { "description": "local climate day per NWS convention (no timezone applied to the date itself)", "format": "date", "type": "string" }, "precipitation_in": { "description": "units: inches", "type": ["null", "number"] }, "product_release_time": { "description": "parsed from CLI product header (_climate.py::_parse_product_timestamp)", "format": "date-time", "type": "string" }, "report_type": { "description": "preliminary | final | correction; dedup priority preliminary < final < correction", "enum": ["correction", "final", "preliminary"], "type": "string" }, "settlement_finality": { "description": "provisional | final | superseded. Kalshi NHIGH/NLOW settlement contractually requires 'final'; 'provisional' values are kept for early-look research only.", "enum": ["final", "provisional", "superseded"], "type": "string" }, "snowfall_in": { "description": "units: inches", "type": ["null", "number"] }, "station": { "description": "ICAO/ASOS station ID", "type": "string" }, "station_tz": { "description": "IANA timezone for the station (e.g. America/Chicago for KORD). Required for local-climate-day semantics; see \xA7U.", "type": "string" }, "temp_max_F": { "description": "units: fahrenheit \u2014 daily high (uppercase F for consistency with obs imperial mode)", "type": ["null", "number"] }, "temp_min_F": { "description": "units: fahrenheit \u2014 daily low", "type": ["null", "number"] } }, "required": ["cli_data_quality", "event_time", "observation_date", "product_release_time", "report_type", "settlement_finality", "station", "station_tz"], "title": "schema.settlement.cli.v1", "type": "object", "version": "v1" };
1852
+ function validate23(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
1275
1853
  ;
1276
1854
  let vErrors = null;
1277
1855
  let errors = 0;
1278
- const evaluated0 = validate22.evaluated;
1856
+ const evaluated0 = validate23.evaluated;
1279
1857
  if (evaluated0.dynamicProps) {
1280
1858
  evaluated0.props = void 0;
1281
1859
  }
@@ -1367,7 +1945,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1367
1945
  errors++;
1368
1946
  }
1369
1947
  if (!(data0 === "clean" || data0 === "flagged_instrument" || data0 === "flagged_late" || data0 === "flagged_other" || data0 === "missing")) {
1370
- const err9 = { instancePath: instancePath + "/cli_data_quality", schemaPath: "#/properties/cli_data_quality/enum", keyword: "enum", params: { allowedValues: schema33.properties.cli_data_quality.enum }, message: "must be equal to one of the allowed values" };
1948
+ const err9 = { instancePath: instancePath + "/cli_data_quality", schemaPath: "#/properties/cli_data_quality/enum", keyword: "enum", params: { allowedValues: schema34.properties.cli_data_quality.enum }, message: "must be equal to one of the allowed values" };
1371
1949
  if (vErrors === null) {
1372
1950
  vErrors = [err9];
1373
1951
  } else {
@@ -1401,7 +1979,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1401
1979
  if (data.precipitation_in !== void 0) {
1402
1980
  let data3 = data.precipitation_in;
1403
1981
  if (data3 !== null && !(typeof data3 == "number")) {
1404
- const err12 = { instancePath: instancePath + "/precipitation_in", schemaPath: "#/properties/precipitation_in/type", keyword: "type", params: { type: schema33.properties.precipitation_in.type }, message: "must be null,number" };
1982
+ const err12 = { instancePath: instancePath + "/precipitation_in", schemaPath: "#/properties/precipitation_in/type", keyword: "type", params: { type: schema34.properties.precipitation_in.type }, message: "must be null,number" };
1405
1983
  if (vErrors === null) {
1406
1984
  vErrors = [err12];
1407
1985
  } else {
@@ -1433,7 +2011,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1433
2011
  errors++;
1434
2012
  }
1435
2013
  if (!(data5 === "correction" || data5 === "final" || data5 === "preliminary")) {
1436
- const err15 = { instancePath: instancePath + "/report_type", schemaPath: "#/properties/report_type/enum", keyword: "enum", params: { allowedValues: schema33.properties.report_type.enum }, message: "must be equal to one of the allowed values" };
2014
+ const err15 = { instancePath: instancePath + "/report_type", schemaPath: "#/properties/report_type/enum", keyword: "enum", params: { allowedValues: schema34.properties.report_type.enum }, message: "must be equal to one of the allowed values" };
1437
2015
  if (vErrors === null) {
1438
2016
  vErrors = [err15];
1439
2017
  } else {
@@ -1454,7 +2032,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1454
2032
  errors++;
1455
2033
  }
1456
2034
  if (!(data6 === "final" || data6 === "provisional" || data6 === "superseded")) {
1457
- const err17 = { instancePath: instancePath + "/settlement_finality", schemaPath: "#/properties/settlement_finality/enum", keyword: "enum", params: { allowedValues: schema33.properties.settlement_finality.enum }, message: "must be equal to one of the allowed values" };
2035
+ const err17 = { instancePath: instancePath + "/settlement_finality", schemaPath: "#/properties/settlement_finality/enum", keyword: "enum", params: { allowedValues: schema34.properties.settlement_finality.enum }, message: "must be equal to one of the allowed values" };
1458
2036
  if (vErrors === null) {
1459
2037
  vErrors = [err17];
1460
2038
  } else {
@@ -1466,7 +2044,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1466
2044
  if (data.snowfall_in !== void 0) {
1467
2045
  let data7 = data.snowfall_in;
1468
2046
  if (data7 !== null && !(typeof data7 == "number")) {
1469
- const err18 = { instancePath: instancePath + "/snowfall_in", schemaPath: "#/properties/snowfall_in/type", keyword: "type", params: { type: schema33.properties.snowfall_in.type }, message: "must be null,number" };
2047
+ const err18 = { instancePath: instancePath + "/snowfall_in", schemaPath: "#/properties/snowfall_in/type", keyword: "type", params: { type: schema34.properties.snowfall_in.type }, message: "must be null,number" };
1470
2048
  if (vErrors === null) {
1471
2049
  vErrors = [err18];
1472
2050
  } else {
@@ -1500,7 +2078,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1500
2078
  if (data.temp_max_F !== void 0) {
1501
2079
  let data10 = data.temp_max_F;
1502
2080
  if (data10 !== null && !(typeof data10 == "number")) {
1503
- const err21 = { instancePath: instancePath + "/temp_max_F", schemaPath: "#/properties/temp_max_F/type", keyword: "type", params: { type: schema33.properties.temp_max_F.type }, message: "must be null,number" };
2081
+ const err21 = { instancePath: instancePath + "/temp_max_F", schemaPath: "#/properties/temp_max_F/type", keyword: "type", params: { type: schema34.properties.temp_max_F.type }, message: "must be null,number" };
1504
2082
  if (vErrors === null) {
1505
2083
  vErrors = [err21];
1506
2084
  } else {
@@ -1512,7 +2090,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1512
2090
  if (data.temp_min_F !== void 0) {
1513
2091
  let data11 = data.temp_min_F;
1514
2092
  if (data11 !== null && !(typeof data11 == "number")) {
1515
- const err22 = { instancePath: instancePath + "/temp_min_F", schemaPath: "#/properties/temp_min_F/type", keyword: "type", params: { type: schema33.properties.temp_min_F.type }, message: "must be null,number" };
2093
+ const err22 = { instancePath: instancePath + "/temp_min_F", schemaPath: "#/properties/temp_min_F/type", keyword: "type", params: { type: schema34.properties.temp_min_F.type }, message: "must be null,number" };
1516
2094
  if (vErrors === null) {
1517
2095
  vErrors = [err22];
1518
2096
  } else {
@@ -1530,15 +2108,21 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1530
2108
  }
1531
2109
  errors++;
1532
2110
  }
1533
- validate22.errors = vErrors;
2111
+ validate23.errors = vErrors;
1534
2112
  return errors === 0;
1535
2113
  }
1536
- validate22.evaluated = { "props": { "cli_data_quality": true, "event_time": true, "observation_date": true, "precipitation_in": true, "product_release_time": true, "report_type": true, "settlement_finality": true, "snowfall_in": true, "station": true, "station_tz": true, "temp_max_F": true, "temp_min_F": true }, "dynamicProps": false, "dynamicItems": false };
2114
+ validate23.evaluated = { "props": { "cli_data_quality": true, "event_time": true, "observation_date": true, "precipitation_in": true, "product_release_time": true, "report_type": true, "settlement_finality": true, "snowfall_in": true, "station": true, "station_tz": true, "temp_max_F": true, "temp_min_F": true }, "dynamicProps": false, "dynamicItems": false };
1537
2115
 
1538
2116
  // src/schemas/validators/format-map.ts
1539
2117
  var FORMAT_MAPS = Object.freeze({
1540
2118
  "schema.forecast.iem_mos.v1": Object.freeze({
1541
2119
  "issued_at": "date-time",
2120
+ "retrieved_at": "date-time",
2121
+ "valid_at": "date-time"
2122
+ }),
2123
+ "schema.forecast.station.v1": Object.freeze({
2124
+ "issued_at": "date-time",
2125
+ "retrieved_at": "date-time",
1542
2126
  "valid_at": "date-time"
1543
2127
  }),
1544
2128
  "schema.observation_ledger.v1": Object.freeze({
@@ -1565,6 +2149,7 @@ function getFormatMap(schemaId) {
1565
2149
  // src/schemas/validators/index.ts
1566
2150
  var VALIDATORS = {
1567
2151
  "schema.forecast.iem_mos.v1": schema_forecast_iem_mos_v1,
2152
+ "schema.forecast.station.v1": schema_forecast_station_v1,
1568
2153
  "schema.observation_ledger.v1": schema_observation_ledger_v1,
1569
2154
  "schema.observation_qc.v1": schema_observation_qc_v1,
1570
2155
  "schema.observation.v1": schema_observation_v1,