@ipab/bundle 0.0.0 → 0.1.0-rc.0

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 preset-pnpm-monorepo contributors
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 CHANGED
@@ -1,3 +1,157 @@
1
- # @ipab/bundle
1
+ # Bundle runtime
2
2
 
3
- Bootstrap placeholder only. Real releases start at 0.1.0+.
3
+ `@ipab/bundle` validates immutable UnixFS Content Bundles and their complete
4
+ single-block type definitions. Callers own the block resolver/Store. There is no
5
+ upload, pinning, network schema resolution or Schema Bundle directory.
6
+
7
+ ## One definition
8
+
9
+ The root `.bundle.yaml` is the Bundle type definition, not a pointer to an
10
+ external Schema. JSON-style YAML is legal:
11
+
12
+ ```yaml
13
+ name: Note
14
+ description: ""
15
+ entry:
16
+ path: data.json
17
+ schema:
18
+ type: object
19
+ required: [title]
20
+ properties:
21
+ title:
22
+ type: string
23
+ contentType: application/json
24
+ defaultValue:
25
+ title: Untitled
26
+ ```
27
+
28
+ `name` is a required nonblank string. `description` is an optional string;
29
+ missing descriptions normalize to `""`, while null is rejected. `entry` and all
30
+ its four fields are required; other fields are rejected.
31
+
32
+ - `path` is a safe relative file path from the Bundle root, not a mutable
33
+ initialization suggestion. It cannot collide with `.bundle.yaml` or
34
+ `.bundle-ignore` control paths.
35
+ - `schema` is the self-contained structural JSON Schema for entry data only.
36
+ - `contentType` is exactly `application/json`, `application/yaml` or
37
+ `application/jsonl`.
38
+ - `defaultValue` is logical JSON-compatible initialization data, not file text.
39
+ It must satisfy `schema`; JSONL requires an array.
40
+
41
+ The complete normalized definition is directly encoded as canonical DAG-CBOR
42
+ with a CIDv1/DAG-CBOR/SHA-256 identity. That CID is the Schema-to-App
43
+ registration key. The block contains the definition object, not a JSON string or
44
+ UnixFS wrapper. `encodeSchema` now takes this complete definition, not a bare
45
+ JSON Schema. `openSchema` requires the same complete profile.
46
+
47
+ **The encoded type block must be at most 1 MiB (1,048,576 bytes), inclusive.**
48
+ This is a project protocol ceiling, not a universal IPFS backend claim. There is
49
+ no chunking fallback. `schemaBytes` can lower but cannot bypass the ceiling.
50
+ Source definition text is bounded by operation parsing/manifest budgets, not the
51
+ obsolete 64 KiB pointer-manifest limit.
52
+
53
+ Name, description, schema, fixed path/format and default data all affect type
54
+ identity. Omitted/empty descriptions, object field order, YAML comments and
55
+ source formatting do not. Actual entry data is not part of this type CID. The
56
+ UnixFS root still includes original `.bundle.yaml` bytes, so editing
57
+ comments/formatting can change the content root while preserving type identity.
58
+
59
+ ## Entry validation and opaque resources
60
+
61
+ JSON/YAML decode to one JSON-compatible value. JSONL decodes the complete
62
+ ordered array, including an empty file as `[]`; CRLF and terminal newlines are
63
+ accepted, blank internal lines are not. Duplicate keys, invalid
64
+ UTF-8/surrogates, nonfinite numbers and unsafe integers are rejected. Files are
65
+ not rewritten.
66
+
67
+ The loader verifies the complete selected storage DAG and paths, parses the
68
+ definition, validates default data and validates the actual entry. Resources and
69
+ nested Bundles remain opaque: no business parsing or recursive contracts.
70
+ Strings do not trigger reads; reference interpretation belongs to the App.
71
+
72
+ Type identity is reproducible from the retained `.bundle.yaml`; opening a
73
+ content root never requests an external Schema block. A separately distributed
74
+ type CID still requires its block to be available when explicitly loaded by CID.
75
+
76
+ ## Structural dialect
77
+
78
+ This is a minimal structural profile, not full JSON Schema 2020-12:
79
+
80
+ - single-name `type`: null, boolean, string, number, integer, object, array;
81
+ - `enum`, `const`, `properties`, unique `required`, `additionalProperties`
82
+ (boolean/schema, default true);
83
+ - homogeneous `items` (boolean/schema, default unconstrained);
84
+ - `anyOf` with at least one matching structural branch;
85
+ - `title`, `description`, optional absolute root `$id`;
86
+ - `$defs` and local JSON Pointer `$ref`, including `#`.
87
+
88
+ References identify actual schema nodes in the same entry schema document.
89
+ Tokens use `~0`/`~1`; percent-encoded references, anchors, external/relative
90
+ references and nested `$id` are not supported. All definitions, including unused
91
+ ones, are checked. Productive data recursion is allowed; same-data
92
+ reference/anyOf cycles are rejected.
93
+
94
+ Unknown keywords are rejected, including `$schema`, pattern, scalar constraints,
95
+ tuples, oneOf/allOf, examples/default and `x-content-ref`. Property names and
96
+ enum/const data are not schema nodes. CBOR byte strings and IPLD links are not
97
+ JSON-compatible type-definition data.
98
+
99
+ ## API
100
+
101
+ `validateSchemaValue(definitions, data, { charge, depth })` exposes the same
102
+ structural entry validator used by `openBundle`. Supply definitions from
103
+ `encodeSchema` / `inspectSchema`, parsed JSON-compatible data, a finite work
104
+ budget through `charge`, and a positive validation depth. This validates data
105
+ only; it does not load or verify a storage DAG.
106
+
107
+ `@ipab/bundle/data` provides parsing, canonical JSON, schema encoding and entry
108
+ validation without importing the Store/DAG runtime. Use it for trusted App
109
+ adapters that already receive file access through an IPAB context.
110
+
111
+ ```ts
112
+ import { encodeSchema, openBundle, parseBundleManifest } from "@ipab/bundle";
113
+
114
+ const definition = parseBundleManifest(sourceYamlBytes);
115
+ const type = await encodeSchema(definition);
116
+ const bundle = await openBundle(rootCid, {
117
+ resolveCid: (cid, request) => store.block.get(cid.toString(), request),
118
+ });
119
+ const stream = await bundle.readFile(bundle.manifest.entry.path);
120
+ ```
121
+
122
+ - `parseBundleManifest(bytes, maximum?, charge?)`: parse/normalize the complete
123
+ YAML definition and check its shape. Full schema/default checking happens
124
+ through `inspectBundleSchema`/`encodeSchema`/opening.
125
+ - `inspectBundleSchema(value, options?)`: check complete definition, all schema
126
+ references and default data.
127
+ - `encodeSchema(value, options?)`: return `SchemaBlock` with exact `cid`,
128
+ canonical `bytes`, normalized `manifest`, entry `schema` and pointer index.
129
+ - `openSchema(cid, options)`: verify hash, codec, budgets, canonical normalized
130
+ encoding and the complete profile of one type block.
131
+ - `inspectSchema(value, options?)`: pure low-level entry-schema dialect check;
132
+ it does not encode or publish a standalone type.
133
+ - `openBundle(root, options)`: verify storage, definition, defaults and entry;
134
+ return `kind: "content"`, `manifest`, `schemaKey`, `schema`, `cid`,
135
+ `readFile`.
136
+ - `validateContentBundle(root, schemaBlock, options)`: also require the derived
137
+ type CID to match the explicit validator; never trust its mutable metadata.
138
+ - `canonicalJson`, `parseData`, `safePath`, `bundleLimits`,
139
+ `resolveBundleLimits`, `schemaBlockBytes`.
140
+
141
+ Future `readFile` streams have independent signals, unchanged bytes and
142
+ backpressure/cancellation. Missing blocks still fail after opening. No permanent
143
+ cache, bundle `close`, or resolver ownership transfer is implied.
144
+
145
+ Defaults: whole-operation 64 MiB unique blocks/parsing, 16,384 blocks, 2
146
+ MiB/block, 2,048 files, 100,000 work nodes; JSON/tree/validation depths 64; 8
147
+ MiB/entry file. The type block ceiling is 1 MiB. Overrides must be known
148
+ positive safe integers. Errors preserve code, path, pointer, reference chain and
149
+ cause.
150
+
151
+ ## Breaking change
152
+
153
+ The old `{ entry: { path, schemaCid, contentType } }` pointer manifest and bare
154
+ Schema block profile are removed. Update definitions, rebuild Content/App
155
+ Bundles, and register their new type CIDs. There is no automatic migration.
156
+ Schema Bundle directories, builtin keys, the dedicated Schema Builder and
157
+ `x-content-ref` remain removed.
@@ -0,0 +1,8 @@
1
+ import { CID } from "multiformats/cid";
2
+ import type { BundleLimits, ContentBundle, OpenBundleOptions, SchemaBlock } from "./types.js";
3
+ export declare const bundleLimits: Readonly<BundleLimits>;
4
+ export declare function resolveBundleLimits(overrides?: Partial<BundleLimits>): BundleLimits;
5
+ export declare function openBundle(root: CID, options: OpenBundleOptions): Promise<ContentBundle>;
6
+ export declare function openSchema(root: CID, options: OpenBundleOptions): Promise<SchemaBlock>;
7
+ export declare function validateContentBundle(root: CID, schema: SchemaBlock, options: OpenBundleOptions): Promise<ContentBundle>;
8
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AASvC,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,YAAY,CAa9C,CAAC;AACH,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,YAAY,CAAM,GACpC,YAAY,CAad;AAkUD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,aAAa,CAAC,CAExB;AACD,wBAAsB,UAAU,CAC9B,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,WAAW,CAAC,CA4CtB;AACD,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,aAAa,CAAC,CAExB"}
package/dist/bundle.js ADDED
@@ -0,0 +1,274 @@
1
+ import { ContentError, IpfsStore, openContent } from "@ipab/ipfs-store";
2
+ import { CID } from "multiformats/cid";
3
+ import { ContentBundleError } from "./errors.js";
4
+ import { parseBundleManifest, parseData, safePath } from "./parsing.js";
5
+ import { decodeSchema, encodeSchema, schemaBlockBytes, validateValue, } from "./schema.js";
6
+ export const bundleLimits = Object.freeze({
7
+ bytes: 64 * 1024 * 1024,
8
+ blocks: 16_384,
9
+ blockBytes: 2 * 1024 * 1024,
10
+ parsingBytes: 64 * 1024 * 1024,
11
+ files: 2048,
12
+ depth: 64,
13
+ jsonDepth: 64,
14
+ validationDepth: 64,
15
+ manifestBytes: 64 * 1024 * 1024,
16
+ schemaBytes: schemaBlockBytes,
17
+ documentBytes: 8 * 1024 * 1024,
18
+ nodes: 100_000,
19
+ });
20
+ export function resolveBundleLimits(overrides = {}) {
21
+ const limits = { ...bundleLimits, ...overrides };
22
+ for (const [key, value] of Object.entries(limits))
23
+ if (!Object.hasOwn(bundleLimits, key) ||
24
+ !Number.isSafeInteger(value) ||
25
+ value <= 0)
26
+ throw new ContentBundleError("OPTIONS_INVALID", "Limits must be known positive safe integers.");
27
+ return limits;
28
+ }
29
+ function contextual(cause, path, pointer = "", chain = [], signal) {
30
+ if (cause instanceof ContentBundleError)
31
+ return new ContentBundleError(cause.code, cause.message, cause.path || path, cause.pointer || pointer, [...chain, ...cause.referenceChain], { cause });
32
+ const capacity = (cause instanceof ContentError && cause.code === "capacity_exceeded") ||
33
+ (cause instanceof Error && /capacity exceeded/u.test(cause.message));
34
+ return new ContentBundleError(signal?.aborted
35
+ ? "ABORTED"
36
+ : capacity
37
+ ? "LIMIT_EXCEEDED"
38
+ : "CONTENT_UNAVAILABLE", "Cannot read or verify bundle content.", path, pointer, chain, { cause });
39
+ }
40
+ async function collect(node, maximum) {
41
+ if (node.type === "directory")
42
+ throw new ContentBundleError("CONTENT_INVALID", "Expected a regular file.");
43
+ if (node.size > BigInt(maximum))
44
+ throw new ContentBundleError("LIMIT_EXCEEDED", "File exceeds its parsing byte limit.");
45
+ const parts = [];
46
+ let length = 0;
47
+ for await (const part of node.content()) {
48
+ length += part.byteLength;
49
+ if (length > maximum)
50
+ throw new ContentBundleError("LIMIT_EXCEEDED", "File exceeds its parsing byte limit.");
51
+ parts.push(part);
52
+ }
53
+ const bytes = new Uint8Array(length);
54
+ let offset = 0;
55
+ for (const part of parts) {
56
+ bytes.set(part, offset);
57
+ offset += part.byteLength;
58
+ }
59
+ return bytes;
60
+ }
61
+ function reader(root, files, source, limits) {
62
+ return async (path, request = {}) => {
63
+ safePath(path);
64
+ if (!files.has(path))
65
+ throw new ContentBundleError("CONTENT_UNAVAILABLE", "Bundle file does not exist.", path);
66
+ const lifetime = new AbortController();
67
+ const signal = request.signal
68
+ ? AbortSignal.any([request.signal, lifetime.signal])
69
+ : lifetime.signal;
70
+ let node;
71
+ const seen = new Set();
72
+ let bytesRead = 0;
73
+ try {
74
+ node = await openContent({
75
+ block: {
76
+ get: async (value, options) => {
77
+ const cid = CID.parse(value);
78
+ const bytes = await source.resolveCid(cid, options ?? {});
79
+ const key = cid.toV1().toString();
80
+ if (!seen.has(key)) {
81
+ seen.add(key);
82
+ bytesRead += bytes.byteLength;
83
+ if (bytesRead > limits.bytes || seen.size > limits.blocks)
84
+ throw new ContentBundleError("LIMIT_EXCEEDED", "File stream block/byte budget exceeded.", path);
85
+ }
86
+ return bytes;
87
+ },
88
+ },
89
+ }, `${root.toString()}/${path}`, {
90
+ cacheBlocks: false,
91
+ signal,
92
+ retainedBlocks: new Map(),
93
+ retentionBudget: { bytes: 0, limit: limits.bytes },
94
+ maxBlockBytes: limits.blockBytes,
95
+ maxDagBlocks: limits.blocks,
96
+ depth: limits.depth,
97
+ });
98
+ if (node.type !== "raw" && node.type !== "file")
99
+ throw new ContentBundleError("CONTENT_INVALID", "Expected a file.", path);
100
+ }
101
+ catch (cause) {
102
+ throw contextual(cause, path, "", [], signal);
103
+ }
104
+ const iterator = node.content()[Symbol.asyncIterator]();
105
+ let finished = false;
106
+ const release = async () => {
107
+ if (!finished) {
108
+ finished = true;
109
+ lifetime.abort();
110
+ await iterator.return();
111
+ }
112
+ };
113
+ return new ReadableStream({
114
+ async pull(controller) {
115
+ try {
116
+ signal.throwIfAborted();
117
+ const part = await iterator.next();
118
+ if (part.done) {
119
+ await release();
120
+ controller.close();
121
+ }
122
+ else
123
+ controller.enqueue(Uint8Array.from(part.value));
124
+ }
125
+ catch (cause) {
126
+ const error = contextual(cause, path, "", [], signal);
127
+ try {
128
+ await release();
129
+ }
130
+ finally {
131
+ controller.error(error);
132
+ }
133
+ }
134
+ },
135
+ cancel: release,
136
+ }, { highWaterMark: 0 });
137
+ };
138
+ }
139
+ async function operation(rootCid, options, expected) {
140
+ const limits = resolveBundleLimits(options.limits);
141
+ if (typeof options.resolveCid !== "function")
142
+ throw new ContentBundleError("OPTIONS_INVALID", "A CID block resolver is required.");
143
+ const cid = CID.decode(Uint8Array.from(rootCid.bytes));
144
+ if (cid.code !== 0x70)
145
+ throw new ContentBundleError("CONTENT_INVALID", "Bundle root must be a UnixFS directory CID.");
146
+ const store = IpfsStore.fromClient({
147
+ block: {
148
+ get: async (value, request) => options.resolveCid(CID.parse(value), request ?? {}),
149
+ },
150
+ }, {
151
+ bytes: limits.bytes,
152
+ blocks: limits.blocks,
153
+ blockBytes: limits.blockBytes,
154
+ depth: limits.depth,
155
+ });
156
+ const request = options.signal ? { signal: options.signal } : {};
157
+ const files = new Set();
158
+ const directories = new Set();
159
+ let parsed = 0, work = 0;
160
+ const charge = () => {
161
+ if (options.signal?.aborted)
162
+ throw new ContentBundleError("ABORTED", "Bundle validation cancelled.", "", "", [], { cause: options.signal.reason });
163
+ if (++work > limits.nodes)
164
+ throw new ContentBundleError("LIMIT_EXCEEDED", "Schema/data work budget exceeded.");
165
+ };
166
+ const join = (base, path) => base ? `${base}/${safePath(path)}` : safePath(path);
167
+ const read = (path) => store.read(path ? `${cid.toString()}/${path}` : cid, request);
168
+ const bytesAt = async (path, maximum) => {
169
+ if (!files.has(path))
170
+ throw new ContentBundleError("CONTENT_UNAVAILABLE", "Bundle file does not exist.", path);
171
+ const bytes = await collect(await read(path), maximum);
172
+ parsed += bytes.byteLength;
173
+ if (parsed > limits.parsingBytes)
174
+ throw new ContentBundleError("LIMIT_EXCEEDED", "Parsing byte budget exceeded.", path);
175
+ return bytes;
176
+ };
177
+ const index = async (path, depth) => {
178
+ charge();
179
+ if (depth > limits.depth)
180
+ throw new ContentBundleError("LIMIT_EXCEEDED", "Tree depth exceeded.", path);
181
+ const node = await read(path);
182
+ if (node.type === "directory") {
183
+ if (directories.has(path))
184
+ throw new ContentBundleError("PATH_INVALID", "Duplicate directory.", path);
185
+ directories.add(path);
186
+ for await (const child of node.entries()) {
187
+ if (child.name.includes("/"))
188
+ throw new ContentBundleError("PATH_INVALID", "Unsafe directory name.", path);
189
+ await index(join(path, child.name), depth + 1);
190
+ }
191
+ }
192
+ else {
193
+ if (!path || files.has(path))
194
+ throw new ContentBundleError("PATH_INVALID", "Invalid or duplicate file.", path);
195
+ if (files.size >= limits.files)
196
+ throw new ContentBundleError("LIMIT_EXCEEDED", "File count exceeded.", path);
197
+ files.add(path);
198
+ }
199
+ };
200
+ try {
201
+ await store.prepare(cid, request);
202
+ await index("", 0);
203
+ const manifest = parseBundleManifest(await bytesAt(".bundle.yaml", limits.manifestBytes), limits.manifestBytes, charge);
204
+ const schema = await encodeSchema(manifest, {
205
+ nodes: limits.nodes,
206
+ depth: limits.validationDepth,
207
+ jsonDepth: limits.jsonDepth,
208
+ schemaBytes: limits.schemaBytes,
209
+ charge,
210
+ });
211
+ if (expected && !schema.cid.equals(expected.cid))
212
+ throw new ContentBundleError("SCHEMA_INVALID", "Schema CID differs from the explicit validator.");
213
+ const path = manifest.entry.path;
214
+ try {
215
+ const value = parseData(await bytesAt(path, limits.documentBytes), manifest.entry.contentType, limits.nodes, limits.jsonDepth, charge);
216
+ validateValue(schema, value, { charge, depth: limits.validationDepth });
217
+ }
218
+ catch (cause) {
219
+ throw contextual(cause, path, "", [], options.signal);
220
+ }
221
+ return Object.freeze({
222
+ kind: "content",
223
+ get cid() {
224
+ return CID.decode(Uint8Array.from(cid.bytes));
225
+ },
226
+ manifest,
227
+ schemaKey: schema.cid.toString(),
228
+ schema,
229
+ readFile: reader(cid, files, options, limits),
230
+ });
231
+ }
232
+ catch (cause) {
233
+ throw contextual(cause, cid.toString(), "", [], options.signal);
234
+ }
235
+ finally {
236
+ await store.close();
237
+ }
238
+ }
239
+ export async function openBundle(root, options) {
240
+ return operation(root, options);
241
+ }
242
+ export async function openSchema(root, options) {
243
+ const limits = resolveBundleLimits(options.limits);
244
+ if (typeof options.resolveCid !== "function")
245
+ throw new ContentBundleError("OPTIONS_INVALID", "A CID block resolver is required.");
246
+ if (root.version !== 1 || root.code !== 0x71 || root.multihash.code !== 0x12)
247
+ throw new ContentBundleError("SCHEMA_INVALID", "Schema must be a CIDv1 DAG-CBOR SHA-256 block.");
248
+ let work = 0;
249
+ try {
250
+ options.signal?.throwIfAborted();
251
+ const bytes = await options.resolveCid(root, options.signal ? { signal: options.signal } : {});
252
+ if (bytes.length >
253
+ Math.min(limits.blockBytes, limits.bytes, limits.parsingBytes))
254
+ throw new ContentBundleError("LIMIT_EXCEEDED", "Schema read byte budget exceeded.");
255
+ return await decodeSchema(root, bytes, {
256
+ nodes: limits.nodes,
257
+ depth: limits.validationDepth,
258
+ jsonDepth: limits.jsonDepth,
259
+ schemaBytes: limits.schemaBytes,
260
+ charge() {
261
+ options.signal?.throwIfAborted();
262
+ if (++work > limits.nodes)
263
+ throw new ContentBundleError("LIMIT_EXCEEDED", "Schema work budget exceeded.");
264
+ },
265
+ });
266
+ }
267
+ catch (cause) {
268
+ throw contextual(cause, root.toString(), "", [], options.signal);
269
+ }
270
+ }
271
+ export async function validateContentBundle(root, schema, options) {
272
+ return operation(root, options, schema);
273
+ }
274
+ //# sourceMappingURL=bundle.js.map
@@ -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,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC"}
package/dist/data.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export { parseBundleManifest, parseData, canonicalJson } from "./parsing.js";
2
+ export { encodeSchema, inspectSchema, validateValue as validateSchemaValue, } from "./schema.js";
3
+ export type { SchemaOptions, ValidationContext } from "./schema.js";
4
+ export type { BundleManifest, SchemaDefinitions, SchemaBlock, } from "./types.js";
5
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,IAAI,mBAAmB,GACrC,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpE,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,WAAW,GACZ,MAAM,YAAY,CAAC"}
package/dist/data.js ADDED
@@ -0,0 +1,3 @@
1
+ export { parseBundleManifest, parseData, canonicalJson } from "./parsing.js";
2
+ export { encodeSchema, inspectSchema, validateValue as validateSchemaValue, } from "./schema.js";
3
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.js","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EACL,YAAY,EACZ,aAAa,EACb,aAAa,IAAI,mBAAmB,GACrC,MAAM,aAAa,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ContentBundleErrorCode } from "./types.js";
2
+ export declare class ContentBundleError extends Error {
3
+ readonly code: ContentBundleErrorCode;
4
+ readonly path: string;
5
+ readonly pointer: string;
6
+ readonly referenceChain: readonly string[];
7
+ readonly name = "ContentBundleError";
8
+ constructor(code: ContentBundleErrorCode, message: string, path?: string, pointer?: string, referenceChain?: readonly string[], options?: ErrorOptions);
9
+ }
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,qBAAa,kBAAmB,SAAQ,KAAK;IAIzC,QAAQ,CAAC,IAAI,EAAE,sBAAsB;IAErC,QAAQ,CAAC,IAAI;IACb,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE;IAP5C,SAAkB,IAAI,wBAAwB;gBAGnC,IAAI,EAAE,sBAAsB,EACrC,OAAO,EAAE,MAAM,EACN,IAAI,SAAK,EACT,OAAO,SAAK,EACZ,cAAc,GAAE,SAAS,MAAM,EAAO,EAC/C,OAAO,CAAC,EAAE,YAAY;CAIzB"}
package/dist/errors.js ADDED
@@ -0,0 +1,15 @@
1
+ export class ContentBundleError extends Error {
2
+ code;
3
+ path;
4
+ pointer;
5
+ referenceChain;
6
+ name = "ContentBundleError";
7
+ constructor(code, message, path = "", pointer = "", referenceChain = [], options) {
8
+ super(message, options);
9
+ this.code = code;
10
+ this.path = path;
11
+ this.pointer = pointer;
12
+ this.referenceChain = referenceChain;
13
+ }
14
+ }
15
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAIhC;IAEA;IACA;IACA;IAPO,IAAI,GAAG,oBAAoB,CAAC;IAE9C,YACW,IAA4B,EACrC,OAAe,EACN,OAAO,EAAE,EACT,UAAU,EAAE,EACZ,iBAAoC,EAAE,EAC/C,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAPf,SAAI,GAAJ,IAAI,CAAwB;QAE5B,SAAI,GAAJ,IAAI,CAAK;QACT,YAAO,GAAP,OAAO,CAAK;QACZ,mBAAc,GAAd,cAAc,CAAwB;IAIjD,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ export { openBundle, openSchema, validateContentBundle, bundleLimits, resolveBundleLimits, } from "./bundle.js";
2
+ export { parseBundleManifest, parseData, canonicalJson, safePath, } from "./parsing.js";
3
+ export { inspectSchema, inspectBundleSchema, encodeSchema, decodeSchema, schemaBlockBytes, declaresBundleSchema, validateValue as validateSchemaValue, } from "./schema.js";
4
+ export type { SchemaOptions, ValidationContext } from "./schema.js";
5
+ export { ContentBundleError } from "./errors.js";
6
+ export type { ContentBundle, OpenBundleOptions, BundleLimits, BundleManifest, ContentType, JsonSchema, SchemaBlock, SchemaDefinitions, ContentBundleErrorCode, } from "./types.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,IAAI,mBAAmB,GACrC,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,WAAW,EACX,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { openBundle, openSchema, validateContentBundle, bundleLimits, resolveBundleLimits, } from "./bundle.js";
2
+ export { parseBundleManifest, parseData, canonicalJson, safePath, } from "./parsing.js";
3
+ export { inspectSchema, inspectBundleSchema, encodeSchema, decodeSchema, schemaBlockBytes, declaresBundleSchema, validateValue as validateSchemaValue, } from "./schema.js";
4
+ export { ContentBundleError } from "./errors.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,IAAI,mBAAmB,GACrC,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { BundleManifest, ContentType } from "./types.js";
2
+ export declare function record(value: unknown): value is Record<string, unknown>;
3
+ export declare function safePath(path: string): string;
4
+ export declare function assertJson(value: unknown, maximumNodes?: number, maximumDepth?: number, charge?: () => void): void;
5
+ export declare function canonicalJson(value: unknown, nodes?: number, depth?: number, charge?: () => void): Uint8Array;
6
+ export declare function parseData(bytes: Uint8Array, type: ContentType, nodes?: number, depth?: number, charge?: () => void): unknown;
7
+ export declare function normalizeBundleManifest(value: unknown): BundleManifest;
8
+ export declare function parseBundleManifest(bytes: Uint8Array, maximum?: number, charge?: () => void): BundleManifest;
9
+ //# sourceMappingURL=parsing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsing.d.ts","sourceRoot":"","sources":["../src/parsing.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEvE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmB7C;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,YAAY,SAAU,EACtB,YAAY,SAAK,EACjB,MAAM,GAAE,MAAM,IAAe,GAC5B,IAAI,CA0DN;AA8ED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EACd,KAAK,SAAU,EACf,KAAK,SAAK,EACV,MAAM,GAAE,MAAM,IAAe,GAC5B,UAAU,CAYZ;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,WAAW,EACjB,KAAK,SAAU,EACf,KAAK,SAAK,EACV,MAAM,GAAE,MAAM,IAAe,GAC5B,OAAO,CAwET;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAoDtE;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,OAAO,SAAmB,EAC1B,MAAM,GAAE,MAAM,IAAe,GAC5B,cAAc,CAqBhB"}