schema-components 1.20.0 → 1.21.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/dist/core/adapter.d.mts +9 -2
- package/dist/core/adapter.mjs +220 -64
- package/dist/core/constraints.d.mts +1 -1
- package/dist/core/constraints.mjs +0 -2
- package/dist/core/errors.d.mts +1 -1
- package/dist/core/errors.mjs +9 -15
- package/dist/core/fieldOrder.d.mts +1 -1
- package/dist/core/merge.d.mts +10 -1
- package/dist/core/merge.mjs +11 -0
- package/dist/core/normalise.d.mts +7 -1
- package/dist/core/normalise.mjs +1 -1
- package/dist/core/openapi30.d.mts +24 -1
- package/dist/core/openapi30.mjs +2 -2
- package/dist/core/ref.d.mts +1 -1
- package/dist/core/ref.mjs +34 -9
- package/dist/core/renderer.d.mts +1 -1
- package/dist/core/swagger2.mjs +1 -1
- package/dist/core/typeInference.d.mts +1 -1
- package/dist/core/types.d.mts +1 -1
- package/dist/core/walkBuilders.d.mts +12 -4
- package/dist/core/walkBuilders.mjs +11 -3
- package/dist/core/walker.d.mts +1 -1
- package/dist/core/walker.mjs +32 -25
- package/dist/{errors-C2iABcn9.d.mts → errors-QEwOtQAA.d.mts} +7 -11
- package/dist/html/a11y.d.mts +2 -2
- package/dist/html/renderToHtml.d.mts +2 -2
- package/dist/html/renderToHtmlStream.d.mts +2 -2
- package/dist/html/renderers.d.mts +2 -2
- package/dist/html/renderers.mjs +1 -1
- package/dist/html/streamRenderers.d.mts +2 -2
- package/dist/{normalise-CMMEl4cd.mjs → normalise-DaSrnr8g.mjs} +325 -28
- package/dist/openapi/ApiCallbacks.d.mts +1 -1
- package/dist/openapi/ApiLinks.d.mts +1 -1
- package/dist/openapi/ApiResponseHeaders.d.mts +1 -1
- package/dist/openapi/ApiSecurity.d.mts +1 -1
- package/dist/openapi/ApiSecurity.mjs +113 -7
- package/dist/openapi/components.d.mts +32 -10
- package/dist/openapi/components.mjs +22 -12
- package/dist/openapi/parser.d.mts +1 -1
- package/dist/openapi/parser.mjs +39 -4
- package/dist/openapi/resolve.d.mts +60 -9
- package/dist/openapi/resolve.mjs +86 -23
- package/dist/react/SchemaComponent.d.mts +4 -4
- package/dist/react/SchemaComponent.mjs +32 -4
- package/dist/react/SchemaView.d.mts +2 -2
- package/dist/react/fieldPath.d.mts +1 -1
- package/dist/react/headless.d.mts +1 -1
- package/dist/react/headlessRenderers.d.mts +2 -2
- package/dist/react/headlessRenderers.mjs +1 -1
- package/dist/{ref-C8JbwfiS.d.mts → ref-si8ViYun.d.mts} +6 -1
- package/dist/{renderer-SOIbJBtk.d.mts → renderer-DI6ZYf7a.d.mts} +1 -1
- package/dist/themes/mantine.d.mts +1 -1
- package/dist/themes/mui.d.mts +1 -1
- package/dist/themes/radix.d.mts +1 -1
- package/dist/themes/shadcn.d.mts +1 -1
- package/dist/{typeInference-CDoD_LZ_.d.mts → typeInference-Bxw3NOG1.d.mts} +162 -48
- package/dist/{types-C9zw9wbX.d.mts → types-BnxPEElk.d.mts} +12 -2
- package/package.json +1 -1
package/dist/core/renderer.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as HtmlRenderProps, c as RenderFunction, d as getHtmlRenderFn, f as getRenderFunction, h as typeToKey, i as HtmlRenderFunction, l as RenderProps, m as mergeResolvers, n as BaseFieldProps, o as HtmlResolver, p as mergeHtmlResolvers, r as ComponentResolver, s as RESOLVER_KEYS, t as AllConstraints, u as buildRenderProps } from "../renderer-
|
|
1
|
+
import { a as HtmlRenderProps, c as RenderFunction, d as getHtmlRenderFn, f as getRenderFunction, h as typeToKey, i as HtmlRenderFunction, l as RenderProps, m as mergeResolvers, n as BaseFieldProps, o as HtmlResolver, p as mergeHtmlResolvers, r as ComponentResolver, s as RESOLVER_KEYS, t as AllConstraints, u as buildRenderProps } from "../renderer-DI6ZYf7a.mjs";
|
|
2
2
|
export { AllConstraints, BaseFieldProps, ComponentResolver, HtmlRenderFunction, HtmlRenderProps, HtmlResolver, RESOLVER_KEYS, RenderFunction, RenderProps, buildRenderProps, getHtmlRenderFn, getRenderFunction, mergeHtmlResolvers, mergeResolvers, typeToKey };
|
package/dist/core/swagger2.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { o as normaliseSwagger2Document } from "../normalise-
|
|
1
|
+
import { o as normaliseSwagger2Document } from "../normalise-DaSrnr8g.mjs";
|
|
2
2
|
export { normaliseSwagger2Document };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as InferResponseFields, c as PathOfType, d as TypeAtPath, f as UnrepresentableZodSchemaError, h as __SchemaInferenceFellBack, i as InferRequestBodyFields, l as RejectUnrepresentableZod, m as UnsafeFields, n as FromJSONSchema, o as OpenAPIRequestBodyType, p as UnrepresentableZodType, r as InferParameterOverrides, s as OpenAPIResponseType, t as DEFAULT_MAX_DEPTH, u as ResolveOpenAPIRef } from "../typeInference-
|
|
1
|
+
import { a as InferResponseFields, c as PathOfType, d as TypeAtPath, f as UnrepresentableZodSchemaError, h as __SchemaInferenceFellBack, i as InferRequestBodyFields, l as RejectUnrepresentableZod, m as UnsafeFields, n as FromJSONSchema, o as OpenAPIRequestBodyType, p as UnrepresentableZodType, r as InferParameterOverrides, s as OpenAPIResponseType, t as DEFAULT_MAX_DEPTH, u as ResolveOpenAPIRef } from "../typeInference-Bxw3NOG1.mjs";
|
|
2
2
|
export { DEFAULT_MAX_DEPTH, FromJSONSchema, InferParameterOverrides, InferRequestBodyFields, InferResponseFields, OpenAPIRequestBodyType, OpenAPIResponseType, PathOfType, RejectUnrepresentableZod, ResolveOpenAPIRef, TypeAtPath, UnrepresentableZodSchemaError, UnrepresentableZodType, UnsafeFields, __SchemaInferenceFellBack };
|
package/dist/core/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as UnionField, B as isNegationField, C as RecordField, D as StringConstraints, E as SchemaType, F as isConditionalField, G as isRecordField, H as isNullField, I as isDiscriminatedUnionField, J as isTupleField, K as isRecursiveField, L as isEnumField, M as WalkedField, N as isArrayField, O as StringField, P as isBooleanField, R as isFileField, S as ObjectField, T as SchemaMeta, U as isNumberField, V as isNeverField, W as isObjectField, X as isUnknownField, Y as isUnionField, Z as resolveEditability, _ as NeverField, a as DiscriminatedUnionField, b as NumberField, c as FieldBase, d as FieldOverrides, f as FileConstraints, g as NegationField, h as LiteralField, i as ConditionalField, j as UnknownField, k as TupleField, l as FieldConstraints, m as JsonObject, n as ArrayField, o as Editability, p as FileField, q as isStringField, r as BooleanField, s as EnumField, t as ArrayConstraints, u as FieldOverride, v as NullField, w as RecursiveField, x as ObjectConstraints, y as NumberConstraints, z as isLiteralField } from "../types-
|
|
1
|
+
import { A as UnionField, B as isNegationField, C as RecordField, D as StringConstraints, E as SchemaType, F as isConditionalField, G as isRecordField, H as isNullField, I as isDiscriminatedUnionField, J as isTupleField, K as isRecursiveField, L as isEnumField, M as WalkedField, N as isArrayField, O as StringField, P as isBooleanField, R as isFileField, S as ObjectField, T as SchemaMeta, U as isNumberField, V as isNeverField, W as isObjectField, X as isUnknownField, Y as isUnionField, Z as resolveEditability, _ as NeverField, a as DiscriminatedUnionField, b as NumberField, c as FieldBase, d as FieldOverrides, f as FileConstraints, g as NegationField, h as LiteralField, i as ConditionalField, j as UnknownField, k as TupleField, l as FieldConstraints, m as JsonObject, n as ArrayField, o as Editability, p as FileField, q as isStringField, r as BooleanField, s as EnumField, t as ArrayConstraints, u as FieldOverride, v as NullField, w as RecursiveField, x as ObjectConstraints, y as NumberConstraints, z as isLiteralField } from "../types-BnxPEElk.mjs";
|
|
2
2
|
export { ArrayConstraints, ArrayField, BooleanField, ConditionalField, DiscriminatedUnionField, Editability, EnumField, FieldBase, FieldConstraints, FieldOverride, FieldOverrides, FileConstraints, FileField, JsonObject, LiteralField, NegationField, NeverField, NullField, NumberConstraints, NumberField, ObjectConstraints, ObjectField, RecordField, RecursiveField, SchemaMeta, SchemaType, StringConstraints, StringField, TupleField, UnionField, UnknownField, WalkedField, isArrayField, isBooleanField, isConditionalField, isDiscriminatedUnionField, isEnumField, isFileField, isLiteralField, isNegationField, isNeverField, isNullField, isNumberField, isObjectField, isRecordField, isRecursiveField, isStringField, isTupleField, isUnionField, isUnknownField, resolveEditability };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as WalkedField, O as StringField, T as SchemaMeta, b as NumberField, c as FieldBase, j as UnknownField, o as Editability, p as FileField, r as BooleanField, v as NullField } from "../types-
|
|
1
|
+
import { M as WalkedField, O as StringField, T as SchemaMeta, b as NumberField, c as FieldBase, j as UnknownField, o as Editability, p as FileField, r as BooleanField, v as NullField } from "../types-BnxPEElk.mjs";
|
|
2
2
|
import { i as DiagnosticsOptions } from "../diagnostics-CbBPsxSt.mjs";
|
|
3
|
-
import { t as ExternalResolver } from "../ref-
|
|
3
|
+
import { t as ExternalResolver } from "../ref-si8ViYun.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/core/walkBuilders.d.ts
|
|
6
6
|
declare function getString(obj: Record<string, unknown>, key: string): string | undefined;
|
|
@@ -52,8 +52,16 @@ declare function buildBooleanField(schema: Record<string, unknown>, ctx: WalkCon
|
|
|
52
52
|
declare function buildNullField(schema: Record<string, unknown>, ctx: WalkContext): NullField;
|
|
53
53
|
declare function buildUnknownField(schema: Record<string, unknown>, ctx: WalkContext): UnknownField;
|
|
54
54
|
declare function buildFileField(schema: Record<string, unknown>, ctx: WalkContext): FileField;
|
|
55
|
-
/**
|
|
56
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Walk a map of sub-schemas (patternProperties, dependentSchemas, $defs).
|
|
57
|
+
*
|
|
58
|
+
* The callback receives each value as `unknown` so the caller can route
|
|
59
|
+
* boolean schemas (`true`/`false`, valid per Draft 06+) through the
|
|
60
|
+
* walker's boolean dispatch alongside object schemas. Non-schema values
|
|
61
|
+
* (numbers, strings, arrays, undefined) are silently skipped — they
|
|
62
|
+
* cannot represent a JSON Schema and have no walk-time meaning.
|
|
63
|
+
*/
|
|
64
|
+
declare function walkSubSchemaMap<T>(map: Record<string, unknown>, walkSubSchema: (schema: unknown, ctx: WalkContext) => T, ctx: WalkContext): Record<string, T>;
|
|
57
65
|
/** Walk a dependentRequired map (Record<string, string[]>). */
|
|
58
66
|
declare function walkDependentRequiredMap(map: Record<string, unknown>): Record<string, string[]>;
|
|
59
67
|
/**
|
|
@@ -124,10 +124,18 @@ function buildFileField(schema, ctx) {
|
|
|
124
124
|
constraints: extractFileConstraints(schema)
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
/**
|
|
128
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Walk a map of sub-schemas (patternProperties, dependentSchemas, $defs).
|
|
129
|
+
*
|
|
130
|
+
* The callback receives each value as `unknown` so the caller can route
|
|
131
|
+
* boolean schemas (`true`/`false`, valid per Draft 06+) through the
|
|
132
|
+
* walker's boolean dispatch alongside object schemas. Non-schema values
|
|
133
|
+
* (numbers, strings, arrays, undefined) are silently skipped — they
|
|
134
|
+
* cannot represent a JSON Schema and have no walk-time meaning.
|
|
135
|
+
*/
|
|
136
|
+
function walkSubSchemaMap(map, walkSubSchema, ctx) {
|
|
129
137
|
const result = {};
|
|
130
|
-
for (const [key, value] of Object.entries(map)) if (isObject(value)) result[key] =
|
|
138
|
+
for (const [key, value] of Object.entries(map)) if (isObject(value) || typeof value === "boolean") result[key] = walkSubSchema(value, ctx);
|
|
131
139
|
return result;
|
|
132
140
|
}
|
|
133
141
|
/** Walk a dependentRequired map (Record<string, string[]>). */
|
package/dist/core/walker.d.mts
CHANGED
package/dist/core/walker.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isObject } from "./guards.mjs";
|
|
2
2
|
import { appendPointer, emitDiagnostic } from "./diagnostics.mjs";
|
|
3
|
+
import { isPrototypePollutingKey } from "./uri.mjs";
|
|
3
4
|
import { countDistinctRefs, resolveRef } from "./ref.mjs";
|
|
4
5
|
import { extractArrayConstraints, extractObjectConstraints, stripInapplicableConstraints } from "./constraints.mjs";
|
|
5
6
|
import { ANNOTATION_SIBLINGS, detectDiscriminated, mergeAllOf, mergeRefSiblings, normaliseAnyOf } from "./merge.mjs";
|
|
6
|
-
import { isPrototypePollutingKey } from "./uri.mjs";
|
|
7
7
|
import { buildBase, buildBooleanField, buildFileField, buildNullField, buildNumberField, buildStringField, buildUnknownField, extractChildOverride, extractSchemaMetaFields, getArray, getObject, getString, isPrimitive, walkDependentRequiredMap, walkSubSchemaMap, withoutKeys } from "./walkBuilders.mjs";
|
|
8
8
|
//#region src/core/walker.ts
|
|
9
9
|
/**
|
|
@@ -75,7 +75,11 @@ function walk(schema, options = {}) {
|
|
|
75
75
|
}
|
|
76
76
|
function walkNode(schema, ctx) {
|
|
77
77
|
const allOf = getArray(schema, "allOf");
|
|
78
|
-
if (allOf !== void 0 && allOf.length > 0)
|
|
78
|
+
if (allOf !== void 0 && allOf.length > 0) {
|
|
79
|
+
const merged = mergeAllOf(allOf, ctx.diagnostics, ctx.pointer);
|
|
80
|
+
if (merged === false) return walkBooleanSchema(false);
|
|
81
|
+
return walkNode(merged, ctx);
|
|
82
|
+
}
|
|
79
83
|
const anyOf = getArray(schema, "anyOf");
|
|
80
84
|
if (anyOf !== void 0) {
|
|
81
85
|
const nullable = normaliseAnyOf(anyOf);
|
|
@@ -87,6 +91,11 @@ function walkNode(schema, ctx) {
|
|
|
87
91
|
}
|
|
88
92
|
const oneOf = getArray(schema, "oneOf");
|
|
89
93
|
if (oneOf !== void 0) {
|
|
94
|
+
const nullable = normaliseAnyOf(oneOf);
|
|
95
|
+
if (nullable !== void 0) return walkNode(nullable.inner, {
|
|
96
|
+
...ctx,
|
|
97
|
+
isNullable: true
|
|
98
|
+
});
|
|
90
99
|
const discriminated = detectDiscriminated(oneOf, ctx.diagnostics, ctx.pointer);
|
|
91
100
|
if (discriminated !== void 0) return walkDiscriminatedUnion(discriminated, ctx);
|
|
92
101
|
return walkUnion(oneOf, ctx);
|
|
@@ -112,32 +121,27 @@ function walkNode(schema, ctx) {
|
|
|
112
121
|
Object.assign(placeholder, result);
|
|
113
122
|
return placeholder;
|
|
114
123
|
}
|
|
115
|
-
|
|
116
|
-
if (ifSchema !== void 0) {
|
|
124
|
+
if ("if" in schema) {
|
|
117
125
|
emitDiagnostic(ctx.diagnostics, {
|
|
118
126
|
code: "conditional-fallback",
|
|
119
127
|
message: "if/then/else rendered as base schema; conditionals require runtime evaluation",
|
|
120
128
|
pointer: ctx.pointer
|
|
121
129
|
});
|
|
122
|
-
const base = buildBase(withoutKeys(schema, [
|
|
123
|
-
"if",
|
|
124
|
-
"then",
|
|
125
|
-
"else"
|
|
126
|
-
]), ctx);
|
|
127
|
-
const thenSchema = getObject(schema, "then");
|
|
128
|
-
const elseSchema = getObject(schema, "else");
|
|
129
130
|
const conditional = {
|
|
130
|
-
...
|
|
131
|
+
...buildBase(withoutKeys(schema, [
|
|
132
|
+
"if",
|
|
133
|
+
"then",
|
|
134
|
+
"else"
|
|
135
|
+
]), ctx),
|
|
131
136
|
type: "conditional",
|
|
132
137
|
constraints: {},
|
|
133
|
-
ifClause:
|
|
138
|
+
ifClause: walkSubSchema(schema.if, ctx)
|
|
134
139
|
};
|
|
135
|
-
if (
|
|
136
|
-
if (
|
|
140
|
+
if ("then" in schema) conditional.thenClause = walkSubSchema(schema.then, ctx);
|
|
141
|
+
if ("else" in schema) conditional.elseClause = walkSubSchema(schema.else, ctx);
|
|
137
142
|
return conditional;
|
|
138
143
|
}
|
|
139
|
-
|
|
140
|
-
if (notSchema !== void 0) {
|
|
144
|
+
if ("not" in schema) {
|
|
141
145
|
emitDiagnostic(ctx.diagnostics, {
|
|
142
146
|
code: "type-negation-fallback",
|
|
143
147
|
message: "not schema rendered as negation; TypeScript cannot negate types",
|
|
@@ -147,7 +151,7 @@ function walkNode(schema, ctx) {
|
|
|
147
151
|
...buildBase(withoutKeys(schema, ["not"]), ctx),
|
|
148
152
|
type: "negation",
|
|
149
153
|
constraints: {},
|
|
150
|
-
negated:
|
|
154
|
+
negated: walkSubSchema(schema.not, ctx)
|
|
151
155
|
};
|
|
152
156
|
}
|
|
153
157
|
const enumValues = getArray(schema, "enum");
|
|
@@ -321,7 +325,7 @@ function walkObject(schema, properties, ctx) {
|
|
|
321
325
|
};
|
|
322
326
|
}
|
|
323
327
|
const patternProps = getObject(schema, "patternProperties");
|
|
324
|
-
const walkedPatternProps = patternProps !== void 0 ? walkSubSchemaMap(patternProps,
|
|
328
|
+
const walkedPatternProps = patternProps !== void 0 ? walkSubSchemaMap(patternProps, walkSubSchema, ctx) : void 0;
|
|
325
329
|
let additionalPropertiesClosed;
|
|
326
330
|
let additionalPropertiesSchema;
|
|
327
331
|
const additionalProps = schema.additionalProperties;
|
|
@@ -334,7 +338,7 @@ function walkObject(schema, properties, ctx) {
|
|
|
334
338
|
};
|
|
335
339
|
else if (isObject(additionalProps)) additionalPropertiesSchema = walkNode(additionalProps, ctx);
|
|
336
340
|
const depSchemas = getObject(schema, "dependentSchemas");
|
|
337
|
-
const walkedDepSchemas = depSchemas !== void 0 ? walkSubSchemaMap(depSchemas,
|
|
341
|
+
const walkedDepSchemas = depSchemas !== void 0 ? walkSubSchemaMap(depSchemas, walkSubSchema, ctx) : void 0;
|
|
338
342
|
const depReq = getObject(schema, "dependentRequired");
|
|
339
343
|
const walkedDepReq = depReq !== void 0 ? walkDependentRequiredMap(depReq) : void 0;
|
|
340
344
|
let unevaluatedProperties;
|
|
@@ -348,8 +352,7 @@ function walkObject(schema, properties, ctx) {
|
|
|
348
352
|
constraints: {}
|
|
349
353
|
};
|
|
350
354
|
else if (isObject(unevalProps)) unevaluatedProperties = walkNode(unevalProps, ctx);
|
|
351
|
-
const
|
|
352
|
-
const walkedPropertyNames = propertyNamesSchema !== void 0 ? walkNode(propertyNamesSchema, ctx) : void 0;
|
|
355
|
+
const walkedPropertyNames = "propertyNames" in schema ? walkSubSchema(schema.propertyNames, ctx) : void 0;
|
|
353
356
|
return {
|
|
354
357
|
...buildBase(schema, ctx),
|
|
355
358
|
type: "object",
|
|
@@ -384,6 +387,7 @@ function walkRecord(schema, valueSchema, ctx) {
|
|
|
384
387
|
};
|
|
385
388
|
}
|
|
386
389
|
function walkArray(schema, ctx) {
|
|
390
|
+
const walkedContains = "contains" in schema ? walkSubSchema(schema.contains, ctx) : void 0;
|
|
387
391
|
const prefixItems = getArray(schema, "prefixItems");
|
|
388
392
|
if (prefixItems !== void 0) {
|
|
389
393
|
const walkedItems = prefixItems.filter(isObject).map((item) => walkNode(item, ctx));
|
|
@@ -394,7 +398,8 @@ function walkArray(schema, ctx) {
|
|
|
394
398
|
type: "tuple",
|
|
395
399
|
constraints: extractArrayConstraints(schema),
|
|
396
400
|
prefixItems: walkedItems,
|
|
397
|
-
...restItems !== void 0 ? { restItems } : {}
|
|
401
|
+
...restItems !== void 0 ? { restItems } : {},
|
|
402
|
+
...walkedContains !== void 0 ? { contains: walkedContains } : {}
|
|
398
403
|
};
|
|
399
404
|
}
|
|
400
405
|
const unevaluatedItemsSchema = getObject(schema, "unevaluatedItems");
|
|
@@ -410,14 +415,16 @@ function walkArray(schema, ctx) {
|
|
|
410
415
|
...ctx,
|
|
411
416
|
fieldOverrides: elementOverride
|
|
412
417
|
}),
|
|
413
|
-
...walkedUnevaluatedItems !== void 0 ? { unevaluatedItems: walkedUnevaluatedItems } : {}
|
|
418
|
+
...walkedUnevaluatedItems !== void 0 ? { unevaluatedItems: walkedUnevaluatedItems } : {},
|
|
419
|
+
...walkedContains !== void 0 ? { contains: walkedContains } : {}
|
|
414
420
|
};
|
|
415
421
|
}
|
|
416
422
|
return {
|
|
417
423
|
...buildBase(schema, ctx),
|
|
418
424
|
type: "array",
|
|
419
425
|
constraints: extractArrayConstraints(schema),
|
|
420
|
-
...walkedUnevaluatedItems !== void 0 ? { unevaluatedItems: walkedUnevaluatedItems } : {}
|
|
426
|
+
...walkedUnevaluatedItems !== void 0 ? { unevaluatedItems: walkedUnevaluatedItems } : {},
|
|
427
|
+
...walkedContains !== void 0 ? { contains: walkedContains } : {}
|
|
421
428
|
};
|
|
422
429
|
}
|
|
423
430
|
function walkUnion(options, ctx) {
|
|
@@ -14,11 +14,16 @@
|
|
|
14
14
|
/**
|
|
15
15
|
* Base class for all schema-components errors.
|
|
16
16
|
* Catch this to handle any library error uniformly.
|
|
17
|
+
*
|
|
18
|
+
* Forwards the optional `cause` to the native ES2022 `Error` constructor so
|
|
19
|
+
* `error.cause` is wired up by the runtime and rendered correctly by
|
|
20
|
+
* `util.inspect` ("Caused by: ..."). Subclasses that need a typed `cause`
|
|
21
|
+
* field still get it via the platform's own `Error.cause` getter.
|
|
17
22
|
*/
|
|
18
23
|
declare class SchemaError extends Error {
|
|
19
24
|
/** The schema input that caused the error. */
|
|
20
25
|
readonly schema: unknown;
|
|
21
|
-
constructor(message: string, schema: unknown);
|
|
26
|
+
constructor(message: string, schema: unknown, cause?: unknown);
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
24
29
|
* The adapter failed to convert the input schema to JSON Schema.
|
|
@@ -27,19 +32,12 @@ declare class SchemaError extends Error {
|
|
|
27
32
|
* JSON Schema, missing OpenAPI ref, unsupported ref format.
|
|
28
33
|
*/
|
|
29
34
|
declare class SchemaNormalisationError extends SchemaError {
|
|
30
|
-
readonly kind: "invalid-zod" | "zod3-unsupported" | "zod-transform-unsupported" | "zod-type-unrepresentable" | "zod-conversion-failed" | "invalid-json-schema" | "openapi-missing-ref" | "openapi-invalid" | "unknown";
|
|
35
|
+
readonly kind: "invalid-zod" | "zod3-unsupported" | "zod-transform-unsupported" | "zod-type-unrepresentable" | "zod-conversion-failed" | "zod-conversion-bug" | "zod-cycle-detected" | "zod-duplicate-id" | "invalid-json-schema" | "openapi-missing-ref" | "openapi-invalid" | "unknown";
|
|
31
36
|
/**
|
|
32
37
|
* For `zod-type-unrepresentable`, the offending Zod type name
|
|
33
38
|
* (e.g. "bigint", "date", "map", "set"). `undefined` for other kinds.
|
|
34
39
|
*/
|
|
35
40
|
readonly zodType: string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* The original underlying error, when this normalisation error wraps
|
|
38
|
-
* another exception (typically the error thrown by `z.toJSONSchema()`).
|
|
39
|
-
* Preserves the source stack trace so the root cause is not lost when
|
|
40
|
-
* the classifier translates the message.
|
|
41
|
-
*/
|
|
42
|
-
readonly cause: unknown;
|
|
43
41
|
constructor(message: string, schema: unknown, kind: SchemaNormalisationError["kind"], zodType?: string, cause?: unknown);
|
|
44
42
|
}
|
|
45
43
|
/**
|
|
@@ -50,8 +48,6 @@ declare class SchemaNormalisationError extends SchemaError {
|
|
|
50
48
|
declare class SchemaRenderError extends SchemaError {
|
|
51
49
|
/** The schema type being rendered when the error occurred. */
|
|
52
50
|
readonly schemaType: string;
|
|
53
|
-
/** The original error from the render function. */
|
|
54
|
-
readonly cause: unknown;
|
|
55
51
|
constructor(message: string, schema: unknown, schemaType: string, cause: unknown);
|
|
56
52
|
}
|
|
57
53
|
/**
|
package/dist/html/a11y.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as WalkedField } from "../types-
|
|
2
|
-
import { t as AllConstraints } from "../renderer-
|
|
1
|
+
import { M as WalkedField } from "../types-BnxPEElk.mjs";
|
|
2
|
+
import { t as AllConstraints } from "../renderer-DI6ZYf7a.mjs";
|
|
3
3
|
import { HtmlAttributes, HtmlNode } from "./html.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/html/a11y.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as SchemaMeta } from "../types-
|
|
2
|
-
import { o as HtmlResolver } from "../renderer-
|
|
1
|
+
import { T as SchemaMeta } from "../types-BnxPEElk.mjs";
|
|
2
|
+
import { o as HtmlResolver } from "../renderer-DI6ZYf7a.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/html/renderToHtml.d.ts
|
|
5
5
|
interface RenderToHtmlOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as SchemaMeta } from "../types-
|
|
2
|
-
import { o as HtmlResolver } from "../renderer-
|
|
1
|
+
import { T as SchemaMeta } from "../types-BnxPEElk.mjs";
|
|
2
|
+
import { o as HtmlResolver } from "../renderer-DI6ZYf7a.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/html/renderToHtmlStream.d.ts
|
|
5
5
|
interface StreamRenderOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as WalkedField } from "../types-
|
|
2
|
-
import { o as HtmlResolver } from "../renderer-
|
|
1
|
+
import { M as WalkedField } from "../types-BnxPEElk.mjs";
|
|
2
|
+
import { o as HtmlResolver } from "../renderer-DI6ZYf7a.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/html/renderers.d.ts
|
|
5
5
|
declare function dateInputType(format: string | undefined): string | undefined;
|
package/dist/html/renderers.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sortFieldsByOrder } from "../core/fieldOrder.mjs";
|
|
2
1
|
import { isSafeHyperlink, isSafeMailtoAddress } from "../core/uri.mjs";
|
|
2
|
+
import { sortFieldsByOrder } from "../core/fieldOrder.mjs";
|
|
3
3
|
import { h, raw, serialize } from "./html.mjs";
|
|
4
4
|
import { ariaDescribedByAttrs, ariaLabelAttrs, ariaReadonlyAttrs, ariaRequiredAttrs, buildHintElement, buildInputId, requiredIndicator } from "./a11y.mjs";
|
|
5
5
|
//#region src/html/renderers.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as WalkedField } from "../types-
|
|
2
|
-
import { o as HtmlResolver } from "../renderer-
|
|
1
|
+
import { M as WalkedField } from "../types-BnxPEElk.mjs";
|
|
2
|
+
import { o as HtmlResolver } from "../renderer-DI6ZYf7a.mjs";
|
|
3
3
|
import { HtmlElement } from "./html.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/html/streamRenderers.d.ts
|