@elaraai/east 1.0.70 → 1.0.72

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.
Files changed (35) hide show
  1. package/dist/src/expr/libs/string.d.ts +15 -2
  2. package/dist/src/expr/libs/string.d.ts.map +1 -1
  3. package/dist/src/expr/libs/string.js +15 -2
  4. package/dist/src/expr/libs/string.js.map +1 -1
  5. package/dist/src/location.d.ts +12 -0
  6. package/dist/src/location.d.ts.map +1 -1
  7. package/dist/src/location.js +15 -3
  8. package/dist/src/location.js.map +1 -1
  9. package/dist/src/serialization/index.d.ts +2 -0
  10. package/dist/src/serialization/index.d.ts.map +1 -1
  11. package/dist/src/serialization/index.js +2 -0
  12. package/dist/src/serialization/index.js.map +1 -1
  13. package/dist/src/serialization/json.d.ts +43 -2
  14. package/dist/src/serialization/json.d.ts.map +1 -1
  15. package/dist/src/serialization/json.js +138 -9
  16. package/dist/src/serialization/json.js.map +1 -1
  17. package/dist/src/serialization/json.spec.js +99 -15
  18. package/dist/src/serialization/json.spec.js.map +1 -1
  19. package/dist/src/serialization/json_schema.d.ts +81 -0
  20. package/dist/src/serialization/json_schema.d.ts.map +1 -0
  21. package/dist/src/serialization/json_schema.js +305 -0
  22. package/dist/src/serialization/json_schema.js.map +1 -0
  23. package/dist/src/serialization/json_schema.spec.d.ts +2 -0
  24. package/dist/src/serialization/json_schema.spec.d.ts.map +1 -0
  25. package/dist/src/serialization/json_schema.spec.js +427 -0
  26. package/dist/src/serialization/json_schema.spec.js.map +1 -0
  27. package/dist/src/serialization/json_schema_to_type.d.ts +76 -0
  28. package/dist/src/serialization/json_schema_to_type.d.ts.map +1 -0
  29. package/dist/src/serialization/json_schema_to_type.js +576 -0
  30. package/dist/src/serialization/json_schema_to_type.js.map +1 -0
  31. package/dist/src/serialization/json_schema_to_type.spec.d.ts +2 -0
  32. package/dist/src/serialization/json_schema_to_type.spec.d.ts.map +1 -0
  33. package/dist/src/serialization/json_schema_to_type.spec.js +428 -0
  34. package/dist/src/serialization/json_schema_to_type.spec.js.map +1 -0
  35. package/package.json +2 -1
