feat(data-plane): add bounded Gelios telemetry contract

This commit is contained in:
Codex
2026-07-22 11:47:24 +03:00
parent a9b8d71968
commit 4402c9ed25
16 changed files with 432 additions and 13 deletions
@@ -4,6 +4,7 @@ import {
DATA_PRODUCT_PATCH_SCHEMA_VERSION,
DATA_PRODUCT_SNAPSHOT_SCHEMA_VERSION,
isBoundedGeoJsonGeometry,
isBoundedTelemetryReadings,
} from "@nodedc/external-provider-contract/data-plane";
const IDENTIFIER = /^[a-z][a-z0-9._:-]{2,127}$/;
@@ -854,6 +855,7 @@ function assertFieldContractValue(value, contract) {
function fieldContractValueMatchesType(value, type) {
if (type === "string_array") return Array.isArray(value) && value.every((item) => typeof item === "string");
if (type === "telemetry_readings") return isBoundedTelemetryReadings(value);
if (type === "point") return isBoundedGeoJsonGeometry(value, new Set(["Point"]));
if (type === "geometry") return isBoundedGeoJsonGeometry(value);
return typeof value === type && (type !== "number" || Number.isFinite(value));