@idfkit/schemas 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Samuel Letellier-Duchesne
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # @idfkit/schemas
2
+
3
+ EnergyPlus epJSON schemas for every supported version, in a form small enough to
4
+ send to a browser.
5
+
6
+ **[Documentation](https://js.idfkit.com/)** ·
7
+ [API reference](https://js.idfkit.com/reference/schemas/) ·
8
+ [Slim schema format](https://js.idfkit.com/reference/slim-schema-format/)
9
+
10
+ ```bash
11
+ npm install @idfkit/schemas
12
+ ```
13
+
14
+ ## Why this exists
15
+
16
+ The raw epJSON schemas are ~10 MB each, 17 of them, 11.9 MB gzipped in total. In
17
+ a Python wheel nobody notices. On a page load it decides your architecture.
18
+
19
+ 87% of object-type definitions are byte-identical across releases: `Zone` has not
20
+ changed since EnergyPlus 8.9. So this package stores each unique definition once,
21
+ keyed by a content hash, and gives every version a manifest mapping type name to
22
+ hash.
23
+
24
+ | | All 17 versions, gzipped |
25
+ | ---------------------------------------- | ------------------------ |
26
+ | Raw epJSON schemas | 11,915 KB |
27
+ | Slimmed (documentation metadata dropped) | 2,922 KB |
28
+ | Content-addressed (this package) | ~1,000 KB |
29
+
30
+ Splitting per version would have been the obvious move and is the wrong one: it
31
+ duplicates the shared 87% across packages and makes cross-version work require
32
+ several installs. The longer argument is in [Content-addressed
33
+ schemas](https://js.idfkit.com/explanation/content-addressed-schemas/).
34
+
35
+ ## Usage
36
+
37
+ ```ts
38
+ import { SchemaBundle, httpSource } from '@idfkit/schemas';
39
+
40
+ const bundle = new SchemaBundle(httpSource('/schemas/'));
41
+
42
+ await bundle.versions(); // ['8.9.0', '9.0.1', ..., '26.1.0']
43
+ await bundle.latest(); // '26.1.0'
44
+
45
+ const schema = await bundle.load('26.1.0');
46
+ schema.resolve('ZONE'); // 'Zone' (IDF type names are case-insensitive)
47
+ schema.get('Zone'); // full definition
48
+ schema.field('Zone', 'x_origin'); // { t: 'n', u: 'm', d: 0 }
49
+ ```
50
+
51
+ In Node, read from the package's own data directory:
52
+
53
+ ```ts
54
+ import { localBundle } from '@idfkit/schemas/node';
55
+
56
+ const schema = await localBundle().load('26.1.0');
57
+ ```
58
+
59
+ In a browser, copy `node_modules/@idfkit/schemas/data` to a served path and point
60
+ `httpSource` at it.
61
+
62
+ ### Cross-version diffs
63
+
64
+ Because definitions are content-addressed, comparing versions is a manifest
65
+ comparison rather than a deep diff of two 10 MB documents:
66
+
67
+ ```ts
68
+ const delta = (await bundle.load('26.1.0')).changedFrom(await bundle.load('9.4.0'));
69
+ delta.added; // types introduced since 9.4
70
+ delta.removed;
71
+ delta.changed;
72
+ ```
73
+
74
+ See [How to compare two EnergyPlus
75
+ versions](https://js.idfkit.com/how-to/compare-versions/).
76
+
77
+ ### Shared identity
78
+
79
+ Definitions are frozen and shared by identity across every version that has the
80
+ same hash:
81
+
82
+ ```ts
83
+ const a = await bundle.load('25.2.0');
84
+ const b = await bundle.load('26.1.0');
85
+ a.get('Zone') === b.get('Zone'); // true
86
+ ```
87
+
88
+ `@idfkit/core` uses that to give both versions the same object prototype, so
89
+ mixed-version work stays monomorphic.
90
+
91
+ ## What is in the slim format
92
+
93
+ Everything needed to parse, write, validate, and resolve references: field order,
94
+ storage class, reference lists, choice values, defaults, bounds, units,
95
+ extensible groups, singleton and anonymous flags.
96
+
97
+ Deliberately dropped: `note`, `memo`, `ip-units`, and `field_info`. That is
98
+ documentation metadata and most of the weight, and it is on the critical path of
99
+ every parse. Tooling that renders documentation should read the source schemas.
100
+
101
+ Keys are single letters because this file is parsed on every cold start. The full
102
+ key-by-key description is in [Slim schema
103
+ format](https://js.idfkit.com/reference/slim-schema-format/).
104
+
105
+ ## Regenerating
106
+
107
+ See [CONTRIBUTING.md](../../CONTRIBUTING.md#regenerating-the-schema-bundle).
108
+ Hashes are computed from a canonical serialization and must stay stable across
109
+ rebuilds.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,47 @@
1
+ import { Schema } from './schema.js';
2
+ export { BlobStore, Schema } from './schema.js';
3
+ export type { SchemaDelta } from './schema.js';
4
+ export type { BundleIndex, FieldKind, Manifest, SlimExtensible, SlimField, SlimType, } from './types.js';
5
+ /**
6
+ * Where bundle files come from.
7
+ *
8
+ * The only runtime-specific part of this package. Node reads from disk, the
9
+ * browser fetches over HTTP, and a bundler-driven app can supply its own
10
+ * resolver backed by `import()`. Everything above this interface is portable.
11
+ */
12
+ export interface BundleSource {
13
+ read(fileName: string): Promise<unknown>;
14
+ }
15
+ /**
16
+ * Fetch-based source, for browsers and any runtime with global `fetch`.
17
+ *
18
+ * Reads the gzipped bundle and inflates it with `DecompressionStream`, which is
19
+ * baseline-available in browsers. That keeps the served payload at roughly 1 MB
20
+ * for all 17 versions instead of the ~6 MB the raw JSON would cost, and it does
21
+ * not depend on the host serving the right `Content-Encoding`.
22
+ */
23
+ export declare function httpSource(baseUrl: string): BundleSource;
24
+ /**
25
+ * Loads schemas from a bundle, sharing one blob store across every version.
26
+ *
27
+ * Hold one of these for the lifetime of the process. Loading 26.1.0 and then
28
+ * 9.4.0 costs far less than twice one version, because most definitions are
29
+ * byte-identical and already hydrated.
30
+ */
31
+ export declare class SchemaBundle {
32
+ #private;
33
+ constructor(source: BundleSource);
34
+ /** Versions this bundle can serve, oldest first. */
35
+ versions(): Promise<readonly string[]>;
36
+ /** The newest version in the bundle. */
37
+ latest(): Promise<string>;
38
+ /**
39
+ * Load one version's schema.
40
+ *
41
+ * Repeat calls return the same instance; concurrent calls share one fetch.
42
+ */
43
+ load(version: string): Promise<Schema>;
44
+ /** A version already loaded, or undefined. Synchronous by design. */
45
+ loaded(version: string): Schema | undefined;
46
+ }
47
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACR,cAAc,EACd,SAAS,EACT,QAAQ,GACT,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAexD;AAED;;;;;;GAMG;AACH,qBAAa,YAAY;;gBAQX,MAAM,EAAE,YAAY;IAIhC,oDAAoD;IAC9C,QAAQ,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;IAI5C,wCAAwC;IAClC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAO/B;;;;OAIG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAY5C,qEAAqE;IACrE,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CA4B5C"}
package/dist/index.js ADDED
@@ -0,0 +1,96 @@
1
+ import { BlobStore, Schema } from './schema.js';
2
+ export { BlobStore, Schema } from './schema.js';
3
+ /**
4
+ * Fetch-based source, for browsers and any runtime with global `fetch`.
5
+ *
6
+ * Reads the gzipped bundle and inflates it with `DecompressionStream`, which is
7
+ * baseline-available in browsers. That keeps the served payload at roughly 1 MB
8
+ * for all 17 versions instead of the ~6 MB the raw JSON would cost, and it does
9
+ * not depend on the host serving the right `Content-Encoding`.
10
+ */
11
+ export function httpSource(baseUrl) {
12
+ const base = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;
13
+ return {
14
+ async read(fileName) {
15
+ const response = await fetch(new URL(`${fileName}.gz`, base));
16
+ if (!response.ok) {
17
+ throw new Error(`Failed to load ${fileName}.gz: ${response.status} ${response.statusText}`);
18
+ }
19
+ if (response.body === null) {
20
+ throw new Error(`Empty response for ${fileName}.gz`);
21
+ }
22
+ const stream = response.body.pipeThrough(new DecompressionStream('gzip'));
23
+ return JSON.parse(await new Response(stream).text());
24
+ },
25
+ };
26
+ }
27
+ /**
28
+ * Loads schemas from a bundle, sharing one blob store across every version.
29
+ *
30
+ * Hold one of these for the lifetime of the process. Loading 26.1.0 and then
31
+ * 9.4.0 costs far less than twice one version, because most definitions are
32
+ * byte-identical and already hydrated.
33
+ */
34
+ export class SchemaBundle {
35
+ #source;
36
+ #index;
37
+ #store;
38
+ #schemas = new Map();
39
+ /** In-flight loads, so concurrent callers share one request. */
40
+ #pending = new Map();
41
+ constructor(source) {
42
+ this.#source = source;
43
+ }
44
+ /** Versions this bundle can serve, oldest first. */
45
+ async versions() {
46
+ return (await this.#loadIndex()).versions;
47
+ }
48
+ /** The newest version in the bundle. */
49
+ async latest() {
50
+ const versions = await this.versions();
51
+ const last = versions.at(-1);
52
+ if (last === undefined)
53
+ throw new Error('Schema bundle contains no versions');
54
+ return last;
55
+ }
56
+ /**
57
+ * Load one version's schema.
58
+ *
59
+ * Repeat calls return the same instance; concurrent calls share one fetch.
60
+ */
61
+ async load(version) {
62
+ const cached = this.#schemas.get(version);
63
+ if (cached !== undefined)
64
+ return cached;
65
+ const inFlight = this.#pending.get(version);
66
+ if (inFlight !== undefined)
67
+ return inFlight;
68
+ const promise = this.#load(version).finally(() => this.#pending.delete(version));
69
+ this.#pending.set(version, promise);
70
+ return promise;
71
+ }
72
+ /** A version already loaded, or undefined. Synchronous by design. */
73
+ loaded(version) {
74
+ return this.#schemas.get(version);
75
+ }
76
+ async #load(version) {
77
+ const index = await this.#loadIndex();
78
+ const fileName = index.manifests[version];
79
+ if (fileName === undefined) {
80
+ throw new Error(`EnergyPlus ${version} is not in this bundle. Available: ${index.versions.join(', ')}`);
81
+ }
82
+ if (this.#store === undefined) {
83
+ const raw = (await this.#source.read('types.json'));
84
+ this.#store ??= new BlobStore(raw);
85
+ }
86
+ const manifest = (await this.#source.read(fileName));
87
+ const schema = new Schema(version, manifest, this.#store);
88
+ this.#schemas.set(version, schema);
89
+ return schema;
90
+ }
91
+ async #loadIndex() {
92
+ this.#index ??= (await this.#source.read('index.json'));
93
+ return this.#index;
94
+ }
95
+ }
96
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,E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AG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,cAAc,OAAO,sCAAsC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACvF,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAA6B,CAAC;YAChF,IAAI,CAAC,MAAM,KAAK,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC;QACrC,CAAC;QAED,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAa,CAAC;QACjE,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAgB,CAAC;QACvE,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
package/dist/node.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { SchemaBundle, type BundleSource } from './index.js';
2
+ /**
3
+ * Filesystem source reading the bundle shipped inside this package.
4
+ *
5
+ * Inflates in-process: the bundle is ~1 MB gzipped against ~6 MB raw, and
6
+ * gunzip costs less than the extra disk read.
7
+ */
8
+ export declare function nodeSource(dataDir?: string): BundleSource;
9
+ /** A bundle backed by this package's own data directory. */
10
+ export declare function localBundle(dataDir?: string): SchemaBundle;
11
+ /**
12
+ * Read one bundle file synchronously.
13
+ *
14
+ * Node-only escape hatch for CLIs and build scripts where an async schema load
15
+ * would force the whole call stack to become async for no benefit. Library code
16
+ * on the portable path should use `SchemaBundle.load`.
17
+ */
18
+ export declare function readBundleFileSync(fileName: string, dataDir?: string): unknown;
19
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI7D;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,MAAiB,GAAG,YAAY,CAOnE;AAED,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,MAAiB,GAAG,OAAO,CAGxF"}
package/dist/node.js ADDED
@@ -0,0 +1,37 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { readFileSync } from 'node:fs';
3
+ import { dirname, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { gunzipSync } from 'node:zlib';
6
+ import { SchemaBundle } from './index.js';
7
+ const DATA_DIR = join(dirname(fileURLToPath(import.meta.url)), '..', 'data');
8
+ /**
9
+ * Filesystem source reading the bundle shipped inside this package.
10
+ *
11
+ * Inflates in-process: the bundle is ~1 MB gzipped against ~6 MB raw, and
12
+ * gunzip costs less than the extra disk read.
13
+ */
14
+ export function nodeSource(dataDir = DATA_DIR) {
15
+ return {
16
+ async read(fileName) {
17
+ const gz = await readFile(join(dataDir, `${fileName}.gz`));
18
+ return JSON.parse(gunzipSync(gz).toString('utf8'));
19
+ },
20
+ };
21
+ }
22
+ /** A bundle backed by this package's own data directory. */
23
+ export function localBundle(dataDir) {
24
+ return new SchemaBundle(nodeSource(dataDir));
25
+ }
26
+ /**
27
+ * Read one bundle file synchronously.
28
+ *
29
+ * Node-only escape hatch for CLIs and build scripts where an async schema load
30
+ * would force the whole call stack to become async for no benefit. Library code
31
+ * on the portable path should use `SchemaBundle.load`.
32
+ */
33
+ export function readBundleFileSync(fileName, dataDir = DATA_DIR) {
34
+ const gz = readFileSync(join(dataDir, `${fileName}.gz`));
35
+ return JSON.parse(gunzipSync(gz).toString('utf8'));
36
+ }
37
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAqB,MAAM,YAAY,CAAC;AAE7D,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,UAAkB,QAAQ;IACnD,OAAO;QACL,KAAK,CAAC,IAAI,CAAC,QAAQ;YACjB,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC;YAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAY,CAAC;QAChE,CAAC;KACF,CAAC;AACJ,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,UAAkB,QAAQ;IAC7E,MAAM,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAY,CAAC;AAChE,CAAC"}
@@ -0,0 +1,60 @@
1
+ import type { Manifest, SlimField, SlimType } from './types.js';
2
+ /**
3
+ * A single EnergyPlus version's schema, backed by a shared blob store.
4
+ *
5
+ * Type definitions are hydrated lazily and cached in the store, so loading a
6
+ * second version only pays for the definitions that version does not already
7
+ * share with one in memory. In practice that is a couple hundred out of 858.
8
+ */
9
+ export declare class Schema {
10
+ #private;
11
+ readonly version: string;
12
+ constructor(version: string, manifest: Manifest, store: BlobStore);
13
+ /** Canonical object type names, in schema order. */
14
+ get typeNames(): readonly string[];
15
+ /** Whether this version defines the given object type. Case-insensitive. */
16
+ has(typeName: string): boolean;
17
+ /**
18
+ * Resolve a possibly mis-cased type name to its canonical spelling.
19
+ *
20
+ * IDF is case-insensitive on type names and real files are inconsistent
21
+ * (`ZONE`, `Zone`, `zone` all appear in the wild), so every lookup path goes
22
+ * through here rather than trusting the input.
23
+ */
24
+ resolve(typeName: string): string | undefined;
25
+ /** Definition for an object type, or undefined if this version lacks it. */
26
+ get(typeName: string): SlimType | undefined;
27
+ /** Definition for an object type, throwing if absent. */
28
+ require(typeName: string): SlimType;
29
+ /** Field definition for a type, or undefined. */
30
+ field(typeName: string, fieldName: string): SlimField | undefined;
31
+ /**
32
+ * Object type names whose definition hash differs from `other`.
33
+ *
34
+ * Because definitions are content-addressed this is a manifest comparison,
35
+ * not a deep diff of two 10 MB documents, which is what makes cross-version
36
+ * work (migration planning, "what changed in 25.2") cheap.
37
+ */
38
+ changedFrom(other: Schema): SchemaDelta;
39
+ }
40
+ export interface SchemaDelta {
41
+ /** Types present in this version but not the other. */
42
+ added: string[];
43
+ /** Types present in the other version but not this one. */
44
+ removed: string[];
45
+ /** Types present in both, with a differing definition. */
46
+ changed: string[];
47
+ }
48
+ /**
49
+ * Shared, deduplicated store of object-type definitions.
50
+ *
51
+ * One instance is shared by every Schema loaded from the same bundle, which is
52
+ * what makes multi-version documents in a single process cheap.
53
+ */
54
+ export declare class BlobStore {
55
+ #private;
56
+ constructor(raw: Record<string, SlimType>);
57
+ hydrate(hash: string): SlimType;
58
+ get size(): number;
59
+ }
60
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhE;;;;;;GAMG;AACH,qBAAa,MAAM;;IACjB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAQb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS;IAMjE,oDAAoD;IACpD,IAAI,SAAS,IAAI,SAAS,MAAM,EAAE,CAGjC;IAED,4EAA4E;IAC5E,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI9B;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAM7C,4EAA4E;IAC5E,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAM3C,yDAAyD;IACzD,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ;IAQnC,iDAAiD;IACjD,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIjE;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;CAgBxC;AAED,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;GAKG;AACH,qBAAa,SAAS;;gBAIR,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC;IAIzC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAa/B,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
package/dist/schema.js ADDED
@@ -0,0 +1,116 @@
1
+ /**
2
+ * A single EnergyPlus version's schema, backed by a shared blob store.
3
+ *
4
+ * Type definitions are hydrated lazily and cached in the store, so loading a
5
+ * second version only pays for the definitions that version does not already
6
+ * share with one in memory. In practice that is a couple hundred out of 858.
7
+ */
8
+ export class Schema {
9
+ version;
10
+ #manifest;
11
+ #store;
12
+ #typeNames;
13
+ /** Lowercased type name -> canonical type name, built on first lookup miss. */
14
+ #lookup;
15
+ constructor(version, manifest, store) {
16
+ this.version = version;
17
+ this.#manifest = manifest;
18
+ this.#store = store;
19
+ }
20
+ /** Canonical object type names, in schema order. */
21
+ get typeNames() {
22
+ this.#typeNames ??= Object.keys(this.#manifest);
23
+ return this.#typeNames;
24
+ }
25
+ /** Whether this version defines the given object type. Case-insensitive. */
26
+ has(typeName) {
27
+ return this.resolve(typeName) !== undefined;
28
+ }
29
+ /**
30
+ * Resolve a possibly mis-cased type name to its canonical spelling.
31
+ *
32
+ * IDF is case-insensitive on type names and real files are inconsistent
33
+ * (`ZONE`, `Zone`, `zone` all appear in the wild), so every lookup path goes
34
+ * through here rather than trusting the input.
35
+ */
36
+ resolve(typeName) {
37
+ if (Object.hasOwn(this.#manifest, typeName))
38
+ return typeName;
39
+ this.#lookup ??= new Map(this.typeNames.map((n) => [n.toLowerCase(), n]));
40
+ return this.#lookup.get(typeName.toLowerCase());
41
+ }
42
+ /** Definition for an object type, or undefined if this version lacks it. */
43
+ get(typeName) {
44
+ const canonical = this.resolve(typeName);
45
+ if (canonical === undefined)
46
+ return undefined;
47
+ return this.#store.hydrate(this.#manifest[canonical]);
48
+ }
49
+ /** Definition for an object type, throwing if absent. */
50
+ require(typeName) {
51
+ const type = this.get(typeName);
52
+ if (type === undefined) {
53
+ throw new Error(`Object type "${typeName}" is not defined in EnergyPlus ${this.version}`);
54
+ }
55
+ return type;
56
+ }
57
+ /** Field definition for a type, or undefined. */
58
+ field(typeName, fieldName) {
59
+ return this.get(typeName)?.p[fieldName];
60
+ }
61
+ /**
62
+ * Object type names whose definition hash differs from `other`.
63
+ *
64
+ * Because definitions are content-addressed this is a manifest comparison,
65
+ * not a deep diff of two 10 MB documents, which is what makes cross-version
66
+ * work (migration planning, "what changed in 25.2") cheap.
67
+ */
68
+ changedFrom(other) {
69
+ const mine = this.#manifest;
70
+ const theirs = other.#manifest;
71
+ const added = [];
72
+ const removed = [];
73
+ const changed = [];
74
+ for (const name of Object.keys(mine)) {
75
+ if (!Object.hasOwn(theirs, name))
76
+ added.push(name);
77
+ else if (theirs[name] !== mine[name])
78
+ changed.push(name);
79
+ }
80
+ for (const name of Object.keys(theirs)) {
81
+ if (!Object.hasOwn(mine, name))
82
+ removed.push(name);
83
+ }
84
+ return { added, removed, changed };
85
+ }
86
+ }
87
+ /**
88
+ * Shared, deduplicated store of object-type definitions.
89
+ *
90
+ * One instance is shared by every Schema loaded from the same bundle, which is
91
+ * what makes multi-version documents in a single process cheap.
92
+ */
93
+ export class BlobStore {
94
+ #raw;
95
+ #hydrated = new Map();
96
+ constructor(raw) {
97
+ this.#raw = raw;
98
+ }
99
+ hydrate(hash) {
100
+ let cached = this.#hydrated.get(hash);
101
+ if (cached === undefined) {
102
+ const raw = this.#raw[hash];
103
+ if (raw === undefined)
104
+ throw new Error(`Schema blob ${hash} missing from bundle`);
105
+ // Frozen because the same object is handed to every version that shares
106
+ // this hash; a mutation would silently corrupt unrelated versions.
107
+ cached = Object.freeze(raw);
108
+ this.#hydrated.set(hash, cached);
109
+ }
110
+ return cached;
111
+ }
112
+ get size() {
113
+ return Object.keys(this.#raw).length;
114
+ }
115
+ }
116
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACR,OAAO,CAAS;IAEzB,SAAS,CAAW;IACpB,MAAM,CAAY;IAClB,UAAU,CAAuB;IACjC,+EAA+E;IAC/E,OAAO,CAAkC;IAEzC,YAAY,OAAe,EAAE,QAAkB,EAAE,KAAgB;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,oDAAoD;IACpD,IAAI,SAAS;QACX,IAAI,CAAC,UAAU,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,4EAA4E;IAC5E,GAAG,CAAC,QAAgB;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,QAAgB;QACtB,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC;YAAE,OAAO,QAAQ,CAAC;QAC7D,IAAI,CAAC,OAAO,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAA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,CAAC,CAAC,MAAM,CAAC;IACvC,CAAC;CACF"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Slim schema representation.
3
+ *
4
+ * This is deliberately NOT the raw epJSON schema. Keys are single letters and
5
+ * documentation metadata (`note`, `ip-units`, `field_info`) is dropped, because
6
+ * this bundle is on the critical path of every parse and, in a browser, every
7
+ * page load. Human-facing metadata lives in `@idfkit/schemas/docs`, which only
8
+ * tooling that renders documentation needs to pull in.
9
+ */
10
+ /** Field storage class, mirroring how the IDF writer must format the value. */
11
+ export type FieldKind =
12
+ /** Alpha: written verbatim. */
13
+ 'a'
14
+ /** Real: written with a decimal point preserved. */
15
+ | 'n'
16
+ /** Integer: written without a decimal point. */
17
+ | 'i'
18
+ /** Extensible array wrapper. */
19
+ | 'arr';
20
+ export interface SlimField {
21
+ /** Storage class. */
22
+ t: FieldKind;
23
+ /** Field accepts `Autosize` / `Autocalculate` in addition to a number. */
24
+ auto?: 1;
25
+ /** Names of reference lists this field points *into* (i.e. it is a foreign key). */
26
+ ol?: string[];
27
+ /** Names of reference lists this field contributes *to* (i.e. it is a key). */
28
+ ref?: string[];
29
+ /** Permitted values for a choice field. */
30
+ e?: string[];
31
+ /** Schema default, applied on write when the field is absent. */
32
+ d?: string | number;
33
+ min?: number;
34
+ max?: number;
35
+ /** Exclusive minimum. */
36
+ xmin?: number;
37
+ /** Exclusive maximum. */
38
+ xmax?: number;
39
+ /** SI units, used by the unit-conversion helpers. */
40
+ u?: string;
41
+ /** Value is case-sensitive and must not be normalized. */
42
+ rc?: 1;
43
+ }
44
+ export interface SlimExtensible {
45
+ /** epJSON key holding the array, e.g. `vertices`. */
46
+ key: string;
47
+ /** Field names inside each repeat group, in IDF order. */
48
+ fields: string[];
49
+ /** Definitions for the inner fields, from the array's `items`. */
50
+ p: Record<string, SlimField>;
51
+ }
52
+ export interface SlimType {
53
+ /** All field names in IDF positional order, from `legacy_idd.fields`. */
54
+ f: string[];
55
+ /** Field definitions, keyed by epJSON field name. */
56
+ p: Record<string, SlimField>;
57
+ /** Required field names. */
58
+ r?: string[];
59
+ /** Reference lists the object's *name* contributes to. */
60
+ nref?: string[];
61
+ /** Object's name is required. */
62
+ nreq?: 1;
63
+ /** Object is a singleton (`maxProperties: 1`), e.g. `Version`, `Building`. */
64
+ s?: 1;
65
+ /** Object has no name field at all, e.g. `Version`, `GlobalGeometryRules`. */
66
+ anon?: 1;
67
+ /** Extensible group definition, if the object has one. */
68
+ x?: SlimExtensible;
69
+ /** IDD group, e.g. `Thermal Zones and Surfaces`. */
70
+ g?: string;
71
+ }
72
+ /** A manifest maps object type name to a blob hash in the shared store. */
73
+ export type Manifest = Record<string, string>;
74
+ export interface BundleIndex {
75
+ /** Versions present, as `"26.1.0"` strings, sorted oldest first. */
76
+ versions: string[];
77
+ /** Per-version manifest file names, keyed by version string. */
78
+ manifests: Record<string, string>;
79
+ }
80
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+EAA+E;AAC/E,MAAM,MAAM,SAAS;AACnB,+BAA+B;AAC7B,GAAG;AACL,oDAAoD;GAClD,GAAG;AACL,gDAAgD;GAC9C,GAAG;AACL,gCAAgC;GAC9B,KAAK,CAAC;AAEV,MAAM,WAAW,SAAS;IACxB,qBAAqB;IACrB,CAAC,EAAE,SAAS,CAAC;IACb,0EAA0E;IAC1E,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,oFAAoF;IACpF,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACd,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,2CAA2C;IAC3C,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;IACb,iEAAiE;IACjE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAA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/**
2
+ * Slim schema representation.
3
+ *
4
+ * This is deliberately NOT the raw epJSON schema. Keys are single letters and
5
+ * documentation metadata (`note`, `ip-units`, `field_info`) is dropped, because
6
+ * this bundle is on the critical path of every parse and, in a browser, every
7
+ * page load. Human-facing metadata lives in `@idfkit/schemas/docs`, which only
8
+ * tooling that renders documentation needs to pull in.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@idfkit/schemas",
3
+ "version": "0.0.1",
4
+ "description": "Content-addressed EnergyPlus epJSON schemas for all supported versions",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Samuel Letellier-Duchesne <developers@idfkit.com>",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/idfkit/idfkit-js.git",
11
+ "directory": "packages/schemas"
12
+ },
13
+ "homepage": "https://js.idfkit.com/",
14
+ "bugs": {
15
+ "url": "https://github.com/idfkit/idfkit-js/issues"
16
+ },
17
+ "keywords": [
18
+ "energyplus",
19
+ "epjson",
20
+ "schema",
21
+ "building-energy",
22
+ "simulation"
23
+ ],
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "default": "./dist/index.js"
28
+ },
29
+ "./node": {
30
+ "types": "./dist/node.d.ts",
31
+ "default": "./dist/node.js"
32
+ },
33
+ "./data/*": "./data/*"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "data",
38
+ "LICENSE"
39
+ ],
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "engines": {
44
+ "node": ">=20"
45
+ },
46
+ "scripts": {
47
+ "build": "node scripts/build.mjs && tsc --build"
48
+ }
49
+ }