@@ -0,0 +1,576 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import { ArrayType, BlobType, BooleanType, DateTimeType, DictType, FloatType, IntegerType, MatrixType, NullType, OptionType, RecursiveType, RefType, SetType, StringType, StructType, VariantType, VectorType, } from "../types.js";
6
+ /**
7
+ * Raised when a schema cannot be expressed as an East type.
8
+ *
9
+ * @remarks
10
+ * Carries the RFC 6901 pointer to the offending node, because a contract
11
+ * document is large and "unsupported keyword" without a location is not
12
+ * actionable.
13
+ */
14
+ export class JsonSchemaUnsupportedError extends Error {
15
+ /** RFC 6901 pointer to the schema node that could not be converted. */
16
+ pointer;
17
+ constructor(message, pointer) {
18
+ super(pointer === "" ? message : `${message} (at ${pointer})`);
19
+ this.name = "JsonSchemaUnsupportedError";
20
+ this.pointer = pointer;
21
+ }
22
+ }
23
+ /** Keywords East's type system has no counterpart for, and why. */
24
+ const UNSUPPORTED = {
25
+ allOf: "East types have no intersection; rewrite it as one object schema",
26
+ not: "East types have no negation",
27
+ if: "East types have no conditionals",
28
+ then: "East types have no conditionals",
29
+ else: "East types have no conditionals",
30
+ anyOf: "East variants are discriminated; use oneOf with a constant tag per case",
31
+ patternProperties: "East has no pattern-keyed record; use a Dict encoding",
32
+ dependentSchemas: "East types have no conditionals",
33
+ dependentRequired: "East structs require every field",
34
+ propertyNames: "East has no constraint on property names",
35
+ unevaluatedProperties: "East structs are closed; use additionalProperties: false",
36
+ unevaluatedItems: "East arrays are homogeneous",
37
+ prefixItems: "East has no tuple type; use a Struct",
38
+ additionalItems: "East has no tuple type; use a Struct",
39
+ contains: "East has no containment constraint",
40
+ };
41
+ /** RFC 6901 pointer from a path of already-escaped-free segments. */
42
+ function pointerOf(path) {
43
+ if (path.length === 0)
44
+ return "";
45
+ return "/" + path.map(s => s.replace(/~/g, "~0").replace(/\//g, "~1")).join("/");
46
+ }
47
+ function fail(message, path) {
48
+ throw new JsonSchemaUnsupportedError(message, pointerOf(path));
49
+ }
50
+ function asSchema(v, path, what) {
51
+ if (v === null || typeof v !== "object" || Array.isArray(v)) {
52
+ fail(`expected ${what} to be a schema object`, path);
53
+ }
54
+ return v;
55
+ }
56
+ /** Whether a document object carries `key` itself — `in` would also find `Object.prototype`'s. */
57
+ function has(node, key) {
58
+ return Object.prototype.hasOwnProperty.call(node, key);
59
+ }
60
+ /**
61
+ * A schema scalar as a message spells it — JSON's `null`, `true` and `false`,
62
+ * anything else as itself — so the two language twins word a refusal the same.
63
+ */
64
+ function spell(value) {
65
+ if (value === null)
66
+ return "null";
67
+ if (value === true)
68
+ return "true";
69
+ if (value === false)
70
+ return "false";
71
+ return String(value);
72
+ }
73
+ /** The `$schema` values this converter recognises, normalised, and the release each names. */
74
+ const SCHEMA_URI_DRAFTS = {
75
+ "https://json-schema.org/draft/2020-12/schema": "2020-12",
76
+ "https://json-schema.org/draft-07/schema": "draft-07",
77
+ };
78
+ /**
79
+ * The release a document declares.
80
+ *
81
+ * @throws {JsonSchemaUnsupportedError} On a release this converter cannot read
82
+ *
83
+ * @remarks
84
+ * A document that declares a release is taken at its word, so one written for
85
+ * draft-04 (or a release later than these) is refused by name rather than
86
+ * structurally guessed at and quietly mis-read. The scheme and a trailing `#`
87
+ * carry no meaning in a `$schema` value, so both are normalised away.
88
+ */
89
+ function draftOfSchemaUri(uri, path) {
90
+ const key = uri.replace(/#$/, "").replace(/^http:/, "https:");
91
+ const draft = SCHEMA_URI_DRAFTS[key];
92
+ if (draft === undefined) {
93
+ fail(`typeFromJsonSchema cannot read the JSON Schema release "${uri}" — it reads 2020-12, ` +
94
+ "draft-07, and OpenAPI 3.0 schema objects, which carry no $schema of their own", path);
95
+ }
96
+ return draft;
97
+ }
98
+ /**
99
+ * Where a document keeps its definitions.
100
+ *
101
+ * @remarks
102
+ * The declared release says which keyword to expect, but a document that
103
+ * declares one and uses the other still resolves: only the prefix its `$ref`s
104
+ * are written against actually matters, and that is read back from whichever
105
+ * keyword is present.
106
+ */
107
+ function definitionsOf(root, draft) {
108
+ const asDefs = (v) => v !== undefined && typeof v === "object" && v !== null && !Array.isArray(v)
109
+ ? v
110
+ : null;
111
+ const order = draft === "draft-07" ? ["definitions", "$defs"] : ["$defs", "definitions"];
112
+ for (const keyword of order) {
113
+ const defs = asDefs(root[keyword]);
114
+ if (defs !== null)
115
+ return { defs, keyword };
116
+ }
117
+ return { defs: {}, keyword: draft === "draft-07" ? "definitions" : "$defs" };
118
+ }
119
+ /** The definition name a local `$ref` points at, or null when it is not local. */
120
+ function refTarget(ref, keyword) {
121
+ const prefix = `#/${keyword}/`;
122
+ if (!ref.startsWith(prefix))
123
+ return null;
124
+ return ref.slice(prefix.length).replace(/~1/g, "/").replace(/~0/g, "~");
125
+ }
126
+ /**
127
+ * Builds an East type from a JSON Schema document.
128
+ *
129
+ * @param schema - The schema document
130
+ * @returns The East type the schema describes
131
+ * @throws {JsonSchemaUnsupportedError} When the schema uses a keyword East's
132
+ * type system cannot express, naming the keyword and its RFC 6901 pointer
133
+ *
134
+ * @remarks
135
+ * This is the one place the full JSON Schema vocabulary is confronted, and it
136
+ * runs at build time, so nothing it rejects can reach a runtime.
137
+ *
138
+ * A document emitted by {@link jsonSchemaFor} carries `x-east-type`
139
+ * annotations and inverts exactly — JSON Schema alone cannot tell `DateTime`
140
+ * from a `String` with `format: date-time`, `Set` from `Array`, or `Dict`
141
+ * from an array of two-property objects. A foreign document without those
142
+ * annotations still converts, under the structural mapping below, but does
143
+ * not promise to round-trip:
144
+ *
145
+ * | schema | East type |
146
+ * |---|---|
147
+ * | `{"type":"null"}`, or OpenAPI 3.0's `nullable` + `enum: [null]` | `Null` |
148
+ * | `{"type":"boolean"}` | `Boolean` |
149
+ * | `{"type":"string"}` | `String` |
150
+ * | `{"type":"number"}`, `{"type":"integer"}` | `Float`, `Integer` |
151
+ * | `{"type":"array","items":X}` | `Array<X>` |
152
+ * | a closed object with `required` covering every property | `Struct` |
153
+ * | `oneOf` of objects tagged by a constant `type` | `Variant` |
154
+ * | `nullable: true` beside a type, `{"type":["string","null"]}`, or a `oneOf` of null and one other schema | `Option<String>` |
155
+ *
156
+ * The last row reads as an Option because East JSON writes a `none` whose
157
+ * payload cannot itself be null as `null`, so the nulls such a contract
158
+ * permits are exactly what the reader accepts. A type that already admits
159
+ * null — `Null`, or an Option, however the document spells it — is left as
160
+ * it is.
161
+ *
162
+ * Definitions are resolved through `$defs` or `definitions`, whichever the
163
+ * document uses. Cycles among definitions become `RecursiveType`s, one per
164
+ * cycle group: `Node → NodeList → Node`, the ordinary way a recursive schema is
165
+ * written, is the single type `RecursiveType(self => Struct({ children:
166
+ * Array(self) }))` with the alias inlined. A group whose cycles do not all pass
167
+ * through one definition would need two binders, which East does not support,
168
+ * and is refused naming the group.
169
+ *
170
+ * A `$schema` is honoured when present, and a release this cannot read — a
171
+ * draft-04 document, say — is refused by name instead of being structurally
172
+ * guessed at. It is not required: an OpenAPI 3.0 schema object is a fragment of
173
+ * a larger document and carries none, so demanding one would reject what
174
+ * `jsonSchemaFor(T, { draft: "openapi-3.0" })` emits.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * const T = typeFromJsonSchema(JSON.parse(readFileSync("contract.schema.json", "utf-8")));
179
+ * ```
180
+ */
181
+ export function typeFromJsonSchema(schema) {
182
+ // A declared release is honoured; its absence is not an error, because an
183
+ // OpenAPI 3.0 schema object is a fragment of a larger document and carries no
184
+ // $schema of its own — refusing that would refuse what jsonSchemaFor writes
185
+ // for `draft: "openapi-3.0"`. An explicit null is present, not absent.
186
+ let draft;
187
+ if (has(schema, "$schema")) {
188
+ const declared = schema["$schema"];
189
+ if (typeof declared !== "string") {
190
+ fail("typeFromJsonSchema expected \"$schema\" to be a string", ["$schema"]);
191
+ }
192
+ draft = draftOfSchemaUri(declared, ["$schema"]);
193
+ }
194
+ const { defs, keyword } = definitionsOf(schema, draft);
195
+ const ctx = {
196
+ defsKeyword: keyword,
197
+ defs,
198
+ groups: cycleGroups(defs, keyword),
199
+ building: new Map(),
200
+ done: new Map(),
201
+ };
202
+ return build(schema, ctx, []);
203
+ }
204
+ /**
205
+ * The cyclic groups among the definitions, each with the one definition its
206
+ * cycles all pass through.
207
+ *
208
+ * @throws {JsonSchemaUnsupportedError} On a group whose cycles do not all
209
+ * pass through one definition — East binds one `RecursiveType` per group, so
210
+ * such a group would need two
211
+ *
212
+ * @remarks
213
+ * East's rule is one recursive binder per strongly connected group of
214
+ * definitions, not one definition per cycle. The binder is the first
215
+ * definition, in document order, whose removal leaves the rest of its group
216
+ * acyclic; document order alone decides it, so the two language twins choose
217
+ * the same one. Reachability is a closure, never a walk that stops at its
218
+ * first hit, so nothing here depends on the order `$ref`s appear in.
219
+ */
220
+ function cycleGroups(defs, keyword) {
221
+ const names = Object.keys(defs);
222
+ const edges = new Map();
223
+ for (const name of names) {
224
+ const seen = new Set();
225
+ collectRefs(defs[name], keyword, seen);
226
+ edges.set(name, [...seen].filter(target => has(defs, target)));
227
+ }
228
+ /** Every definition reachable from `from` through definitions `allowed` admits. */
229
+ const reach = (from, allowed) => {
230
+ const out = new Set();
231
+ const stack = [from];
232
+ while (stack.length > 0) {
233
+ const at = stack.pop();
234
+ for (const next of edges.get(at) ?? []) {
235
+ if (!allowed(next) || out.has(next))
236
+ continue;
237
+ out.add(next);
238
+ stack.push(next);
239
+ }
240
+ }
241
+ return out;
242
+ };
243
+ const closure = new Map();
244
+ for (const name of names)
245
+ closure.set(name, reach(name, () => true));
246
+ const groups = new Map();
247
+ for (const name of names) {
248
+ if (groups.has(name) || !closure.get(name).has(name))
249
+ continue;
250
+ const members = names.filter(other => other === name || (closure.get(name).has(other) && closure.get(other).has(name)));
251
+ const inGroup = new Set(members);
252
+ let binder = null;
253
+ for (const candidate of members) {
254
+ const allowed = (other) => inGroup.has(other) && other !== candidate;
255
+ if (members.every(member => member === candidate || !reach(member, allowed).has(member))) {
256
+ binder = candidate;
257
+ break;
258
+ }
259
+ }
260
+ if (binder === null) {
261
+ const quoted = members.map(member => `"${member}"`);
262
+ const list = `${quoted.slice(0, -1).join(", ")} and ${quoted[quoted.length - 1]}`;
263
+ throw new JsonSchemaUnsupportedError(`definitions ${list} are mutually recursive in a way East cannot express — every cycle ` +
264
+ "among them must pass through one definition, and East binds one RecursiveType per group", pointerOf([keyword, name]));
265
+ }
266
+ const group = { members, binder };
267
+ for (const member of members)
268
+ groups.set(member, group);
269
+ }
270
+ return groups;
271
+ }
272
+ /** Every local definition name referenced anywhere inside a schema node. */
273
+ function collectRefs(node, keyword, out) {
274
+ if (node === null || typeof node !== "object")
275
+ return;
276
+ if (Array.isArray(node)) {
277
+ for (const item of node)
278
+ collectRefs(item, keyword, out);
279
+ return;
280
+ }
281
+ for (const [key, value] of Object.entries(node)) {
282
+ if (key === "$ref" && typeof value === "string") {
283
+ const target = refTarget(value, keyword);
284
+ if (target !== null)
285
+ out.add(target);
286
+ continue;
287
+ }
288
+ collectRefs(value, keyword, out);
289
+ }
290
+ }
291
+ function build(node, ctx, path) {
292
+ for (const [keyword, reason] of Object.entries(UNSUPPORTED)) {
293
+ if (has(node, keyword)) {
294
+ fail(`typeFromJsonSchema cannot express "${keyword}" — ${reason}`, [...path, keyword]);
295
+ }
296
+ }
297
+ // OpenAPI 3.0 spells "this or null" as `nullable: true`. Beside nothing typed
298
+ // it is the Null spelling itself; beside a type it reads as an Option of that
299
+ // type — East JSON writes a `none` whose payload cannot be null as `null`, so
300
+ // the nulls the partner's contract permits are exactly what the reader
301
+ // accepts. A type that already admits null — Null, or an Option, however
302
+ // the document spells it — is left as it is: wrapping it would make its
303
+ // nulls a tagged `none`, which is not what the document says.
304
+ const nullable = node["nullable"] === true;
305
+ if (nullable && !has(node, "type") && !has(node, "$ref") && !has(node, "oneOf") && !has(node, "x-east-type")) {
306
+ return NullType;
307
+ }
308
+ const built = buildTyped(node, ctx, path);
309
+ return nullable && !admitsNull(built) ? OptionType(built) : built;
310
+ }
311
+ /**
312
+ * Whether a type's encoding already admits `null`, so `nullable` beside its
313
+ * schema adds nothing — `Null`, an Option, or a `Recursive` wrapper of either.
314
+ * Judged on the type that was built rather than on the node's spelling, so a
315
+ * `$ref` to such a definition, or a `oneOf` of null and one other schema, is
316
+ * not wrapped a second time.
317
+ */
318
+ function admitsNull(type) {
319
+ let t = type;
320
+ while (typeof t === "object" && t !== null && t.type === "Recursive") {
321
+ t = t.node;
322
+ }
323
+ if (typeof t !== "object" || t === null)
324
+ return false;
325
+ const built = t;
326
+ if (built.type === "Null")
327
+ return true;
328
+ if (built.type !== "Variant")
329
+ return false;
330
+ const names = Object.keys(built.cases);
331
+ return names.length === 2 && names[0] === "none" && names[1] === "some" && built.cases["none"].type === "Null";
332
+ }
333
+ /** The node's type, `nullable` aside. */
334
+ function buildTyped(node, ctx, path) {
335
+ const ref = node["$ref"];
336
+ if (typeof ref === "string")
337
+ return buildRef(ref, ctx, [...path, "$ref"]);
338
+ // An annotated document says outright what it came from.
339
+ const annotation = node["x-east-type"];
340
+ if (typeof annotation === "string")
341
+ return buildAnnotated(annotation, node, ctx, path);
342
+ if (has(node, "oneOf"))
343
+ return buildVariant(node, ctx, path);
344
+ const type = node["type"];
345
+ if (Array.isArray(type)) {
346
+ // JSON Schema's own spelling of "this or null": one type beside "null"
347
+ // reads as an Option of it, for the reason `nullable` does. Anything wider
348
+ // is a union East has no discriminated form for.
349
+ const others = type.filter(t => t !== "null");
350
+ if (others.length < type.length && others.length <= 1) {
351
+ if (others.length === 0)
352
+ return NullType;
353
+ return OptionType(buildTyped({ ...node, type: others[0] }, ctx, path));
354
+ }
355
+ fail(`typeFromJsonSchema cannot express a union of primitive types [${type.map(spell).join(", ")}] — ` +
356
+ "East unions are discriminated variants, and only one type beside \"null\" reads, as an Option", [...path, "type"]);
357
+ }
358
+ switch (type) {
359
+ case "null": return NullType;
360
+ case "boolean": return BooleanType;
361
+ case "string": return StringType;
362
+ case "number": return FloatType;
363
+ case "integer": return IntegerType;
364
+ case "array": return ArrayType(buildItems(node, ctx, path));
365
+ case "object": return buildStruct(node, ctx, path);
366
+ case undefined:
367
+ fail("typeFromJsonSchema needs a \"type\" (or a $ref, oneOf, or x-east-type annotation) — " +
368
+ "an unconstrained schema has no East type", path);
369
+ break;
370
+ default:
371
+ fail(`typeFromJsonSchema does not recognise the type "${spell(type)}"`, [...path, "type"]);
372
+ }
373
+ }
374
+ function buildRef(ref, ctx, path) {
375
+ const name = refTarget(ref, ctx.defsKeyword);
376
+ if (name === null) {
377
+ fail(`typeFromJsonSchema cannot resolve "${ref}" — only local #/${ctx.defsKeyword}/… references are supported`, path);
378
+ }
379
+ if (!has(ctx.defs, name)) {
380
+ fail(`typeFromJsonSchema cannot resolve "${ref}" — no such definition`, path);
381
+ }
382
+ const defPath = [ctx.defsKeyword, name];
383
+ const def = asSchema(ctx.defs[name], defPath, `definition "${name}"`);
384
+ const group = ctx.groups.get(name);
385
+ if (group === undefined) {
386
+ // On no cycle: nothing it builds captures a marker, so build once and share.
387
+ const cached = ctx.done.get(name);
388
+ if (cached !== undefined)
389
+ return cached;
390
+ const built = build(def, ctx, defPath);
391
+ ctx.done.set(name, built);
392
+ return built;
393
+ }
394
+ const scope = ctx.building.get(group.binder);
395
+ if (name === group.binder) {
396
+ if (scope !== undefined)
397
+ return scope.marker;
398
+ const cached = ctx.done.get(name);
399
+ if (cached !== undefined)
400
+ return cached;
401
+ const built = RecursiveType(self => {
402
+ ctx.building.set(name, { marker: self, built: new Map() });
403
+ try {
404
+ return build(def, ctx, defPath);
405
+ }
406
+ finally {
407
+ ctx.building.delete(name);
408
+ }
409
+ });
410
+ ctx.done.set(name, built);
411
+ return built;
412
+ }
413
+ if (scope !== undefined) {
414
+ // Inside its binder: the member captures the marker, so it is built inline
415
+ // and shared only within this scope.
416
+ const cached = scope.built.get(name);
417
+ if (cached !== undefined)
418
+ return cached;
419
+ const built = build(def, ctx, defPath);
420
+ scope.built.set(name, built);
421
+ return built;
422
+ }
423
+ // Outside its binder: references to the binder resolve to the completed
424
+ // RecursiveType, so the member captures nothing and can be shared.
425
+ const cached = ctx.done.get(name);
426
+ if (cached !== undefined)
427
+ return cached;
428
+ const built = build(def, ctx, defPath);
429
+ ctx.done.set(name, built);
430
+ return built;
431
+ }
432
+ function buildItems(node, ctx, path) {
433
+ if (!has(node, "items")) {
434
+ fail("typeFromJsonSchema needs \"items\" on an array — East arrays are homogeneous", path);
435
+ }
436
+ return build(asSchema(node["items"], [...path, "items"], "items"), ctx, [...path, "items"]);
437
+ }
438
+ function buildStruct(node, ctx, path) {
439
+ const additional = node["additionalProperties"];
440
+ if (additional !== false) {
441
+ fail("typeFromJsonSchema needs \"additionalProperties\": false on an object — " +
442
+ "East structs are closed, so an open record has no East type", path);
443
+ }
444
+ if (!has(node, "properties")) {
445
+ fail("typeFromJsonSchema needs \"properties\" on an object", path);
446
+ }
447
+ const props = asSchema(node["properties"], [...path, "properties"], "properties");
448
+ const required = node["required"];
449
+ const requiredNames = new Set(Array.isArray(required) ? required.filter((r) => typeof r === "string") : []);
450
+ // Names come from the document, so the accumulator must have no prototype:
451
+ // assigning "__proto__" on a plain object sets the prototype instead of a
452
+ // field, silently dropping it. The python twin uses a list of pairs.
453
+ const fields = Object.create(null);
454
+ for (const [name, value] of Object.entries(props)) {
455
+ if (!requiredNames.has(name)) {
456
+ fail(`typeFromJsonSchema needs every property required — "${name}" is optional, and East ` +
457
+ "structs have no absent field; model it as an Option", [...path, "properties", name]);
458
+ }
459
+ fields[name] = build(asSchema(value, [...path, "properties", name], `property "${name}"`), ctx, [...path, "properties", name]);
460
+ }
461
+ return StructType(fields);
462
+ }
463
+ /** The constant tag an alternative pins, or null when it pins none. */
464
+ function tagOf(alternative) {
465
+ const properties = alternative["properties"];
466
+ if (properties === null || typeof properties !== "object" || Array.isArray(properties))
467
+ return null;
468
+ const tag = properties["type"];
469
+ if (tag === null || typeof tag !== "object" || Array.isArray(tag))
470
+ return null;
471
+ const constant = tag["const"];
472
+ if (typeof constant === "string")
473
+ return constant;
474
+ // draft-04 (and so OpenAPI 3.0) has no `const`; a single-valued enum is the
475
+ // same assertion.
476
+ const choices = tag["enum"];
477
+ if (Array.isArray(choices) && choices.length === 1 && typeof choices[0] === "string") {
478
+ return choices[0];
479
+ }
480
+ return null;
481
+ }
482
+ function buildVariant(node, ctx, path) {
483
+ const alternatives = node["oneOf"];
484
+ if (!Array.isArray(alternatives) || alternatives.length === 0) {
485
+ fail("typeFromJsonSchema needs a non-empty \"oneOf\"", [...path, "oneOf"]);
486
+ }
487
+ // JSON Schema's own `oneOf` spelling of "this or null" — null beside one
488
+ // other schema — reads as an Option of it, for the reason `nullable` and
489
+ // the type union do. A tagged Option is two objects, so it never matches.
490
+ if (alternatives.length === 2) {
491
+ const schemas = alternatives.map((a, i) => asSchema(a, [...path, "oneOf", String(i)], `oneOf[${i}]`));
492
+ const at = payloadBesideNull(schemas);
493
+ if (at !== null)
494
+ return OptionType(build(schemas[at], ctx, [...path, "oneOf", String(at)]));
495
+ }
496
+ // As above — and reading `cases["constructor"]` on a plain object finds
497
+ // Object.prototype's, which reported a false duplicate case.
498
+ const cases = Object.create(null);
499
+ for (let i = 0; i < alternatives.length; i++) {
500
+ const altPath = [...path, "oneOf", String(i)];
501
+ const alternative = asSchema(alternatives[i], altPath, `oneOf[${i}]`);
502
+ const tag = tagOf(alternative);
503
+ if (tag === null) {
504
+ fail("typeFromJsonSchema needs each oneOf alternative to pin a constant \"type\" tag — " +
505
+ "an untagged union is not an East variant", altPath);
506
+ }
507
+ const properties = asSchema(alternative["properties"], [...altPath, "properties"], "properties");
508
+ if (!has(properties, "value")) {
509
+ fail("typeFromJsonSchema needs a \"value\" property on each variant case", [...altPath, "properties"]);
510
+ }
511
+ if (cases[tag] !== undefined) {
512
+ fail(`typeFromJsonSchema found the variant case "${tag}" twice`, altPath);
513
+ }
514
+ cases[tag] = build(asSchema(properties["value"], [...altPath, "properties", "value"], "value"), ctx, [...altPath, "properties", "value"]);
515
+ }
516
+ return VariantType(cases);
517
+ }
518
+ /** Whether a node is one of the spellings of `Null` the generator emits. */
519
+ function isNullSchema(node) {
520
+ if (node["type"] === "null")
521
+ return true;
522
+ const choices = node["enum"];
523
+ return node["nullable"] === true && !has(node, "type")
524
+ && Array.isArray(choices) && choices.length === 1 && choices[0] === null;
525
+ }
526
+ /** The index of the payload beside a single null alternative, or `null` when the pair is not that shape. */
527
+ function payloadBesideNull(schemas) {
528
+ if (schemas.length !== 2)
529
+ return null;
530
+ const nulls = schemas.map(isNullSchema);
531
+ if (nulls[0] === nulls[1])
532
+ return null;
533
+ return nulls[0] ? 1 : 0;
534
+ }
535
+ function buildAnnotated(annotation, node, ctx, path) {
536
+ switch (annotation) {
537
+ case "Option": {
538
+ // A flat Option: null, or the payload. The tagged form carries no
539
+ // annotation and reads structurally, as the Variant it is.
540
+ const alternatives = node["oneOf"];
541
+ if (!Array.isArray(alternatives) || alternatives.length !== 2) {
542
+ fail("typeFromJsonSchema needs an Option's \"oneOf\" to hold exactly two alternatives — null and the payload", [...path, "oneOf"]);
543
+ }
544
+ const schemas = alternatives.map((a, i) => asSchema(a, [...path, "oneOf", String(i)], `oneOf[${i}]`));
545
+ const at = payloadBesideNull(schemas);
546
+ if (at === null) {
547
+ fail("typeFromJsonSchema needs an Option's \"oneOf\" to hold one null alternative and one payload", [...path, "oneOf"]);
548
+ }
549
+ return OptionType(build(schemas[at], ctx, [...path, "oneOf", String(at)]));
550
+ }
551
+ case "Integer": return IntegerType;
552
+ case "Float": return FloatType;
553
+ case "DateTime": return DateTimeType;
554
+ case "Blob": return BlobType;
555
+ case "Set": return SetType(buildItems(node, ctx, path));
556
+ case "Vector": return VectorType(buildItems(node, ctx, path));
557
+ case "Matrix": {
558
+ const rows = asSchema(node["items"], [...path, "items"], "items");
559
+ return MatrixType(buildItems(rows, ctx, [...path, "items"]));
560
+ }
561
+ case "Dict": {
562
+ const entry = asSchema(node["items"], [...path, "items"], "items");
563
+ const entryPath = [...path, "items"];
564
+ const properties = asSchema(entry["properties"], [...entryPath, "properties"], "properties");
565
+ if (!has(properties, "key") || !has(properties, "value")) {
566
+ fail("typeFromJsonSchema needs \"key\" and \"value\" on a Dict entry", [...entryPath, "properties"]);
567
+ }
568
+ return DictType(build(asSchema(properties["key"], [...entryPath, "properties", "key"], "key"), ctx, [...entryPath, "properties", "key"]), build(asSchema(properties["value"], [...entryPath, "properties", "value"], "value"), ctx, [...entryPath, "properties", "value"]));
569
+ }
570
+ case "Ref":
571
+ return RefType(buildItems(node, ctx, path));
572
+ default:
573
+ fail(`typeFromJsonSchema does not recognise the x-east-type "${annotation}"`, [...path, "x-east-type"]);
574
+ }
575
+ }
576
+ //# sourceMappingURL=json_schema_to_type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json_schema_to_type.js","sourceRoot":"","sources":["../../../src/serialization/json_schema_to_type.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,GAGX,MAAM,aAAa,CAAC;AAGrB;;;;;;;GAOG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACnD,uEAAuE;IAC9D,OAAO,CAAS;IAEzB,YAAY,OAAe,EAAE,OAAe;QAC1C,KAAK,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,QAAQ,OAAO,GAAG,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED,mEAAmE;AACnE,MAAM,WAAW,GAA2B;IAC1C,KAAK,EAAE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AAC,CAAC;YAC7F,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC;gBACzD,IAAI,CAAC,gEAAgE,EAAE,CAAC,GAAG,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;YACvG,CAAC;YACD,OAAO,QAAQ,CACb,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,EACxH,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QACtI,CAAC;QACD,KAAK,KAAK;YACR,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QAC9C;YACE,IAAI,CAAC,0DAA0D,UAAU,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;IAC5G,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=json_schema_to_type.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json_schema_to_type.spec.d.ts","sourceRoot":"","sources":["../../../src/serialization/json_schema_to_type.spec.ts"],"names":[],"mappings":""}