@idfkit/schemas¶
EnergyPlus epJSON schemas for all 17 supported versions, content-addressed so that the whole set is around 1 MB gzipped rather than 11.9 MB. See Content-addressed schemas for why, and Slim schema format for what a definition contains.
@idfkit/core re-exports Schema, SchemaBundle, httpSource, and the slim
type definitions, so most applications never import this package directly.
Portable surface¶
BlobStore
¶
Schema
¶
A single EnergyPlus version's schema, backed by a shared blob store.
Type definitions are hydrated lazily and cached in the store, so loading a second version only pays for the definitions that version does not already share with one in memory. In practice that is a couple hundred out of 858.
SchemaBundle
¶
Loads schemas from a bundle, sharing one blob store across every version.
Hold one of these for the lifetime of the process. Loading 26.1.0 and then 9.4.0 costs far less than twice one version, because most definitions are byte-identical and already hydrated.
latest
¶
load
¶
loaded
¶
loadProse
¶
Load the explanatory prose this bundle's manifests index into.
One pool serves every version: build.mjs deduplicates the memos and notes
of all eighteen schemas into a single array and the manifests carry indices
into it, so there is no version to pass here.
It is a separate call rather than part of load because the two are wanted
at different moments by different callers. Parsing a model needs the records
and never needs a sentence of English; describing a type for a reader needs
both. Keeping the fetch separate is what lets the parse path stay unaware the
pool exists, which check-bundle-purity.mjs asserts by building a minimal
read-and-write graph and failing on any input under data/.
Repeat calls return the same array; concurrent calls share one read.
prose
¶
The prose pool if it has been loaded, or undefined. Synchronous by design.
The counterpart of loaded, and it exists for the same reason. Everything
that reads prose is synchronous: describeObjectType takes a pool rather
than fetching one, and every answer in @idfkit/language is a pure function
so an editor server can answer a cursor without holding a thread. A consumer
calls loadProse once when a document arrives and reads this on the request
path. Without the pair, a caller would either await inside a path it keeps
synchronous or build a second cache beside the one this class already has.
versions
¶
BundleIndex
¶
BundleSource
¶
Where bundle files come from.
The only runtime-specific part of this package. Node reads from disk, the
browser fetches over HTTP, and a bundler-driven app can supply its own
resolver backed by import(). Everything above this interface is portable.
read
¶
SchemaDelta
¶
SlimExtensible
¶
SlimField
¶
auto
¶
Field is an anyOf of a numeric branch and a string branch, in that order.
Set for every one of the 13060 such fields across the 17 bundled versions.
The numeric branch's type, enum and bounds are hoisted onto this record;
the string branch survives as se.
d
¶
Schema default, applied on write when the field is absent.
e
¶
Permitted values for a choice field.
Numbers, not strings, on the 68 fields across the versions that express a
choice numerically (e: [1, 3] on Site:GroundDomain:Slab.phase). Compare
strings case-insensitively and numbers by value.
eb
¶
The enum also accepts the empty string.
e is filtered of '' because it is what validation checks against, and
admitting the blank there would change what validate() accepts. Python's
describe_object_type reports it, so the description path puts it back
from this flag and validation never sees it.
A flag rather than an index because the blank is first every time: across
all 17 bundled schemas, all 21,962 blank-bearing enums carry it at position
0. bundle.test.ts asserts that, so a schema that breaks it fails loudly
instead of silently reordering a choice list.
max
¶
min
¶
n
¶
The field's explanatory sentence, as an index into the prose pool.
An index, not the text: 3,837 distinct field notes are shared across about
119,000 occurrences. Resolve it against docs.json.gz, which is loaded on
demand and is never on the parse path.
ol
¶
Names of reference lists this field points into (i.e. it is a foreign key).
rc
¶
Value is case-sensitive and must not be normalized.
ref
¶
Names of reference lists this field contributes to (i.e. it is a key).
se
¶
String literals the anyOf string branch accepts, verbatim from the schema.
Only meaningful together with auto. Absent while auto is set means the
string branch carries no enum at all and ANY string is legal there, which is
the shape of 646 fields including Schedule:Compact's extensible field.
That is why the empty string is kept here rather than filtered out the way
e filters it: se: [''] (the whole string branch of the 68 fields whose
number branch carries a numeric enum) and no se at all mean the opposite
of one another.
The sentinel is not a constant: 10565 fields take Autosize and 1781 take
Autocalculate, so a validator that accepts either everywhere accepts a
value EnergyPlus rejects.
t
¶
Storage class.
u
¶
SI units, used by the unit-conversion helpers.
xmax
¶
Exclusive maximum. Number or boolean, exactly as xmin.
xmin
¶
Exclusive minimum, in whichever JSON Schema dialect the version shipped.
A number is the bound itself (draft-06+, 9.6.0 onwards). The boolean true
qualifies the sibling min, making it exclusive (draft-04, 8.9.0 through
9.5.0). Measured across the bundled schemas: xmin is boolean 9013 times
in the older seven versions and numeric 13840 times in the newer ten;
xmax behaves identically, and no version mixes the two. Branch on the
value's type, never on the version.
SlimType
¶
anon
¶
Object has no name field at all, e.g. Version, GlobalGeometryRules.
f
¶
All field names in IDF positional order, from legacy_idd.fields.
fo
¶
Field names in declaration order, for the types where f cannot give it.
f holds only the name for exactly three types in every bundled version,
so the description path would otherwise fall back to the key order of p —
which the content-addressing serializer has sorted alphabetically. This
records the order that sort destroys, and is emitted only for those three.
g
¶
IDD group, e.g. Thermal Zones and Surfaces.
m
¶
The type's explanatory sentence, as an index into the prose pool.
See SlimField.n. Present for 845 of 858 types in 26.1.0; a type with no
memo in the source schema has none here, and both languages report nothing
rather than a placeholder.
nref
¶
Reference lists the object's name contributes to.
nreq
¶
Object's name is required.
p
¶
Field definitions, keyed by epJSON field name.
r
¶
Required field names.
s
¶
Object is a singleton (maxProperties: 1), e.g. Version, Building.
x
¶
Extensible group definition, if the object has one.
FieldKind
¶
Field storage class, mirroring how the IDF writer must format the value.
Manifest
¶
A manifest maps object type name to a blob hash in the shared store.
ProsePool
¶
The schema's explanatory prose, deduplicated across every bundled version.
A plain array of strings, indexed by SlimType.m and SlimField.n. It lives
here rather than beside the code that reads it because THE INDICES ARE ONLY
MEANINGFUL AGAINST THE MANIFESTS BUILT IN THE SAME RUN: build.mjs writes
docs.json and the manifests together, and a pool paired with manifests from
a different build resolves every sentence to the wrong one, silently. Keeping
the type and the loader on SchemaBundle is what makes that pairing hard to
get wrong.