feat(provider): version gelios items response envelope

This commit is contained in:
Codex
2026-07-24 18:52:40 +03:00
parent f0a4fb43c5
commit fe274872e4
9 changed files with 1200 additions and 0 deletions
@@ -6,3 +6,4 @@ export * from "./v8/index.mjs";
export * from "./v9/index.mjs";
export { geliosProviderPackageV10 } from "./v10/index.mjs";
export { geliosProviderPackageV11 } from "./v11/index.mjs";
export { geliosProviderPackageV12 } from "./v12/index.mjs";
@@ -0,0 +1,10 @@
export {
GELIOS_PROVIDER_PACKAGE_ID,
GELIOS_PROVIDER_PACKAGE_VERSION,
GELIOS_UNIT_IDENTITY_DATA_PRODUCT_ID,
GELIOS_UNIT_IDENTITY_DATA_PRODUCT_VERSION,
GELIOS_UNIT_IDENTITY_ONTOLOGY_REVISION,
geliosProviderPackageV12,
} from "./package.mjs";
export { geliosTelemetryFieldRegistryV5 } from "./telemetry-field-registry.mjs";
export { geliosCapabilityCatalogV3 } from "../capability-catalog-v3.mjs";
@@ -0,0 +1,59 @@
import { geliosProviderPackageV11 } from "../v11/package.mjs";
export const GELIOS_PROVIDER_PACKAGE_ID = "gelios.provider.v12";
export const GELIOS_PROVIDER_PACKAGE_VERSION = "12.0.0";
export const GELIOS_UNIT_IDENTITY_DATA_PRODUCT_ID = "fleet.units.identity.current.v1";
export const GELIOS_UNIT_IDENTITY_DATA_PRODUCT_VERSION = "1.0.0";
export const GELIOS_UNIT_IDENTITY_ONTOLOGY_REVISION = "ontology.map.moving_object.v3";
const IDENTITY_CAPABILITY_ID = "gelios.units.identity.read";
const IDENTITY_PROFILE_ID = "gelios.units.identity.warm.v1";
const IDENTITY_MAPPING_ID = "gelios.units.to.fleet.units.identity.current.v1";
const IDENTITY_TEMPLATE_ID = "gelios.units.identity.l2.v1";
const value = structuredClone(geliosProviderPackageV11);
value.id = GELIOS_PROVIDER_PACKAGE_ID;
value.version = GELIOS_PROVIDER_PACKAGE_VERSION;
value.manifest = {
...value.manifest,
id: "gelios.provider.manifest.v12",
version: GELIOS_PROVIDER_PACKAGE_VERSION,
};
const identityCapability = value.capabilities.find(
(capability) => capability.id === IDENTITY_CAPABILITY_ID,
);
if (!identityCapability) throw new Error("gelios_v12_identity_capability_missing");
identityCapability.request.response.collectionPaths = [
"items",
...identityCapability.request.response.collectionPaths.filter(
(path) => path !== "items",
),
];
const identityProfile = value.collectionProfiles.find(
(profile) => profile.id === IDENTITY_PROFILE_ID,
);
if (!identityProfile) throw new Error("gelios_v12_identity_profile_missing");
identityProfile.version = GELIOS_PROVIDER_PACKAGE_VERSION;
const identityMapping = value.mappingContracts.find(
(mapping) => mapping.id === IDENTITY_MAPPING_ID,
);
if (!identityMapping) throw new Error("gelios_v12_identity_mapping_missing");
identityMapping.version = GELIOS_PROVIDER_PACKAGE_VERSION;
const identityTemplate = value.l2Templates.find(
(template) => template.id === IDENTITY_TEMPLATE_ID,
);
if (!identityTemplate) throw new Error("gelios_v12_identity_template_missing");
identityTemplate.version = GELIOS_PROVIDER_PACKAGE_VERSION;
export const geliosProviderPackageV12 = deepFreeze(value);
function deepFreeze(input) {
if (!input || typeof input !== "object" || Object.isFrozen(input)) return input;
Object.freeze(input);
for (const child of Object.values(input)) deepFreeze(child);
return input;
}
@@ -0,0 +1,20 @@
import { geliosTelemetryFieldRegistryV4 } from "../v11/telemetry-field-registry.mjs";
import {
GELIOS_PROVIDER_PACKAGE_ID,
GELIOS_PROVIDER_PACKAGE_VERSION,
} from "./package.mjs";
const value = structuredClone(geliosTelemetryFieldRegistryV4);
value.providerPackage = {
id: GELIOS_PROVIDER_PACKAGE_ID,
version: GELIOS_PROVIDER_PACKAGE_VERSION,
};
export const geliosTelemetryFieldRegistryV5 = deepFreeze(value);
function deepFreeze(input) {
if (!input || typeof input !== "object" || Object.isFrozen(input)) return input;
Object.freeze(input);
for (const child of Object.values(input)) deepFreeze(child);
return input;
}