@reso-standards/reso-common
v0.1.2
Published
Universal (browser + Node) RESO metadata model and projections — the shared ResoMetadata shape, pure helpers and the EDMX generator. Zero runtime dependencies, no Node APIs.
Readme
@reso-standards/reso-common
Universal RESO metadata model and projections — the shared building blocks that the RESO certification tooling, the reference server and the browser clients all build on, so there is one source of truth for the RESO metadata shape instead of each tool carrying its own copy.
Zero runtime dependencies. The main entry point uses no Node or DOM APIs, so it runs unchanged in the browser and on the server.
Install
npm install @reso-standards/reso-commonWhat's inside
- Metadata model — the
ResoMetadatashape (ResoField,ResoLookup,ResoAnnotation, …) describing resources, fields, lookups and annotations. - Pure helpers —
isEnumType,getFieldsForResource,getLookupsForType,getKeyFieldForResource. - EDMX generation —
generateEdmx, producing OData CSDL (EDMX) from a metadata report, in both the EnumType and the string / Lookup Resource representations. - Metadata map —
buildMetadataMap, projecting a metadata report into the nestedresource → field → entrymap used by the variations and validation passes. - Data Dictionary reference metadata — the DD reference JSON for 1.7, 2.0 and 2.1, available via the
reference-metadatasubpath.
Usage
import { generateEdmx, buildMetadataMap, getFieldsForResource } from '@reso-standards/reso-common';
const edmx = generateEdmx(metadataReport);
const { metadataMap } = buildMetadataMap(metadataReport);
const propertyFields = getFieldsForResource(metadataReport, 'Property');Data Dictionary reference metadata is a deep import:
import dd21 from '@reso-standards/reso-common/reference-metadata/dd-2.1.json' with { type: 'json' };License
Real Estate Standards Organization End-user License Agreement (EULA). By using this package you agree to the RESO EULA: https://www.reso.org/eula/. See LICENSE.
