schema-components 1.28.0 → 1.28.2
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/{adapter-MiEFkRVV.d.mts → adapter-DqlAnZ_w.d.mts} +1 -1
- package/dist/core/adapter.d.mts +1 -1
- package/dist/core/adapter.mjs +1 -1
- package/dist/core/normalise.d.mts +2 -2
- package/dist/core/normalise.mjs +1 -1
- package/dist/core/openapi30.mjs +1 -1
- package/dist/core/swagger2.mjs +1 -1
- package/dist/core/typeInference.d.mts +3 -3
- package/dist/{normalise-DCYp06Sr.mjs → normalise-Db1xaxgx.mjs} +2 -2
- package/dist/openapi/components.mjs +2 -2
- package/dist/openapi/resolve.d.mts +2 -2
- package/dist/openapi/resolve.mjs +4 -4
- package/dist/react/SchemaComponent.d.mts +2 -2
- package/dist/react/SchemaComponent.mjs +1 -1
- package/dist/react/SchemaView.d.mts +1 -1
- package/dist/react/SchemaView.mjs +1 -1
- package/dist/react/headlessRenderers.mjs +1 -1
- package/dist/themes/mui.mjs +1 -1
- package/package.json +1 -1
|
@@ -90,7 +90,7 @@ declare function detectSchemaKind(input: unknown): SchemaKind;
|
|
|
90
90
|
* field so consumers can still inspect the Zod stack trace.
|
|
91
91
|
*/
|
|
92
92
|
/**
|
|
93
|
-
* IO side passed to
|
|
93
|
+
* IO side passed to the internal `callToJsonSchema` helper. The Zod runtime accepts
|
|
94
94
|
* `"input" | "output"` for the corresponding `io` option on
|
|
95
95
|
* `z.toJSONSchema`. Defaults to `"output"` everywhere in the adapter
|
|
96
96
|
* pipeline; the parameter exists so a future renderer or component
|
package/dist/core/adapter.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { m as JsonObject, w as SchemaMeta } from "../types-BTB73MB8.mjs";
|
|
2
|
-
import { a as SchemaKind, c as extractRootMetaFromJson, i as SchemaIoSide, l as isCodecSchema, n as NormalisedSchema, o as __CLASSIFIER_RULES_FOR_TEST, r as SchemaInput, s as detectSchemaKind, t as NormaliseOptions, u as normaliseSchema } from "../adapter-
|
|
2
|
+
import { a as SchemaKind, c as extractRootMetaFromJson, i as SchemaIoSide, l as isCodecSchema, n as NormalisedSchema, o as __CLASSIFIER_RULES_FOR_TEST, r as SchemaInput, s as detectSchemaKind, t as NormaliseOptions, u as normaliseSchema } from "../adapter-DqlAnZ_w.mjs";
|
|
3
3
|
export { JsonObject, NormaliseOptions, NormalisedSchema, SchemaInput, SchemaIoSide, SchemaKind, SchemaMeta, __CLASSIFIER_RULES_FOR_TEST, detectSchemaKind, extractRootMetaFromJson, isCodecSchema, normaliseSchema };
|
package/dist/core/adapter.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { SchemaNormalisationError } from "./errors.mjs";
|
|
|
4
4
|
import { appendPointer, emitDiagnostic } from "./diagnostics.mjs";
|
|
5
5
|
import { dereference } from "./ref.mjs";
|
|
6
6
|
import { detectOpenApiVersion, inferJsonSchemaDraftWithReason, isSwagger2, matchJsonSchemaDraftUri } from "./version.mjs";
|
|
7
|
-
import { a as normaliseJsonSchema$1, o as normaliseOpenApiSchemas } from "../normalise-
|
|
7
|
+
import { a as normaliseJsonSchema$1, o as normaliseOpenApiSchemas } from "../normalise-Db1xaxgx.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/core/adapter.ts
|
|
10
10
|
/**
|
|
@@ -72,8 +72,8 @@ declare function deepNormaliseWithContext(schema: Record<string, unknown>, trans
|
|
|
72
72
|
*
|
|
73
73
|
* This function preserves the no-context signature for the OpenAPI 3.0
|
|
74
74
|
* and Swagger 2.0 normalisers that compose it directly. The JSON Schema
|
|
75
|
-
* normalisation path uses
|
|
76
|
-
*
|
|
75
|
+
* normalisation path uses the internal `normaliseDraft04NodeWithContext`
|
|
76
|
+
* helper via `deepNormaliseWithContext` to thread diagnostics.
|
|
77
77
|
*/
|
|
78
78
|
declare function normaliseDraft04Node(node: Record<string, unknown>): Record<string, unknown>;
|
|
79
79
|
/**
|
package/dist/core/normalise.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as normaliseJsonSchema, i as normaliseDraft04Node, n as deepNormaliseWithContext, o as normaliseOpenApiSchemas, r as documentContainsKeyword, s as selectDraftTransform, t as deepNormalise } from "../normalise-
|
|
1
|
+
import { a as normaliseJsonSchema, i as normaliseDraft04Node, n as deepNormaliseWithContext, o as normaliseOpenApiSchemas, r as documentContainsKeyword, s as selectDraftTransform, t as deepNormalise } from "../normalise-Db1xaxgx.mjs";
|
|
2
2
|
export { deepNormalise, deepNormaliseWithContext, documentContainsKeyword, normaliseDraft04Node, normaliseJsonSchema, normaliseOpenApiSchemas, selectDraftTransform };
|
package/dist/core/openapi30.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as deepNormaliseOpenApiDoc, f as liftExampleToExamples, h as normaliseOpenApi30Node, l as applyDiscriminatorAllOfPrepass, m as normaliseOpenApi30Discriminator, p as normaliseOpenApi30Combined, u as deepNormaliseOpenApi30Doc } from "../normalise-
|
|
1
|
+
import { d as deepNormaliseOpenApiDoc, f as liftExampleToExamples, h as normaliseOpenApi30Node, l as applyDiscriminatorAllOfPrepass, m as normaliseOpenApi30Discriminator, p as normaliseOpenApi30Combined, u as deepNormaliseOpenApi30Doc } from "../normalise-Db1xaxgx.mjs";
|
|
2
2
|
export { applyDiscriminatorAllOfPrepass, deepNormaliseOpenApi30Doc, deepNormaliseOpenApiDoc, liftExampleToExamples, normaliseOpenApi30Combined, normaliseOpenApi30Discriminator, normaliseOpenApi30Node };
|
package/dist/core/swagger2.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as normaliseSwagger2Document } from "../normalise-
|
|
1
|
+
import { c as normaliseSwagger2Document } from "../normalise-Db1xaxgx.mjs";
|
|
2
2
|
export { normaliseSwagger2Document };
|
|
@@ -199,7 +199,7 @@ type GetDiscriminatorMapping<S> = S extends {
|
|
|
199
199
|
* its sibling defs because the ref branch fires before `ExtractDefs` runs
|
|
200
200
|
* inside `ObjectSchemaToTs`.
|
|
201
201
|
*
|
|
202
|
-
* Merge semantics (per-key resolution via
|
|
202
|
+
* Merge semantics (per-key resolution via `CollisionSafeMerge`):
|
|
203
203
|
* - Parent-only keys: parent value wins
|
|
204
204
|
* - Local-only keys: local value wins
|
|
205
205
|
* - Shared keys: parent value wins (caller / inherited context takes
|
|
@@ -240,7 +240,7 @@ type IsEmptyDefs<T> = [keyof T] extends [never] ? true : string extends keyof T
|
|
|
240
240
|
/**
|
|
241
241
|
* True when the schema declares `$defs`, `definitions`, or
|
|
242
242
|
* `components.schemas` as an object, false otherwise. Used by
|
|
243
|
-
*
|
|
243
|
+
* `MergeRootDefs` and `ExtractDefs` to avoid intersecting
|
|
244
244
|
* the parent context with an empty index-signature sentinel.
|
|
245
245
|
*
|
|
246
246
|
* `components.schemas` is recognised so OpenAPI documents whose root
|
|
@@ -599,7 +599,7 @@ type RequiredKeysOf<S> = S extends {
|
|
|
599
599
|
* Also indexes schemas with `$anchor` or `$dynamicAnchor` by their anchor
|
|
600
600
|
* name, enabling `#SomeName` ref resolution.
|
|
601
601
|
*
|
|
602
|
-
* Shares merge semantics with
|
|
602
|
+
* Shares merge semantics with `MergeRootDefs`: caller-supplied
|
|
603
603
|
* (`ParentDefs`) entries win on key collision, the empty-default
|
|
604
604
|
* sentinel is detected so it does not poison the parent context, and the
|
|
605
605
|
* `HasLocalDefs` guard short-circuits when the current node declares no
|
|
@@ -1735,8 +1735,8 @@ function applyDraft04Translations(node, ctx) {
|
|
|
1735
1735
|
*
|
|
1736
1736
|
* This function preserves the no-context signature for the OpenAPI 3.0
|
|
1737
1737
|
* and Swagger 2.0 normalisers that compose it directly. The JSON Schema
|
|
1738
|
-
* normalisation path uses
|
|
1739
|
-
*
|
|
1738
|
+
* normalisation path uses the internal `normaliseDraft04NodeWithContext`
|
|
1739
|
+
* helper via `deepNormaliseWithContext` to thread diagnostics.
|
|
1740
1740
|
*/
|
|
1741
1741
|
function normaliseDraft04Node(node) {
|
|
1742
1742
|
applyDraft04Translations(node, void 0);
|
|
@@ -2,15 +2,15 @@ import { isObject, toRecordOrUndefined } from "../core/guards.mjs";
|
|
|
2
2
|
import { emitDiagnostic } from "../core/diagnostics.mjs";
|
|
3
3
|
import { extractRootMetaFromJson } from "../core/adapter.mjs";
|
|
4
4
|
import { walk } from "../core/walker.mjs";
|
|
5
|
+
import { joinPath, renderField, sanitisePrefix } from "../react/SchemaComponent.mjs";
|
|
5
6
|
import { ApiCallbacks } from "./ApiCallbacks.mjs";
|
|
6
7
|
import { ApiLinks } from "./ApiLinks.mjs";
|
|
7
8
|
import { ApiResponseHeaders } from "./ApiResponseHeaders.mjs";
|
|
8
9
|
import { ApiSecurity } from "./ApiSecurity.mjs";
|
|
9
10
|
import { getExternalDocs, getLinks, getSecurityRequirements, getSecuritySchemes, getXmlInfo, listCallbacks, listWebhooks } from "./parser.mjs";
|
|
10
|
-
import { joinPath, renderField, sanitisePrefix } from "../react/SchemaComponent.mjs";
|
|
11
11
|
import { getParsed, resolveOperationFromParsed, resolveParametersFromParsed, resolveRequestBodyFromParsed, resolveResponseFromParsed, toDoc } from "./resolve.mjs";
|
|
12
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
12
|
import { useId } from "react";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
//#region src/openapi/components.tsx
|
|
15
15
|
/**
|
|
16
16
|
* OpenAPI React components with type-safe generics.
|
|
@@ -33,8 +33,8 @@ import { OpenApiDocument, OperationInfo, ParameterInfo, ResponseInfo, getRequest
|
|
|
33
33
|
* per real cause regardless of how many child renders share the
|
|
34
34
|
* sink.
|
|
35
35
|
*
|
|
36
|
-
* Strict mode is treated as a per-call invariant — see
|
|
37
|
-
*
|
|
36
|
+
* Strict mode is treated as a per-call invariant — see the internal
|
|
37
|
+
* `replayCapturedDiagnostics` helper below for the rationale.
|
|
38
38
|
*/
|
|
39
39
|
declare function getParsed(doc: Record<string, unknown>, diagnostics?: DiagnosticsOptions): OpenApiDocument;
|
|
40
40
|
/**
|
package/dist/openapi/resolve.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import "../core/limits.mjs";
|
|
|
3
3
|
import { emitDiagnostic } from "../core/diagnostics.mjs";
|
|
4
4
|
import { isPrototypePollutingKey } from "../core/uri.mjs";
|
|
5
5
|
import { detectOpenApiVersion } from "../core/version.mjs";
|
|
6
|
-
import { o as normaliseOpenApiSchemas, r as documentContainsKeyword } from "../normalise-
|
|
6
|
+
import { o as normaliseOpenApiSchemas, r as documentContainsKeyword } from "../normalise-Db1xaxgx.mjs";
|
|
7
7
|
import { resolveRefChain } from "../core/refChain.mjs";
|
|
8
8
|
import { getParameters, getRequestBody, getResponses, listAllOperations, parseOpenApiDocument } from "./parser.mjs";
|
|
9
9
|
//#region src/openapi/resolve.ts
|
|
@@ -46,8 +46,8 @@ const docCache = /* @__PURE__ */ new WeakMap();
|
|
|
46
46
|
* per real cause regardless of how many child renders share the
|
|
47
47
|
* sink.
|
|
48
48
|
*
|
|
49
|
-
* Strict mode is treated as a per-call invariant — see
|
|
50
|
-
*
|
|
49
|
+
* Strict mode is treated as a per-call invariant — see the internal
|
|
50
|
+
* `replayCapturedDiagnostics` helper below for the rationale.
|
|
51
51
|
*/
|
|
52
52
|
function getParsed(doc, diagnostics) {
|
|
53
53
|
let cached = docCache.get(doc);
|
|
@@ -70,7 +70,7 @@ function getParsed(doc, diagnostics) {
|
|
|
70
70
|
* subsequent caller to re-run the pipeline from scratch — and the
|
|
71
71
|
* defect this caching strategy fixes was precisely that kind of
|
|
72
72
|
* re-running. Strict is enforced instead during replay
|
|
73
|
-
* (see
|
|
73
|
+
* (see `replayCapturedDiagnostics`).
|
|
74
74
|
*/
|
|
75
75
|
function buildCachedParse(doc) {
|
|
76
76
|
const captured = [];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { d as FieldOverrides, j as WalkedField, u as FieldOverride, w as SchemaMeta } from "../types-BTB73MB8.mjs";
|
|
2
2
|
import { t as Diagnostic } from "../diagnostics-Cbwak-ZX.mjs";
|
|
3
|
-
import { i as SchemaIoSide } from "../adapter-
|
|
3
|
+
import { i as SchemaIoSide } from "../adapter-DqlAnZ_w.mjs";
|
|
4
4
|
import { t as SchemaError } from "../errors-DQSIK4n1.mjs";
|
|
5
5
|
import { l as RenderProps, r as ComponentResolver } from "../renderer-Ul9taFYp.mjs";
|
|
6
6
|
import { FromJSONSchema, FromJSONSchemaMode, IsSwagger2Doc, PathOfType, RejectUnrepresentableZod, ResolveOpenAPIRef, TypeAtPath, __SchemaInferenceFellBack } from "../core/typeInference.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
8
|
import { ReactNode } from "react";
|
|
9
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
10
10
|
|
|
11
11
|
//#region src/react/SchemaComponent.d.ts
|
|
12
12
|
/**
|
|
@@ -8,8 +8,8 @@ import { walk } from "../core/walker.mjs";
|
|
|
8
8
|
import { headlessResolver } from "./headless.mjs";
|
|
9
9
|
import { resolvePath, resolveValue, setNestedValue } from "./fieldPath.mjs";
|
|
10
10
|
import { z } from "zod";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
11
|
import { createContext, isValidElement, useCallback, useContext, useId, useMemo } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
//#region src/react/SchemaComponent.tsx
|
|
14
14
|
/**
|
|
15
15
|
* <SchemaComponent> — renders UI from Zod, JSON Schema, or OpenAPI schemas.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { w as SchemaMeta } from "../types-BTB73MB8.mjs";
|
|
2
2
|
import { t as Diagnostic } from "../diagnostics-Cbwak-ZX.mjs";
|
|
3
|
-
import { i as SchemaIoSide } from "../adapter-
|
|
3
|
+
import { i as SchemaIoSide } from "../adapter-DqlAnZ_w.mjs";
|
|
4
4
|
import { r as ComponentResolver } from "../renderer-Ul9taFYp.mjs";
|
|
5
5
|
import { RejectUnrepresentableZod } from "../core/typeInference.mjs";
|
|
6
6
|
import { InferredValue, WidgetMap } from "./SchemaComponent.mjs";
|
|
@@ -5,8 +5,8 @@ import { buildRenderProps, getRenderFunction, mergeResolvers } from "../core/ren
|
|
|
5
5
|
import { walk } from "../core/walker.mjs";
|
|
6
6
|
import { headlessResolver } from "./headless.mjs";
|
|
7
7
|
import { joinPath, sanitisePrefix } from "./SchemaComponent.mjs";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
8
|
import { createElement, isValidElement, useId } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
//#region src/react/SchemaView.tsx
|
|
11
11
|
/**
|
|
12
12
|
* React Server Component for read-only schema rendering.
|
|
@@ -7,8 +7,8 @@ import { fieldDomId, panelIdFor, tabIdFor } from "../core/idPath.mjs";
|
|
|
7
7
|
import { matchUnionOption, resolveDiscriminatedActive } from "../core/unionMatch.mjs";
|
|
8
8
|
import { displayJsonValue } from "../core/walkBuilders.mjs";
|
|
9
9
|
import { buildAriaAttrs } from "./a11y.mjs";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { isValidElement, useCallback, useEffect, useRef } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
//#region src/react/headlessRenderers.tsx
|
|
13
13
|
/**
|
|
14
14
|
* Headless renderer functions — one per schema type.
|
package/dist/themes/mui.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { isObject } from "../core/guards.mjs";
|
|
|
2
2
|
import { sortFieldsByOrder } from "../core/fieldOrder.mjs";
|
|
3
3
|
import { inputId, toReactNode } from "../react/headlessRenderers.mjs";
|
|
4
4
|
import { headlessResolver } from "../react/headless.mjs";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { isValidElement } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/themes/mui.tsx
|
|
8
8
|
function ariaRequired(tree) {
|
|
9
9
|
return { required: tree.isOptional === false };
|