@mostlyrightmd/core 1.1.3 → 1.4.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.
- package/README.md +1 -1
- package/dist/discovery/index.cjs +471 -169
- package/dist/discovery/index.cjs.map +1 -1
- package/dist/discovery/index.d.cts +39 -11
- package/dist/discovery/index.d.ts +39 -11
- package/dist/discovery/index.mjs +471 -169
- package/dist/discovery/index.mjs.map +1 -1
- package/dist/index.cjs +618 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +326 -29
- package/dist/index.d.ts +326 -29
- package/dist/index.global.js +610 -173
- package/dist/index.global.js.map +1 -1
- package/dist/index.mjs +610 -173
- package/dist/index.mjs.map +1 -1
- package/dist/internal/cache/index.browser.cjs +501 -163
- package/dist/internal/cache/index.browser.cjs.map +1 -1
- package/dist/internal/cache/index.browser.d.cts +8 -2
- package/dist/internal/cache/index.browser.d.ts +8 -2
- package/dist/internal/cache/index.browser.mjs +10 -5
- package/dist/internal/cache/index.browser.mjs.map +1 -1
- package/dist/internal/cache/index.cjs +503 -161
- package/dist/internal/cache/index.cjs.map +1 -1
- package/dist/internal/cache/index.d.cts +12 -6
- package/dist/internal/cache/index.d.ts +12 -6
- package/dist/internal/cache/index.mjs +12 -3
- package/dist/internal/cache/index.mjs.map +1 -1
- package/dist/internal/{chunk-PKJXHY27.mjs → chunk-QDQSYUFW.mjs} +494 -160
- package/dist/internal/chunk-QDQSYUFW.mjs.map +1 -0
- package/dist/internal/{keys-B7C8C88N.d.cts → versionedCacheStore-DyHDqFIC.d.cts} +23 -1
- package/dist/internal/{keys-B7C8C88N.d.ts → versionedCacheStore-DyHDqFIC.d.ts} +23 -1
- package/dist/preprocessing/index.cjs +150 -0
- package/dist/preprocessing/index.cjs.map +1 -0
- package/dist/preprocessing/index.d.cts +111 -0
- package/dist/preprocessing/index.d.ts +111 -0
- package/dist/preprocessing/index.mjs +121 -0
- package/dist/preprocessing/index.mjs.map +1 -0
- package/dist/temporal/index.cjs +56 -4
- package/dist/temporal/index.cjs.map +1 -1
- package/dist/temporal/index.d.cts +24 -1
- package/dist/temporal/index.d.ts +24 -1
- package/dist/temporal/index.mjs +55 -4
- package/dist/temporal/index.mjs.map +1 -1
- package/dist/validator.cjs +694 -109
- package/dist/validator.cjs.map +1 -1
- package/dist/validator.mjs +694 -109
- package/dist/validator.mjs.map +1 -1
- package/package.json +25 -2
- package/dist/internal/chunk-PKJXHY27.mjs.map +0 -1
package/dist/validator.cjs
CHANGED
|
@@ -82,9 +82,9 @@ function toJsonSafe(value, seen) {
|
|
|
82
82
|
}
|
|
83
83
|
return { _repr_only: true, value: String(value) };
|
|
84
84
|
}
|
|
85
|
-
var
|
|
85
|
+
var MostlyRightError = class extends Error {
|
|
86
86
|
/** Subclass override — the stable string enum surfaced via `errorCode`. */
|
|
87
|
-
static defaultErrorCode = "
|
|
87
|
+
static defaultErrorCode = "MOSTLYRIGHT_ERROR";
|
|
88
88
|
errorCode;
|
|
89
89
|
source;
|
|
90
90
|
requestId;
|
|
@@ -116,7 +116,7 @@ var TradewindsError = class extends Error {
|
|
|
116
116
|
return safe;
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
var SchemaValidationError = class extends
|
|
119
|
+
var SchemaValidationError = class extends MostlyRightError {
|
|
120
120
|
static defaultErrorCode = "SCHEMA_VALIDATION_FAILED";
|
|
121
121
|
schemaId;
|
|
122
122
|
violations;
|
|
@@ -139,7 +139,7 @@ var SchemaValidationError = class extends TradewindsError {
|
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
var SourceMismatchError = class extends
|
|
142
|
+
var SourceMismatchError = class extends MostlyRightError {
|
|
143
143
|
static defaultErrorCode = "SOURCE_MISMATCH";
|
|
144
144
|
/** Canonical role-name vocabulary (design.md §R). */
|
|
145
145
|
static VALID_ROLES = /* @__PURE__ */ new Set([
|
|
@@ -171,7 +171,7 @@ var SourceMismatchError = class extends TradewindsError {
|
|
|
171
171
|
|
|
172
172
|
// src/schemas/validators/schema_forecast_iem_mos_v1.js
|
|
173
173
|
var schema_forecast_iem_mos_v1 = validate21;
|
|
174
|
-
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
|
|
174
|
+
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" };
|
|
175
175
|
function validate21(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
176
176
|
;
|
|
177
177
|
let vErrors = null;
|
|
@@ -193,8 +193,8 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
193
193
|
}
|
|
194
194
|
errors++;
|
|
195
195
|
}
|
|
196
|
-
if (data.
|
|
197
|
-
const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "
|
|
196
|
+
if (data.model === void 0) {
|
|
197
|
+
const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "model" }, message: "must have required property 'model'" };
|
|
198
198
|
if (vErrors === null) {
|
|
199
199
|
vErrors = [err1];
|
|
200
200
|
} else {
|
|
@@ -202,8 +202,8 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
202
202
|
}
|
|
203
203
|
errors++;
|
|
204
204
|
}
|
|
205
|
-
if (data.
|
|
206
|
-
const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "
|
|
205
|
+
if (data.retrieved_at === void 0) {
|
|
206
|
+
const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "retrieved_at" }, message: "must have required property 'retrieved_at'" };
|
|
207
207
|
if (vErrors === null) {
|
|
208
208
|
vErrors = [err2];
|
|
209
209
|
} else {
|
|
@@ -211,8 +211,8 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
211
211
|
}
|
|
212
212
|
errors++;
|
|
213
213
|
}
|
|
214
|
-
if (data.
|
|
215
|
-
const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "
|
|
214
|
+
if (data.source === void 0) {
|
|
215
|
+
const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "source" }, message: "must have required property 'source'" };
|
|
216
216
|
if (vErrors === null) {
|
|
217
217
|
vErrors = [err3];
|
|
218
218
|
} else {
|
|
@@ -220,8 +220,8 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
220
220
|
}
|
|
221
221
|
errors++;
|
|
222
222
|
}
|
|
223
|
-
if (data.
|
|
224
|
-
const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "
|
|
223
|
+
if (data.station === void 0) {
|
|
224
|
+
const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "station" }, message: "must have required property 'station'" };
|
|
225
225
|
if (vErrors === null) {
|
|
226
226
|
vErrors = [err4];
|
|
227
227
|
} else {
|
|
@@ -229,22 +229,409 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
229
229
|
}
|
|
230
230
|
errors++;
|
|
231
231
|
}
|
|
232
|
-
if (data.
|
|
233
|
-
|
|
232
|
+
if (data.valid_at === void 0) {
|
|
233
|
+
const err5 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "valid_at" }, message: "must have required property 'valid_at'" };
|
|
234
|
+
if (vErrors === null) {
|
|
235
|
+
vErrors = [err5];
|
|
236
|
+
} else {
|
|
237
|
+
vErrors.push(err5);
|
|
238
|
+
}
|
|
239
|
+
errors++;
|
|
240
|
+
}
|
|
241
|
+
if (data.apparent_temp_c !== void 0) {
|
|
242
|
+
let data0 = data.apparent_temp_c;
|
|
234
243
|
if (data0 !== null && !(typeof data0 == "number")) {
|
|
235
|
-
const
|
|
244
|
+
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" };
|
|
236
245
|
if (vErrors === null) {
|
|
237
|
-
vErrors = [
|
|
246
|
+
vErrors = [err6];
|
|
238
247
|
} else {
|
|
239
|
-
vErrors.push(
|
|
248
|
+
vErrors.push(err6);
|
|
249
|
+
}
|
|
250
|
+
errors++;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (data.cape_jkg !== void 0) {
|
|
254
|
+
let data1 = data.cape_jkg;
|
|
255
|
+
if (data1 !== null && !(typeof data1 == "number")) {
|
|
256
|
+
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" };
|
|
257
|
+
if (vErrors === null) {
|
|
258
|
+
vErrors = [err7];
|
|
259
|
+
} else {
|
|
260
|
+
vErrors.push(err7);
|
|
261
|
+
}
|
|
262
|
+
errors++;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (data.cloud_cover_pct !== void 0) {
|
|
266
|
+
let data2 = data.cloud_cover_pct;
|
|
267
|
+
if (!(typeof data2 == "number" && (!(data2 % 1) && !isNaN(data2))) && data2 !== null) {
|
|
268
|
+
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" };
|
|
269
|
+
if (vErrors === null) {
|
|
270
|
+
vErrors = [err8];
|
|
271
|
+
} else {
|
|
272
|
+
vErrors.push(err8);
|
|
273
|
+
}
|
|
274
|
+
errors++;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (data.dew_point_c !== void 0) {
|
|
278
|
+
let data3 = data.dew_point_c;
|
|
279
|
+
if (data3 !== null && !(typeof data3 == "number")) {
|
|
280
|
+
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" };
|
|
281
|
+
if (vErrors === null) {
|
|
282
|
+
vErrors = [err9];
|
|
283
|
+
} else {
|
|
284
|
+
vErrors.push(err9);
|
|
285
|
+
}
|
|
286
|
+
errors++;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (data.direct_radiation_wm2 !== void 0) {
|
|
290
|
+
let data4 = data.direct_radiation_wm2;
|
|
291
|
+
if (data4 !== null && !(typeof data4 == "number")) {
|
|
292
|
+
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" };
|
|
293
|
+
if (vErrors === null) {
|
|
294
|
+
vErrors = [err10];
|
|
295
|
+
} else {
|
|
296
|
+
vErrors.push(err10);
|
|
240
297
|
}
|
|
241
298
|
errors++;
|
|
242
299
|
}
|
|
243
300
|
}
|
|
244
301
|
if (data.forecast_hour !== void 0) {
|
|
245
|
-
let
|
|
246
|
-
if (!(typeof
|
|
247
|
-
const
|
|
302
|
+
let data5 = data.forecast_hour;
|
|
303
|
+
if (!(typeof data5 == "number" && (!(data5 % 1) && !isNaN(data5)))) {
|
|
304
|
+
const err11 = { instancePath: instancePath + "/forecast_hour", schemaPath: "#/properties/forecast_hour/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
|
305
|
+
if (vErrors === null) {
|
|
306
|
+
vErrors = [err11];
|
|
307
|
+
} else {
|
|
308
|
+
vErrors.push(err11);
|
|
309
|
+
}
|
|
310
|
+
errors++;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (data.freezing_level_m !== void 0) {
|
|
314
|
+
let data6 = data.freezing_level_m;
|
|
315
|
+
if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6))) && data6 !== null) {
|
|
316
|
+
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" };
|
|
317
|
+
if (vErrors === null) {
|
|
318
|
+
vErrors = [err12];
|
|
319
|
+
} else {
|
|
320
|
+
vErrors.push(err12);
|
|
321
|
+
}
|
|
322
|
+
errors++;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (data.issued_at !== void 0) {
|
|
326
|
+
let data7 = data.issued_at;
|
|
327
|
+
if (data7 !== null && typeof data7 !== "string") {
|
|
328
|
+
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" };
|
|
329
|
+
if (vErrors === null) {
|
|
330
|
+
vErrors = [err13];
|
|
331
|
+
} else {
|
|
332
|
+
vErrors.push(err13);
|
|
333
|
+
}
|
|
334
|
+
errors++;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (data.model !== void 0) {
|
|
338
|
+
if (typeof data.model !== "string") {
|
|
339
|
+
const err14 = { instancePath: instancePath + "/model", schemaPath: "#/properties/model/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
340
|
+
if (vErrors === null) {
|
|
341
|
+
vErrors = [err14];
|
|
342
|
+
} else {
|
|
343
|
+
vErrors.push(err14);
|
|
344
|
+
}
|
|
345
|
+
errors++;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
if (data.precip_probability !== void 0) {
|
|
349
|
+
let data9 = data.precip_probability;
|
|
350
|
+
if (data9 !== null && !(typeof data9 == "number")) {
|
|
351
|
+
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" };
|
|
352
|
+
if (vErrors === null) {
|
|
353
|
+
vErrors = [err15];
|
|
354
|
+
} else {
|
|
355
|
+
vErrors.push(err15);
|
|
356
|
+
}
|
|
357
|
+
errors++;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (data.precipitation_mm !== void 0) {
|
|
361
|
+
let data10 = data.precipitation_mm;
|
|
362
|
+
if (data10 !== null && !(typeof data10 == "number")) {
|
|
363
|
+
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" };
|
|
364
|
+
if (vErrors === null) {
|
|
365
|
+
vErrors = [err16];
|
|
366
|
+
} else {
|
|
367
|
+
vErrors.push(err16);
|
|
368
|
+
}
|
|
369
|
+
errors++;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (data.pressure_msl_hpa !== void 0) {
|
|
373
|
+
let data11 = data.pressure_msl_hpa;
|
|
374
|
+
if (data11 !== null && !(typeof data11 == "number")) {
|
|
375
|
+
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" };
|
|
376
|
+
if (vErrors === null) {
|
|
377
|
+
vErrors = [err17];
|
|
378
|
+
} else {
|
|
379
|
+
vErrors.push(err17);
|
|
380
|
+
}
|
|
381
|
+
errors++;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (data.retrieved_at !== void 0) {
|
|
385
|
+
if (!(typeof data.retrieved_at === "string")) {
|
|
386
|
+
const err18 = { instancePath: instancePath + "/retrieved_at", schemaPath: "#/properties/retrieved_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
387
|
+
if (vErrors === null) {
|
|
388
|
+
vErrors = [err18];
|
|
389
|
+
} else {
|
|
390
|
+
vErrors.push(err18);
|
|
391
|
+
}
|
|
392
|
+
errors++;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
if (data.shortwave_radiation_wm2 !== void 0) {
|
|
396
|
+
let data13 = data.shortwave_radiation_wm2;
|
|
397
|
+
if (data13 !== null && !(typeof data13 == "number")) {
|
|
398
|
+
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" };
|
|
399
|
+
if (vErrors === null) {
|
|
400
|
+
vErrors = [err19];
|
|
401
|
+
} else {
|
|
402
|
+
vErrors.push(err19);
|
|
403
|
+
}
|
|
404
|
+
errors++;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
if (data.sky_cover_pct !== void 0) {
|
|
408
|
+
let data14 = data.sky_cover_pct;
|
|
409
|
+
if (!(typeof data14 == "number" && (!(data14 % 1) && !isNaN(data14))) && data14 !== null) {
|
|
410
|
+
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" };
|
|
411
|
+
if (vErrors === null) {
|
|
412
|
+
vErrors = [err20];
|
|
413
|
+
} else {
|
|
414
|
+
vErrors.push(err20);
|
|
415
|
+
}
|
|
416
|
+
errors++;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
if (data.snow_depth_m !== void 0) {
|
|
420
|
+
let data15 = data.snow_depth_m;
|
|
421
|
+
if (data15 !== null && !(typeof data15 == "number")) {
|
|
422
|
+
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" };
|
|
423
|
+
if (vErrors === null) {
|
|
424
|
+
vErrors = [err21];
|
|
425
|
+
} else {
|
|
426
|
+
vErrors.push(err21);
|
|
427
|
+
}
|
|
428
|
+
errors++;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (data.source !== void 0) {
|
|
432
|
+
if (typeof data.source !== "string") {
|
|
433
|
+
const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
434
|
+
if (vErrors === null) {
|
|
435
|
+
vErrors = [err22];
|
|
436
|
+
} else {
|
|
437
|
+
vErrors.push(err22);
|
|
438
|
+
}
|
|
439
|
+
errors++;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (data.station !== void 0) {
|
|
443
|
+
if (typeof data.station !== "string") {
|
|
444
|
+
const err23 = { instancePath: instancePath + "/station", schemaPath: "#/properties/station/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
445
|
+
if (vErrors === null) {
|
|
446
|
+
vErrors = [err23];
|
|
447
|
+
} else {
|
|
448
|
+
vErrors.push(err23);
|
|
449
|
+
}
|
|
450
|
+
errors++;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if (data.surface_pressure_hpa !== void 0) {
|
|
454
|
+
let data18 = data.surface_pressure_hpa;
|
|
455
|
+
if (data18 !== null && !(typeof data18 == "number")) {
|
|
456
|
+
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" };
|
|
457
|
+
if (vErrors === null) {
|
|
458
|
+
vErrors = [err24];
|
|
459
|
+
} else {
|
|
460
|
+
vErrors.push(err24);
|
|
461
|
+
}
|
|
462
|
+
errors++;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (data.temp_c !== void 0) {
|
|
466
|
+
let data19 = data.temp_c;
|
|
467
|
+
if (data19 !== null && !(typeof data19 == "number")) {
|
|
468
|
+
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" };
|
|
469
|
+
if (vErrors === null) {
|
|
470
|
+
vErrors = [err25];
|
|
471
|
+
} else {
|
|
472
|
+
vErrors.push(err25);
|
|
473
|
+
}
|
|
474
|
+
errors++;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (data.valid_at !== void 0) {
|
|
478
|
+
if (!(typeof data.valid_at === "string")) {
|
|
479
|
+
const err26 = { instancePath: instancePath + "/valid_at", schemaPath: "#/properties/valid_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
480
|
+
if (vErrors === null) {
|
|
481
|
+
vErrors = [err26];
|
|
482
|
+
} else {
|
|
483
|
+
vErrors.push(err26);
|
|
484
|
+
}
|
|
485
|
+
errors++;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
if (data.visibility_m !== void 0) {
|
|
489
|
+
let data21 = data.visibility_m;
|
|
490
|
+
if (!(typeof data21 == "number" && (!(data21 % 1) && !isNaN(data21))) && data21 !== null) {
|
|
491
|
+
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" };
|
|
492
|
+
if (vErrors === null) {
|
|
493
|
+
vErrors = [err27];
|
|
494
|
+
} else {
|
|
495
|
+
vErrors.push(err27);
|
|
496
|
+
}
|
|
497
|
+
errors++;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
if (data.weather_code !== void 0) {
|
|
501
|
+
let data22 = data.weather_code;
|
|
502
|
+
if (!(typeof data22 == "number" && (!(data22 % 1) && !isNaN(data22))) && data22 !== null) {
|
|
503
|
+
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" };
|
|
504
|
+
if (vErrors === null) {
|
|
505
|
+
vErrors = [err28];
|
|
506
|
+
} else {
|
|
507
|
+
vErrors.push(err28);
|
|
508
|
+
}
|
|
509
|
+
errors++;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (data.wind_dir_deg !== void 0) {
|
|
513
|
+
let data23 = data.wind_dir_deg;
|
|
514
|
+
if (!(typeof data23 == "number" && (!(data23 % 1) && !isNaN(data23))) && data23 !== null) {
|
|
515
|
+
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" };
|
|
516
|
+
if (vErrors === null) {
|
|
517
|
+
vErrors = [err29];
|
|
518
|
+
} else {
|
|
519
|
+
vErrors.push(err29);
|
|
520
|
+
}
|
|
521
|
+
errors++;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
if (data.wind_gusts_ms !== void 0) {
|
|
525
|
+
let data24 = data.wind_gusts_ms;
|
|
526
|
+
if (data24 !== null && !(typeof data24 == "number")) {
|
|
527
|
+
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" };
|
|
528
|
+
if (vErrors === null) {
|
|
529
|
+
vErrors = [err30];
|
|
530
|
+
} else {
|
|
531
|
+
vErrors.push(err30);
|
|
532
|
+
}
|
|
533
|
+
errors++;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
if (data.wind_speed_ms !== void 0) {
|
|
537
|
+
let data25 = data.wind_speed_ms;
|
|
538
|
+
if (data25 !== null && !(typeof data25 == "number")) {
|
|
539
|
+
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" };
|
|
540
|
+
if (vErrors === null) {
|
|
541
|
+
vErrors = [err31];
|
|
542
|
+
} else {
|
|
543
|
+
vErrors.push(err31);
|
|
544
|
+
}
|
|
545
|
+
errors++;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
} else {
|
|
549
|
+
const err32 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
550
|
+
if (vErrors === null) {
|
|
551
|
+
vErrors = [err32];
|
|
552
|
+
} else {
|
|
553
|
+
vErrors.push(err32);
|
|
554
|
+
}
|
|
555
|
+
errors++;
|
|
556
|
+
}
|
|
557
|
+
validate21.errors = vErrors;
|
|
558
|
+
return errors === 0;
|
|
559
|
+
}
|
|
560
|
+
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 };
|
|
561
|
+
|
|
562
|
+
// src/schemas/validators/schema_forecast_station_v1.js
|
|
563
|
+
var schema_forecast_station_v1 = validate22;
|
|
564
|
+
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" };
|
|
565
|
+
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
566
|
+
;
|
|
567
|
+
let vErrors = null;
|
|
568
|
+
let errors = 0;
|
|
569
|
+
const evaluated0 = validate22.evaluated;
|
|
570
|
+
if (evaluated0.dynamicProps) {
|
|
571
|
+
evaluated0.props = void 0;
|
|
572
|
+
}
|
|
573
|
+
if (evaluated0.dynamicItems) {
|
|
574
|
+
evaluated0.items = void 0;
|
|
575
|
+
}
|
|
576
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
577
|
+
if (data.forecast_hour === void 0) {
|
|
578
|
+
const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "forecast_hour" }, message: "must have required property 'forecast_hour'" };
|
|
579
|
+
if (vErrors === null) {
|
|
580
|
+
vErrors = [err0];
|
|
581
|
+
} else {
|
|
582
|
+
vErrors.push(err0);
|
|
583
|
+
}
|
|
584
|
+
errors++;
|
|
585
|
+
}
|
|
586
|
+
if (data.model === void 0) {
|
|
587
|
+
const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "model" }, message: "must have required property 'model'" };
|
|
588
|
+
if (vErrors === null) {
|
|
589
|
+
vErrors = [err1];
|
|
590
|
+
} else {
|
|
591
|
+
vErrors.push(err1);
|
|
592
|
+
}
|
|
593
|
+
errors++;
|
|
594
|
+
}
|
|
595
|
+
if (data.retrieved_at === void 0) {
|
|
596
|
+
const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "retrieved_at" }, message: "must have required property 'retrieved_at'" };
|
|
597
|
+
if (vErrors === null) {
|
|
598
|
+
vErrors = [err2];
|
|
599
|
+
} else {
|
|
600
|
+
vErrors.push(err2);
|
|
601
|
+
}
|
|
602
|
+
errors++;
|
|
603
|
+
}
|
|
604
|
+
if (data.source === void 0) {
|
|
605
|
+
const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "source" }, message: "must have required property 'source'" };
|
|
606
|
+
if (vErrors === null) {
|
|
607
|
+
vErrors = [err3];
|
|
608
|
+
} else {
|
|
609
|
+
vErrors.push(err3);
|
|
610
|
+
}
|
|
611
|
+
errors++;
|
|
612
|
+
}
|
|
613
|
+
if (data.station === void 0) {
|
|
614
|
+
const err4 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "station" }, message: "must have required property 'station'" };
|
|
615
|
+
if (vErrors === null) {
|
|
616
|
+
vErrors = [err4];
|
|
617
|
+
} else {
|
|
618
|
+
vErrors.push(err4);
|
|
619
|
+
}
|
|
620
|
+
errors++;
|
|
621
|
+
}
|
|
622
|
+
if (data.valid_at === void 0) {
|
|
623
|
+
const err5 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "valid_at" }, message: "must have required property 'valid_at'" };
|
|
624
|
+
if (vErrors === null) {
|
|
625
|
+
vErrors = [err5];
|
|
626
|
+
} else {
|
|
627
|
+
vErrors.push(err5);
|
|
628
|
+
}
|
|
629
|
+
errors++;
|
|
630
|
+
}
|
|
631
|
+
if (data.apparent_temp_c !== void 0) {
|
|
632
|
+
let data0 = data.apparent_temp_c;
|
|
633
|
+
if (data0 !== null && !(typeof data0 == "number")) {
|
|
634
|
+
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" };
|
|
248
635
|
if (vErrors === null) {
|
|
249
636
|
vErrors = [err6];
|
|
250
637
|
} else {
|
|
@@ -253,9 +640,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
253
640
|
errors++;
|
|
254
641
|
}
|
|
255
642
|
}
|
|
256
|
-
if (data.
|
|
257
|
-
|
|
258
|
-
|
|
643
|
+
if (data.cape_jkg !== void 0) {
|
|
644
|
+
let data1 = data.cape_jkg;
|
|
645
|
+
if (data1 !== null && !(typeof data1 == "number")) {
|
|
646
|
+
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" };
|
|
259
647
|
if (vErrors === null) {
|
|
260
648
|
vErrors = [err7];
|
|
261
649
|
} else {
|
|
@@ -264,9 +652,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
264
652
|
errors++;
|
|
265
653
|
}
|
|
266
654
|
}
|
|
267
|
-
if (data.
|
|
268
|
-
|
|
269
|
-
|
|
655
|
+
if (data.cloud_cover_pct !== void 0) {
|
|
656
|
+
let data2 = data.cloud_cover_pct;
|
|
657
|
+
if (!(typeof data2 == "number" && (!(data2 % 1) && !isNaN(data2))) && data2 !== null) {
|
|
658
|
+
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" };
|
|
270
659
|
if (vErrors === null) {
|
|
271
660
|
vErrors = [err8];
|
|
272
661
|
} else {
|
|
@@ -275,10 +664,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
275
664
|
errors++;
|
|
276
665
|
}
|
|
277
666
|
}
|
|
278
|
-
if (data.
|
|
279
|
-
let
|
|
280
|
-
if (
|
|
281
|
-
const err9 = { instancePath: instancePath + "/
|
|
667
|
+
if (data.dew_point_c !== void 0) {
|
|
668
|
+
let data3 = data.dew_point_c;
|
|
669
|
+
if (data3 !== null && !(typeof data3 == "number")) {
|
|
670
|
+
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" };
|
|
282
671
|
if (vErrors === null) {
|
|
283
672
|
vErrors = [err9];
|
|
284
673
|
} else {
|
|
@@ -287,10 +676,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
287
676
|
errors++;
|
|
288
677
|
}
|
|
289
678
|
}
|
|
290
|
-
if (data.
|
|
291
|
-
let
|
|
292
|
-
if (!(typeof
|
|
293
|
-
const err10 = { instancePath: instancePath + "/
|
|
679
|
+
if (data.direct_radiation_wm2 !== void 0) {
|
|
680
|
+
let data4 = data.direct_radiation_wm2;
|
|
681
|
+
if (data4 !== null && !(typeof data4 == "number")) {
|
|
682
|
+
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" };
|
|
294
683
|
if (vErrors === null) {
|
|
295
684
|
vErrors = [err10];
|
|
296
685
|
} else {
|
|
@@ -299,9 +688,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
299
688
|
errors++;
|
|
300
689
|
}
|
|
301
690
|
}
|
|
302
|
-
if (data.
|
|
303
|
-
|
|
304
|
-
|
|
691
|
+
if (data.forecast_hour !== void 0) {
|
|
692
|
+
let data5 = data.forecast_hour;
|
|
693
|
+
if (!(typeof data5 == "number" && (!(data5 % 1) && !isNaN(data5)))) {
|
|
694
|
+
const err11 = { instancePath: instancePath + "/forecast_hour", schemaPath: "#/properties/forecast_hour/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
|
305
695
|
if (vErrors === null) {
|
|
306
696
|
vErrors = [err11];
|
|
307
697
|
} else {
|
|
@@ -310,10 +700,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
310
700
|
errors++;
|
|
311
701
|
}
|
|
312
702
|
}
|
|
313
|
-
if (data.
|
|
314
|
-
let
|
|
315
|
-
if (
|
|
316
|
-
const err12 = { instancePath: instancePath + "/
|
|
703
|
+
if (data.freezing_level_m !== void 0) {
|
|
704
|
+
let data6 = data.freezing_level_m;
|
|
705
|
+
if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6))) && data6 !== null) {
|
|
706
|
+
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" };
|
|
317
707
|
if (vErrors === null) {
|
|
318
708
|
vErrors = [err12];
|
|
319
709
|
} else {
|
|
@@ -322,9 +712,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
322
712
|
errors++;
|
|
323
713
|
}
|
|
324
714
|
}
|
|
325
|
-
if (data.
|
|
326
|
-
|
|
327
|
-
|
|
715
|
+
if (data.issued_at !== void 0) {
|
|
716
|
+
let data7 = data.issued_at;
|
|
717
|
+
if (data7 !== null && typeof data7 !== "string") {
|
|
718
|
+
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" };
|
|
328
719
|
if (vErrors === null) {
|
|
329
720
|
vErrors = [err13];
|
|
330
721
|
} else {
|
|
@@ -333,10 +724,9 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
333
724
|
errors++;
|
|
334
725
|
}
|
|
335
726
|
}
|
|
336
|
-
if (data.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
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" };
|
|
727
|
+
if (data.model !== void 0) {
|
|
728
|
+
if (typeof data.model !== "string") {
|
|
729
|
+
const err14 = { instancePath: instancePath + "/model", schemaPath: "#/properties/model/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
340
730
|
if (vErrors === null) {
|
|
341
731
|
vErrors = [err14];
|
|
342
732
|
} else {
|
|
@@ -345,10 +735,10 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
345
735
|
errors++;
|
|
346
736
|
}
|
|
347
737
|
}
|
|
348
|
-
if (data.
|
|
349
|
-
let
|
|
350
|
-
if (
|
|
351
|
-
const err15 = { instancePath: instancePath + "/
|
|
738
|
+
if (data.precip_probability !== void 0) {
|
|
739
|
+
let data9 = data.precip_probability;
|
|
740
|
+
if (data9 !== null && !(typeof data9 == "number")) {
|
|
741
|
+
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" };
|
|
352
742
|
if (vErrors === null) {
|
|
353
743
|
vErrors = [err15];
|
|
354
744
|
} else {
|
|
@@ -357,28 +747,216 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
357
747
|
errors++;
|
|
358
748
|
}
|
|
359
749
|
}
|
|
750
|
+
if (data.precipitation_mm !== void 0) {
|
|
751
|
+
let data10 = data.precipitation_mm;
|
|
752
|
+
if (data10 !== null && !(typeof data10 == "number")) {
|
|
753
|
+
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" };
|
|
754
|
+
if (vErrors === null) {
|
|
755
|
+
vErrors = [err16];
|
|
756
|
+
} else {
|
|
757
|
+
vErrors.push(err16);
|
|
758
|
+
}
|
|
759
|
+
errors++;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
if (data.pressure_msl_hpa !== void 0) {
|
|
763
|
+
let data11 = data.pressure_msl_hpa;
|
|
764
|
+
if (data11 !== null && !(typeof data11 == "number")) {
|
|
765
|
+
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" };
|
|
766
|
+
if (vErrors === null) {
|
|
767
|
+
vErrors = [err17];
|
|
768
|
+
} else {
|
|
769
|
+
vErrors.push(err17);
|
|
770
|
+
}
|
|
771
|
+
errors++;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
if (data.retrieved_at !== void 0) {
|
|
775
|
+
if (!(typeof data.retrieved_at === "string")) {
|
|
776
|
+
const err18 = { instancePath: instancePath + "/retrieved_at", schemaPath: "#/properties/retrieved_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
777
|
+
if (vErrors === null) {
|
|
778
|
+
vErrors = [err18];
|
|
779
|
+
} else {
|
|
780
|
+
vErrors.push(err18);
|
|
781
|
+
}
|
|
782
|
+
errors++;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
if (data.shortwave_radiation_wm2 !== void 0) {
|
|
786
|
+
let data13 = data.shortwave_radiation_wm2;
|
|
787
|
+
if (data13 !== null && !(typeof data13 == "number")) {
|
|
788
|
+
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" };
|
|
789
|
+
if (vErrors === null) {
|
|
790
|
+
vErrors = [err19];
|
|
791
|
+
} else {
|
|
792
|
+
vErrors.push(err19);
|
|
793
|
+
}
|
|
794
|
+
errors++;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
if (data.sky_cover_pct !== void 0) {
|
|
798
|
+
let data14 = data.sky_cover_pct;
|
|
799
|
+
if (!(typeof data14 == "number" && (!(data14 % 1) && !isNaN(data14))) && data14 !== null) {
|
|
800
|
+
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" };
|
|
801
|
+
if (vErrors === null) {
|
|
802
|
+
vErrors = [err20];
|
|
803
|
+
} else {
|
|
804
|
+
vErrors.push(err20);
|
|
805
|
+
}
|
|
806
|
+
errors++;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
if (data.snow_depth_m !== void 0) {
|
|
810
|
+
let data15 = data.snow_depth_m;
|
|
811
|
+
if (data15 !== null && !(typeof data15 == "number")) {
|
|
812
|
+
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" };
|
|
813
|
+
if (vErrors === null) {
|
|
814
|
+
vErrors = [err21];
|
|
815
|
+
} else {
|
|
816
|
+
vErrors.push(err21);
|
|
817
|
+
}
|
|
818
|
+
errors++;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
if (data.source !== void 0) {
|
|
822
|
+
if (typeof data.source !== "string") {
|
|
823
|
+
const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
824
|
+
if (vErrors === null) {
|
|
825
|
+
vErrors = [err22];
|
|
826
|
+
} else {
|
|
827
|
+
vErrors.push(err22);
|
|
828
|
+
}
|
|
829
|
+
errors++;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
if (data.station !== void 0) {
|
|
833
|
+
if (typeof data.station !== "string") {
|
|
834
|
+
const err23 = { instancePath: instancePath + "/station", schemaPath: "#/properties/station/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
835
|
+
if (vErrors === null) {
|
|
836
|
+
vErrors = [err23];
|
|
837
|
+
} else {
|
|
838
|
+
vErrors.push(err23);
|
|
839
|
+
}
|
|
840
|
+
errors++;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
if (data.surface_pressure_hpa !== void 0) {
|
|
844
|
+
let data18 = data.surface_pressure_hpa;
|
|
845
|
+
if (data18 !== null && !(typeof data18 == "number")) {
|
|
846
|
+
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" };
|
|
847
|
+
if (vErrors === null) {
|
|
848
|
+
vErrors = [err24];
|
|
849
|
+
} else {
|
|
850
|
+
vErrors.push(err24);
|
|
851
|
+
}
|
|
852
|
+
errors++;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
if (data.temp_c !== void 0) {
|
|
856
|
+
let data19 = data.temp_c;
|
|
857
|
+
if (data19 !== null && !(typeof data19 == "number")) {
|
|
858
|
+
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" };
|
|
859
|
+
if (vErrors === null) {
|
|
860
|
+
vErrors = [err25];
|
|
861
|
+
} else {
|
|
862
|
+
vErrors.push(err25);
|
|
863
|
+
}
|
|
864
|
+
errors++;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
if (data.valid_at !== void 0) {
|
|
868
|
+
if (!(typeof data.valid_at === "string")) {
|
|
869
|
+
const err26 = { instancePath: instancePath + "/valid_at", schemaPath: "#/properties/valid_at/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
870
|
+
if (vErrors === null) {
|
|
871
|
+
vErrors = [err26];
|
|
872
|
+
} else {
|
|
873
|
+
vErrors.push(err26);
|
|
874
|
+
}
|
|
875
|
+
errors++;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
if (data.visibility_m !== void 0) {
|
|
879
|
+
let data21 = data.visibility_m;
|
|
880
|
+
if (!(typeof data21 == "number" && (!(data21 % 1) && !isNaN(data21))) && data21 !== null) {
|
|
881
|
+
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" };
|
|
882
|
+
if (vErrors === null) {
|
|
883
|
+
vErrors = [err27];
|
|
884
|
+
} else {
|
|
885
|
+
vErrors.push(err27);
|
|
886
|
+
}
|
|
887
|
+
errors++;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
if (data.weather_code !== void 0) {
|
|
891
|
+
let data22 = data.weather_code;
|
|
892
|
+
if (!(typeof data22 == "number" && (!(data22 % 1) && !isNaN(data22))) && data22 !== null) {
|
|
893
|
+
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" };
|
|
894
|
+
if (vErrors === null) {
|
|
895
|
+
vErrors = [err28];
|
|
896
|
+
} else {
|
|
897
|
+
vErrors.push(err28);
|
|
898
|
+
}
|
|
899
|
+
errors++;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
if (data.wind_dir_deg !== void 0) {
|
|
903
|
+
let data23 = data.wind_dir_deg;
|
|
904
|
+
if (!(typeof data23 == "number" && (!(data23 % 1) && !isNaN(data23))) && data23 !== null) {
|
|
905
|
+
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" };
|
|
906
|
+
if (vErrors === null) {
|
|
907
|
+
vErrors = [err29];
|
|
908
|
+
} else {
|
|
909
|
+
vErrors.push(err29);
|
|
910
|
+
}
|
|
911
|
+
errors++;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
if (data.wind_gusts_ms !== void 0) {
|
|
915
|
+
let data24 = data.wind_gusts_ms;
|
|
916
|
+
if (data24 !== null && !(typeof data24 == "number")) {
|
|
917
|
+
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" };
|
|
918
|
+
if (vErrors === null) {
|
|
919
|
+
vErrors = [err30];
|
|
920
|
+
} else {
|
|
921
|
+
vErrors.push(err30);
|
|
922
|
+
}
|
|
923
|
+
errors++;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
if (data.wind_speed_ms !== void 0) {
|
|
927
|
+
let data25 = data.wind_speed_ms;
|
|
928
|
+
if (data25 !== null && !(typeof data25 == "number")) {
|
|
929
|
+
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" };
|
|
930
|
+
if (vErrors === null) {
|
|
931
|
+
vErrors = [err31];
|
|
932
|
+
} else {
|
|
933
|
+
vErrors.push(err31);
|
|
934
|
+
}
|
|
935
|
+
errors++;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
360
938
|
} else {
|
|
361
|
-
const
|
|
939
|
+
const err32 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
362
940
|
if (vErrors === null) {
|
|
363
|
-
vErrors = [
|
|
941
|
+
vErrors = [err32];
|
|
364
942
|
} else {
|
|
365
|
-
vErrors.push(
|
|
943
|
+
vErrors.push(err32);
|
|
366
944
|
}
|
|
367
945
|
errors++;
|
|
368
946
|
}
|
|
369
|
-
|
|
947
|
+
validate22.errors = vErrors;
|
|
370
948
|
return errors === 0;
|
|
371
949
|
}
|
|
372
|
-
|
|
950
|
+
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 };
|
|
373
951
|
|
|
374
952
|
// src/schemas/validators/schema_observation_ledger_v1.js
|
|
375
|
-
var schema_observation_ledger_v1 =
|
|
376
|
-
var
|
|
377
|
-
function
|
|
953
|
+
var schema_observation_ledger_v1 = validate24;
|
|
954
|
+
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" };
|
|
955
|
+
function validate24(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
378
956
|
;
|
|
379
957
|
let vErrors = null;
|
|
380
958
|
let errors = 0;
|
|
381
|
-
const evaluated0 =
|
|
959
|
+
const evaluated0 = validate24.evaluated;
|
|
382
960
|
if (evaluated0.dynamicProps) {
|
|
383
961
|
evaluated0.props = void 0;
|
|
384
962
|
}
|
|
@@ -425,7 +1003,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
425
1003
|
if (data.as_of_time !== void 0) {
|
|
426
1004
|
let data0 = data.as_of_time;
|
|
427
1005
|
if (data0 !== null && typeof data0 !== "string") {
|
|
428
|
-
const err4 = { instancePath: instancePath + "/as_of_time", schemaPath: "#/properties/as_of_time/type", keyword: "type", params: { type:
|
|
1006
|
+
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" };
|
|
429
1007
|
if (vErrors === null) {
|
|
430
1008
|
vErrors = [err4];
|
|
431
1009
|
} else {
|
|
@@ -437,7 +1015,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
437
1015
|
if (data.dewpoint_c !== void 0) {
|
|
438
1016
|
let data1 = data.dewpoint_c;
|
|
439
1017
|
if (data1 !== null && !(typeof data1 == "number")) {
|
|
440
|
-
const err5 = { instancePath: instancePath + "/dewpoint_c", schemaPath: "#/properties/dewpoint_c/type", keyword: "type", params: { type:
|
|
1018
|
+
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" };
|
|
441
1019
|
if (vErrors === null) {
|
|
442
1020
|
vErrors = [err5];
|
|
443
1021
|
} else {
|
|
@@ -449,7 +1027,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
449
1027
|
if (data.ingestion_id !== void 0) {
|
|
450
1028
|
let data2 = data.ingestion_id;
|
|
451
1029
|
if (data2 !== null && typeof data2 !== "string") {
|
|
452
|
-
const err6 = { instancePath: instancePath + "/ingestion_id", schemaPath: "#/properties/ingestion_id/type", keyword: "type", params: { type:
|
|
1030
|
+
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" };
|
|
453
1031
|
if (vErrors === null) {
|
|
454
1032
|
vErrors = [err6];
|
|
455
1033
|
} else {
|
|
@@ -461,7 +1039,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
461
1039
|
if (data.observation_kind !== void 0) {
|
|
462
1040
|
let data3 = data.observation_kind;
|
|
463
1041
|
if (data3 !== null && typeof data3 !== "string") {
|
|
464
|
-
const err7 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/type", keyword: "type", params: { type:
|
|
1042
|
+
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" };
|
|
465
1043
|
if (vErrors === null) {
|
|
466
1044
|
vErrors = [err7];
|
|
467
1045
|
} else {
|
|
@@ -470,7 +1048,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
470
1048
|
errors++;
|
|
471
1049
|
}
|
|
472
1050
|
if (!(data3 === "METAR" || data3 === "SPECI" || data3 === null)) {
|
|
473
|
-
const err8 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/enum", keyword: "enum", params: { allowedValues:
|
|
1051
|
+
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" };
|
|
474
1052
|
if (vErrors === null) {
|
|
475
1053
|
vErrors = [err8];
|
|
476
1054
|
} else {
|
|
@@ -482,7 +1060,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
482
1060
|
if (data.observation_quality !== void 0) {
|
|
483
1061
|
let data4 = data.observation_quality;
|
|
484
1062
|
if (data4 !== null && typeof data4 !== "string") {
|
|
485
|
-
const err9 = { instancePath: instancePath + "/observation_quality", schemaPath: "#/properties/observation_quality/type", keyword: "type", params: { type:
|
|
1063
|
+
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" };
|
|
486
1064
|
if (vErrors === null) {
|
|
487
1065
|
vErrors = [err9];
|
|
488
1066
|
} else {
|
|
@@ -491,7 +1069,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
491
1069
|
errors++;
|
|
492
1070
|
}
|
|
493
1071
|
if (!(data4 === "clean" || data4 === "flagged" || data4 === "suspect" || data4 === null)) {
|
|
494
|
-
const err10 = { instancePath: instancePath + "/observation_quality", schemaPath: "#/properties/observation_quality/enum", keyword: "enum", params: { allowedValues:
|
|
1072
|
+
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" };
|
|
495
1073
|
if (vErrors === null) {
|
|
496
1074
|
vErrors = [err10];
|
|
497
1075
|
} else {
|
|
@@ -512,7 +1090,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
512
1090
|
errors++;
|
|
513
1091
|
}
|
|
514
1092
|
if (!(data5 === "METAR" || data5 === "SPECI")) {
|
|
515
|
-
const err12 = { instancePath: instancePath + "/observation_type", schemaPath: "#/properties/observation_type/enum", keyword: "enum", params: { allowedValues:
|
|
1093
|
+
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" };
|
|
516
1094
|
if (vErrors === null) {
|
|
517
1095
|
vErrors = [err12];
|
|
518
1096
|
} else {
|
|
@@ -535,7 +1113,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
535
1113
|
if (data.parser_name !== void 0) {
|
|
536
1114
|
let data7 = data.parser_name;
|
|
537
1115
|
if (data7 !== null && typeof data7 !== "string") {
|
|
538
|
-
const err14 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/type", keyword: "type", params: { type:
|
|
1116
|
+
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" };
|
|
539
1117
|
if (vErrors === null) {
|
|
540
1118
|
vErrors = [err14];
|
|
541
1119
|
} else {
|
|
@@ -544,7 +1122,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
544
1122
|
errors++;
|
|
545
1123
|
}
|
|
546
1124
|
if (!(data7 === "ghcnh" || data7 === "iem" || data7 === "mostlyright_v1" || data7 === "ncei" || data7 === null)) {
|
|
547
|
-
const err15 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/enum", keyword: "enum", params: { allowedValues:
|
|
1125
|
+
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" };
|
|
548
1126
|
if (vErrors === null) {
|
|
549
1127
|
vErrors = [err15];
|
|
550
1128
|
} else {
|
|
@@ -556,7 +1134,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
556
1134
|
if (data.parser_version !== void 0) {
|
|
557
1135
|
let data8 = data.parser_version;
|
|
558
1136
|
if (data8 !== null && typeof data8 !== "string") {
|
|
559
|
-
const err16 = { instancePath: instancePath + "/parser_version", schemaPath: "#/properties/parser_version/type", keyword: "type", params: { type:
|
|
1137
|
+
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" };
|
|
560
1138
|
if (vErrors === null) {
|
|
561
1139
|
vErrors = [err16];
|
|
562
1140
|
} else {
|
|
@@ -568,7 +1146,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
568
1146
|
if (data.provenance !== void 0) {
|
|
569
1147
|
let data9 = data.provenance;
|
|
570
1148
|
if (data9 !== null && typeof data9 !== "string") {
|
|
571
|
-
const err17 = { instancePath: instancePath + "/provenance", schemaPath: "#/properties/provenance/type", keyword: "type", params: { type:
|
|
1149
|
+
const err17 = { instancePath: instancePath + "/provenance", schemaPath: "#/properties/provenance/type", keyword: "type", params: { type: schema35.properties.provenance.type }, message: "must be null,string" };
|
|
572
1150
|
if (vErrors === null) {
|
|
573
1151
|
vErrors = [err17];
|
|
574
1152
|
} else {
|
|
@@ -577,7 +1155,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
577
1155
|
errors++;
|
|
578
1156
|
}
|
|
579
1157
|
if (!(data9 === "legacy" || data9 === "reingested" || data9 === null)) {
|
|
580
|
-
const err18 = { instancePath: instancePath + "/provenance", schemaPath: "#/properties/provenance/enum", keyword: "enum", params: { allowedValues:
|
|
1158
|
+
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" };
|
|
581
1159
|
if (vErrors === null) {
|
|
582
1160
|
vErrors = [err18];
|
|
583
1161
|
} else {
|
|
@@ -589,7 +1167,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
589
1167
|
if (data.qc_status !== void 0) {
|
|
590
1168
|
let data10 = data.qc_status;
|
|
591
1169
|
if (data10 !== null && typeof data10 !== "string") {
|
|
592
|
-
const err19 = { instancePath: instancePath + "/qc_status", schemaPath: "#/properties/qc_status/type", keyword: "type", params: { type:
|
|
1170
|
+
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" };
|
|
593
1171
|
if (vErrors === null) {
|
|
594
1172
|
vErrors = [err19];
|
|
595
1173
|
} else {
|
|
@@ -598,7 +1176,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
598
1176
|
errors++;
|
|
599
1177
|
}
|
|
600
1178
|
if (!(data10 === "clean" || data10 === "flagged" || data10 === "suspect" || data10 === null)) {
|
|
601
|
-
const err20 = { instancePath: instancePath + "/qc_status", schemaPath: "#/properties/qc_status/enum", keyword: "enum", params: { allowedValues:
|
|
1179
|
+
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" };
|
|
602
1180
|
if (vErrors === null) {
|
|
603
1181
|
vErrors = [err20];
|
|
604
1182
|
} else {
|
|
@@ -619,7 +1197,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
619
1197
|
errors++;
|
|
620
1198
|
}
|
|
621
1199
|
if (!(data11 === "awc" || data11 === "ghcnh" || data11 === "iem" || data11 === "ncei")) {
|
|
622
|
-
const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/enum", keyword: "enum", params: { allowedValues:
|
|
1200
|
+
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" };
|
|
623
1201
|
if (vErrors === null) {
|
|
624
1202
|
vErrors = [err22];
|
|
625
1203
|
} else {
|
|
@@ -631,7 +1209,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
631
1209
|
if (data.source_received_at !== void 0) {
|
|
632
1210
|
let data12 = data.source_received_at;
|
|
633
1211
|
if (data12 !== null && typeof data12 !== "string") {
|
|
634
|
-
const err23 = { instancePath: instancePath + "/source_received_at", schemaPath: "#/properties/source_received_at/type", keyword: "type", params: { type:
|
|
1212
|
+
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" };
|
|
635
1213
|
if (vErrors === null) {
|
|
636
1214
|
vErrors = [err23];
|
|
637
1215
|
} else {
|
|
@@ -654,7 +1232,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
654
1232
|
if (data.temp_c !== void 0) {
|
|
655
1233
|
let data14 = data.temp_c;
|
|
656
1234
|
if (data14 !== null && !(typeof data14 == "number")) {
|
|
657
|
-
const err25 = { instancePath: instancePath + "/temp_c", schemaPath: "#/properties/temp_c/type", keyword: "type", params: { type:
|
|
1235
|
+
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" };
|
|
658
1236
|
if (vErrors === null) {
|
|
659
1237
|
vErrors = [err25];
|
|
660
1238
|
} else {
|
|
@@ -672,19 +1250,19 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
672
1250
|
}
|
|
673
1251
|
errors++;
|
|
674
1252
|
}
|
|
675
|
-
|
|
1253
|
+
validate24.errors = vErrors;
|
|
676
1254
|
return errors === 0;
|
|
677
1255
|
}
|
|
678
|
-
|
|
1256
|
+
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 };
|
|
679
1257
|
|
|
680
1258
|
// src/schemas/validators/schema_observation_qc_v1.js
|
|
681
|
-
var schema_observation_qc_v1 =
|
|
682
|
-
var
|
|
683
|
-
function
|
|
1259
|
+
var schema_observation_qc_v1 = validate25;
|
|
1260
|
+
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" };
|
|
1261
|
+
function validate25(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
684
1262
|
;
|
|
685
1263
|
let vErrors = null;
|
|
686
1264
|
let errors = 0;
|
|
687
|
-
const evaluated0 =
|
|
1265
|
+
const evaluated0 = validate25.evaluated;
|
|
688
1266
|
if (evaluated0.dynamicProps) {
|
|
689
1267
|
evaluated0.props = void 0;
|
|
690
1268
|
}
|
|
@@ -767,7 +1345,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
767
1345
|
if (data.as_of_time !== void 0) {
|
|
768
1346
|
let data0 = data.as_of_time;
|
|
769
1347
|
if (data0 !== null && typeof data0 !== "string") {
|
|
770
|
-
const err8 = { instancePath: instancePath + "/as_of_time", schemaPath: "#/properties/as_of_time/type", keyword: "type", params: { type:
|
|
1348
|
+
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" };
|
|
771
1349
|
if (vErrors === null) {
|
|
772
1350
|
vErrors = [err8];
|
|
773
1351
|
} else {
|
|
@@ -779,7 +1357,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
779
1357
|
if (data.detector_metadata !== void 0) {
|
|
780
1358
|
let data1 = data.detector_metadata;
|
|
781
1359
|
if (data1 !== null && typeof data1 !== "string") {
|
|
782
|
-
const err9 = { instancePath: instancePath + "/detector_metadata", schemaPath: "#/properties/detector_metadata/type", keyword: "type", params: { type:
|
|
1360
|
+
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" };
|
|
783
1361
|
if (vErrors === null) {
|
|
784
1362
|
vErrors = [err9];
|
|
785
1363
|
} else {
|
|
@@ -811,7 +1389,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
811
1389
|
errors++;
|
|
812
1390
|
}
|
|
813
1391
|
if (!(data3 === "clean" || data3 === "flagged" || data3 === "suspect")) {
|
|
814
|
-
const err12 = { instancePath: instancePath + "/flag", schemaPath: "#/properties/flag/enum", keyword: "enum", params: { allowedValues:
|
|
1392
|
+
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" };
|
|
815
1393
|
if (vErrors === null) {
|
|
816
1394
|
vErrors = [err12];
|
|
817
1395
|
} else {
|
|
@@ -823,7 +1401,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
823
1401
|
if (data.ingestion_id !== void 0) {
|
|
824
1402
|
let data4 = data.ingestion_id;
|
|
825
1403
|
if (data4 !== null && typeof data4 !== "string") {
|
|
826
|
-
const err13 = { instancePath: instancePath + "/ingestion_id", schemaPath: "#/properties/ingestion_id/type", keyword: "type", params: { type:
|
|
1404
|
+
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" };
|
|
827
1405
|
if (vErrors === null) {
|
|
828
1406
|
vErrors = [err13];
|
|
829
1407
|
} else {
|
|
@@ -835,7 +1413,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
835
1413
|
if (data.observation_kind !== void 0) {
|
|
836
1414
|
let data5 = data.observation_kind;
|
|
837
1415
|
if (data5 !== null && typeof data5 !== "string") {
|
|
838
|
-
const err14 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/type", keyword: "type", params: { type:
|
|
1416
|
+
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" };
|
|
839
1417
|
if (vErrors === null) {
|
|
840
1418
|
vErrors = [err14];
|
|
841
1419
|
} else {
|
|
@@ -844,7 +1422,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
844
1422
|
errors++;
|
|
845
1423
|
}
|
|
846
1424
|
if (!(data5 === "METAR" || data5 === "SPECI" || data5 === null)) {
|
|
847
|
-
const err15 = { instancePath: instancePath + "/observation_kind", schemaPath: "#/properties/observation_kind/enum", keyword: "enum", params: { allowedValues:
|
|
1425
|
+
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" };
|
|
848
1426
|
if (vErrors === null) {
|
|
849
1427
|
vErrors = [err15];
|
|
850
1428
|
} else {
|
|
@@ -867,7 +1445,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
867
1445
|
if (data.parser_name !== void 0) {
|
|
868
1446
|
let data7 = data.parser_name;
|
|
869
1447
|
if (data7 !== null && typeof data7 !== "string") {
|
|
870
|
-
const err17 = { instancePath: instancePath + "/parser_name", schemaPath: "#/properties/parser_name/type", keyword: "type", params: { type:
|
|
1448
|
+
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" };
|
|
871
1449
|
if (vErrors === null) {
|
|
872
1450
|
vErrors = [err17];
|
|
873
1451
|
} else {
|
|
@@ -921,7 +1499,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
921
1499
|
errors++;
|
|
922
1500
|
}
|
|
923
1501
|
if (!(data11 === "awc" || data11 === "ghcnh" || data11 === "iem" || data11 === "ncei")) {
|
|
924
|
-
const err22 = { instancePath: instancePath + "/source", schemaPath: "#/properties/source/enum", keyword: "enum", params: { allowedValues:
|
|
1502
|
+
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" };
|
|
925
1503
|
if (vErrors === null) {
|
|
926
1504
|
vErrors = [err22];
|
|
927
1505
|
} else {
|
|
@@ -950,10 +1528,10 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
950
1528
|
}
|
|
951
1529
|
errors++;
|
|
952
1530
|
}
|
|
953
|
-
|
|
1531
|
+
validate25.errors = vErrors;
|
|
954
1532
|
return errors === 0;
|
|
955
1533
|
}
|
|
956
|
-
|
|
1534
|
+
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 };
|
|
957
1535
|
|
|
958
1536
|
// src/schemas/validators/schema_observation_v1.js
|
|
959
1537
|
var schema_observation_v1 = validate20;
|
|
@@ -1295,13 +1873,13 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1295
1873
|
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 };
|
|
1296
1874
|
|
|
1297
1875
|
// src/schemas/validators/schema_settlement_cli_v1.js
|
|
1298
|
-
var schema_settlement_cli_v1 =
|
|
1299
|
-
var
|
|
1300
|
-
function
|
|
1876
|
+
var schema_settlement_cli_v1 = validate23;
|
|
1877
|
+
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" };
|
|
1878
|
+
function validate23(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
1301
1879
|
;
|
|
1302
1880
|
let vErrors = null;
|
|
1303
1881
|
let errors = 0;
|
|
1304
|
-
const evaluated0 =
|
|
1882
|
+
const evaluated0 = validate23.evaluated;
|
|
1305
1883
|
if (evaluated0.dynamicProps) {
|
|
1306
1884
|
evaluated0.props = void 0;
|
|
1307
1885
|
}
|
|
@@ -1393,7 +1971,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1393
1971
|
errors++;
|
|
1394
1972
|
}
|
|
1395
1973
|
if (!(data0 === "clean" || data0 === "flagged_instrument" || data0 === "flagged_late" || data0 === "flagged_other" || data0 === "missing")) {
|
|
1396
|
-
const err9 = { instancePath: instancePath + "/cli_data_quality", schemaPath: "#/properties/cli_data_quality/enum", keyword: "enum", params: { allowedValues:
|
|
1974
|
+
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" };
|
|
1397
1975
|
if (vErrors === null) {
|
|
1398
1976
|
vErrors = [err9];
|
|
1399
1977
|
} else {
|
|
@@ -1427,7 +2005,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1427
2005
|
if (data.precipitation_in !== void 0) {
|
|
1428
2006
|
let data3 = data.precipitation_in;
|
|
1429
2007
|
if (data3 !== null && !(typeof data3 == "number")) {
|
|
1430
|
-
const err12 = { instancePath: instancePath + "/precipitation_in", schemaPath: "#/properties/precipitation_in/type", keyword: "type", params: { type:
|
|
2008
|
+
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" };
|
|
1431
2009
|
if (vErrors === null) {
|
|
1432
2010
|
vErrors = [err12];
|
|
1433
2011
|
} else {
|
|
@@ -1459,7 +2037,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1459
2037
|
errors++;
|
|
1460
2038
|
}
|
|
1461
2039
|
if (!(data5 === "correction" || data5 === "final" || data5 === "preliminary")) {
|
|
1462
|
-
const err15 = { instancePath: instancePath + "/report_type", schemaPath: "#/properties/report_type/enum", keyword: "enum", params: { allowedValues:
|
|
2040
|
+
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" };
|
|
1463
2041
|
if (vErrors === null) {
|
|
1464
2042
|
vErrors = [err15];
|
|
1465
2043
|
} else {
|
|
@@ -1480,7 +2058,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1480
2058
|
errors++;
|
|
1481
2059
|
}
|
|
1482
2060
|
if (!(data6 === "final" || data6 === "provisional" || data6 === "superseded")) {
|
|
1483
|
-
const err17 = { instancePath: instancePath + "/settlement_finality", schemaPath: "#/properties/settlement_finality/enum", keyword: "enum", params: { allowedValues:
|
|
2061
|
+
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" };
|
|
1484
2062
|
if (vErrors === null) {
|
|
1485
2063
|
vErrors = [err17];
|
|
1486
2064
|
} else {
|
|
@@ -1492,7 +2070,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1492
2070
|
if (data.snowfall_in !== void 0) {
|
|
1493
2071
|
let data7 = data.snowfall_in;
|
|
1494
2072
|
if (data7 !== null && !(typeof data7 == "number")) {
|
|
1495
|
-
const err18 = { instancePath: instancePath + "/snowfall_in", schemaPath: "#/properties/snowfall_in/type", keyword: "type", params: { type:
|
|
2073
|
+
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" };
|
|
1496
2074
|
if (vErrors === null) {
|
|
1497
2075
|
vErrors = [err18];
|
|
1498
2076
|
} else {
|
|
@@ -1526,7 +2104,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1526
2104
|
if (data.temp_max_F !== void 0) {
|
|
1527
2105
|
let data10 = data.temp_max_F;
|
|
1528
2106
|
if (data10 !== null && !(typeof data10 == "number")) {
|
|
1529
|
-
const err21 = { instancePath: instancePath + "/temp_max_F", schemaPath: "#/properties/temp_max_F/type", keyword: "type", params: { type:
|
|
2107
|
+
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" };
|
|
1530
2108
|
if (vErrors === null) {
|
|
1531
2109
|
vErrors = [err21];
|
|
1532
2110
|
} else {
|
|
@@ -1538,7 +2116,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1538
2116
|
if (data.temp_min_F !== void 0) {
|
|
1539
2117
|
let data11 = data.temp_min_F;
|
|
1540
2118
|
if (data11 !== null && !(typeof data11 == "number")) {
|
|
1541
|
-
const err22 = { instancePath: instancePath + "/temp_min_F", schemaPath: "#/properties/temp_min_F/type", keyword: "type", params: { type:
|
|
2119
|
+
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" };
|
|
1542
2120
|
if (vErrors === null) {
|
|
1543
2121
|
vErrors = [err22];
|
|
1544
2122
|
} else {
|
|
@@ -1556,15 +2134,21 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1556
2134
|
}
|
|
1557
2135
|
errors++;
|
|
1558
2136
|
}
|
|
1559
|
-
|
|
2137
|
+
validate23.errors = vErrors;
|
|
1560
2138
|
return errors === 0;
|
|
1561
2139
|
}
|
|
1562
|
-
|
|
2140
|
+
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 };
|
|
1563
2141
|
|
|
1564
2142
|
// src/schemas/validators/format-map.ts
|
|
1565
2143
|
var FORMAT_MAPS = Object.freeze({
|
|
1566
2144
|
"schema.forecast.iem_mos.v1": Object.freeze({
|
|
1567
2145
|
"issued_at": "date-time",
|
|
2146
|
+
"retrieved_at": "date-time",
|
|
2147
|
+
"valid_at": "date-time"
|
|
2148
|
+
}),
|
|
2149
|
+
"schema.forecast.station.v1": Object.freeze({
|
|
2150
|
+
"issued_at": "date-time",
|
|
2151
|
+
"retrieved_at": "date-time",
|
|
1568
2152
|
"valid_at": "date-time"
|
|
1569
2153
|
}),
|
|
1570
2154
|
"schema.observation_ledger.v1": Object.freeze({
|
|
@@ -1591,6 +2175,7 @@ function getFormatMap(schemaId) {
|
|
|
1591
2175
|
// src/schemas/validators/index.ts
|
|
1592
2176
|
var VALIDATORS = {
|
|
1593
2177
|
"schema.forecast.iem_mos.v1": schema_forecast_iem_mos_v1,
|
|
2178
|
+
"schema.forecast.station.v1": schema_forecast_station_v1,
|
|
1594
2179
|
"schema.observation_ledger.v1": schema_observation_ledger_v1,
|
|
1595
2180
|
"schema.observation_qc.v1": schema_observation_qc_v1,
|
|
1596
2181
|
"schema.observation.v1": schema_observation_v1,
|