@kubb/ast 5.0.0-beta.30 → 5.0.0-beta.31
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/index.cjs +275 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +219 -100
- package/dist/index.js +272 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/dedupe.ts +202 -0
- package/src/index.ts +2 -0
- package/src/signature.ts +135 -0
- package/src/types.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -190,105 +190,6 @@ declare const mediaTypes: {
|
|
|
190
190
|
readonly videoMp4: "video/mp4";
|
|
191
191
|
};
|
|
192
192
|
//#endregion
|
|
193
|
-
//#region src/dialect.d.ts
|
|
194
|
-
/**
|
|
195
|
-
* The spec-specific decisions a schema parser makes while converting a source
|
|
196
|
-
* document's schemas into Kubb AST nodes.
|
|
197
|
-
*
|
|
198
|
-
* Everything else in an adapter's schema pipeline is generic JSON Schema shared
|
|
199
|
-
* across specs; the dialect is the one seam where a spec differs — the
|
|
200
|
-
* "dialect layer" analogue of a database driver targeting Postgres vs MySQL.
|
|
201
|
-
* Pair it with {@link dispatch}: the rule table decides *which* converter runs,
|
|
202
|
-
* the dialect answers the spec-specific questions inside them.
|
|
203
|
-
*
|
|
204
|
-
* The guard methods (`isReference`, `isDiscriminator`) are type predicates so
|
|
205
|
-
* converters narrow the schema after a check; the type parameters carry those
|
|
206
|
-
* narrowed types through.
|
|
207
|
-
*
|
|
208
|
-
* Scope: this is the seam for the **JSON Schema family** — OpenAPI, AsyncAPI, and
|
|
209
|
-
* plain JSON Schema all share `$ref`, `allOf`/`oneOf`, `enum`, and `format`, and
|
|
210
|
-
* differ only in these few decisions. A spec built on a different type system
|
|
211
|
-
* (e.g. GraphQL, with non-null wrappers, interfaces, and named-type references
|
|
212
|
-
* instead of `$ref`) does not implement a `SchemaDialect`; it reuses the universal
|
|
213
|
-
* layer directly — the `Adapter` port, the AST factories, and {@link dispatch}
|
|
214
|
-
* with its own rule table — to emit the same nodes.
|
|
215
|
-
*
|
|
216
|
-
* @typeParam TSchema - The adapter's schema object type (e.g. an OpenAPI `SchemaObject`).
|
|
217
|
-
* @typeParam TRef - The narrowed `$ref` pointer type `isReference` proves.
|
|
218
|
-
* @typeParam TDiscriminated - The narrowed discriminated-schema type `isDiscriminator` proves.
|
|
219
|
-
* @typeParam TDocument - The source document `resolveRef` resolves against.
|
|
220
|
-
*/
|
|
221
|
-
type SchemaDialect<TSchema = unknown, TRef = TSchema, TDiscriminated = TSchema, TDocument = unknown> = {
|
|
222
|
-
/** Identifies the dialect in logs and while debugging dispatch. */name: string; /** Whether a schema should be treated as nullable. */
|
|
223
|
-
isNullable: (schema?: TSchema) => boolean; /** Whether a value is a `$ref` pointer object. */
|
|
224
|
-
isReference: (value?: unknown) => value is TRef; /** Whether a schema carries a structured discriminator (polymorphism). */
|
|
225
|
-
isDiscriminator: (value?: unknown) => value is TDiscriminated; /** Whether a schema represents binary data (converted to a `blob` node). */
|
|
226
|
-
isBinary: (schema: TSchema) => boolean; /** Resolves a local `$ref` pointer against the document, or nullish when it cannot. */
|
|
227
|
-
resolveRef: <TResolved>(document: TDocument, ref: string) => TResolved | null | undefined;
|
|
228
|
-
};
|
|
229
|
-
/**
|
|
230
|
-
* Identity helper that types a {@link SchemaDialect} for an adapter. Like
|
|
231
|
-
* `defineParser`, it adds no runtime behavior — it pins the dialect's type for
|
|
232
|
-
* inference and gives adapter authors a discoverable anchor.
|
|
233
|
-
*
|
|
234
|
-
* @example
|
|
235
|
-
* ```ts
|
|
236
|
-
* export const oasDialect = defineSchemaDialect({
|
|
237
|
-
* name: 'oas',
|
|
238
|
-
* isNullable,
|
|
239
|
-
* isReference,
|
|
240
|
-
* isDiscriminator,
|
|
241
|
-
* isBinary: (schema) => schema.type === 'string' && schema.contentMediaType === 'application/octet-stream',
|
|
242
|
-
* resolveRef,
|
|
243
|
-
* })
|
|
244
|
-
* ```
|
|
245
|
-
*/
|
|
246
|
-
declare function defineSchemaDialect<TSchema, TRef, TDiscriminated, TDocument>(dialect: SchemaDialect<TSchema, TRef, TDiscriminated, TDocument>): SchemaDialect<TSchema, TRef, TDiscriminated, TDocument>;
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region src/dispatch.d.ts
|
|
249
|
-
/**
|
|
250
|
-
* One entry in an ordered dispatch table: a predicate paired with a converter.
|
|
251
|
-
*
|
|
252
|
-
* @typeParam TContext - Per-input context handed to every rule. A spec adapter typically
|
|
253
|
-
* pre-computes this once per node (the source spec node plus derived fields like a
|
|
254
|
-
* normalized type or resolved options) so individual rules stay cheap predicates.
|
|
255
|
-
* @typeParam TNode - The node a rule produces, e.g. a Kubb AST `SchemaNode`.
|
|
256
|
-
*/
|
|
257
|
-
type DispatchRule<TContext, TNode> = {
|
|
258
|
-
/** Identifies the rule when reading the table or debugging which branch ran. */name: string; /** Returns `true` when this rule is responsible for the given context. */
|
|
259
|
-
match: (context: TContext) => boolean;
|
|
260
|
-
/**
|
|
261
|
-
* Produces a node for the context, or `null` to fall through to the next rule.
|
|
262
|
-
*
|
|
263
|
-
* Returning `null` lets a broad `match` defer: e.g. "has a `format`" matches many schemas,
|
|
264
|
-
* but only some formats are convertible — the rest fall through to plain `type` handling.
|
|
265
|
-
*/
|
|
266
|
-
convert: (context: TContext) => TNode | null;
|
|
267
|
-
};
|
|
268
|
-
/**
|
|
269
|
-
* Walks an ordered list of {@link DispatchRule}s and returns the first node produced.
|
|
270
|
-
*
|
|
271
|
-
* This is the shared backbone for spec adapters (OpenAPI today, AsyncAPI and others later).
|
|
272
|
-
* The contract an adapter follows is intentionally minimal:
|
|
273
|
-
*
|
|
274
|
-
* context → [rule.match → rule.convert] → node
|
|
275
|
-
*
|
|
276
|
-
* An adapter derives a context from a source spec node, then declares an ordered table of
|
|
277
|
-
* rules mapping spec shapes onto Kubb AST nodes. To add support for a new spec, write a new
|
|
278
|
-
* context type and a new rules table — the traversal here is reused unchanged.
|
|
279
|
-
*
|
|
280
|
-
* Order is significant: earlier rules win, so list higher-precedence or more specific shapes
|
|
281
|
-
* first (e.g. composition keywords before plain `type`). A rule whose `match` returns `true`
|
|
282
|
-
* may still `convert` to `null` to defer to later rules. When no rule produces a node this
|
|
283
|
-
* returns `null`, leaving the caller to apply its own fallback.
|
|
284
|
-
*
|
|
285
|
-
* @example
|
|
286
|
-
* ```ts
|
|
287
|
-
* const node = dispatch(schemaRules, schemaContext) ?? createSchema({ type: fallbackType })
|
|
288
|
-
* ```
|
|
289
|
-
*/
|
|
290
|
-
declare function dispatch<TContext, TNode>(rules: ReadonlyArray<DispatchRule<TContext, TNode>>, context: TContext): TNode | null;
|
|
291
|
-
//#endregion
|
|
292
193
|
//#region src/nodes/base.d.ts
|
|
293
194
|
/**
|
|
294
195
|
* `kind` values used by AST nodes.
|
|
@@ -2149,6 +2050,197 @@ type InputStreamNode = {
|
|
|
2149
2050
|
*/
|
|
2150
2051
|
type Node = InputNode | OutputNode | OperationNode | SchemaNode | PropertyNode | ParameterNode | ResponseNode | RequestBodyNode | ContentNode | FunctionParamNode | FileNode | ImportNode | ExportNode | SourceNode | ConstNode | TypeNode | ParamsTypeNode | FunctionNode | ArrowFunctionNode;
|
|
2151
2052
|
//#endregion
|
|
2053
|
+
//#region src/dedupe.d.ts
|
|
2054
|
+
/**
|
|
2055
|
+
* A canonical destination for a deduplicated shape: the shared schema name and
|
|
2056
|
+
* the synthetic `$ref` path that points at it.
|
|
2057
|
+
*/
|
|
2058
|
+
type DedupeCanonical = {
|
|
2059
|
+
/**
|
|
2060
|
+
* Canonical schema name every duplicate occurrence refers to.
|
|
2061
|
+
*/
|
|
2062
|
+
name: string;
|
|
2063
|
+
/**
|
|
2064
|
+
* `$ref` path stored on the generated `ref` nodes (for example `#/components/schemas/Status`).
|
|
2065
|
+
*/
|
|
2066
|
+
ref: string;
|
|
2067
|
+
};
|
|
2068
|
+
/**
|
|
2069
|
+
* The result of {@link buildDedupePlan}: a lookup from structural signature to its
|
|
2070
|
+
* canonical target, plus the freshly hoisted definitions that must be added to
|
|
2071
|
+
* the schema list.
|
|
2072
|
+
*/
|
|
2073
|
+
type DedupePlan = {
|
|
2074
|
+
/**
|
|
2075
|
+
* Maps a structural signature to the canonical schema that represents it.
|
|
2076
|
+
*/
|
|
2077
|
+
canonicalBySignature: Map<string, DedupeCanonical>;
|
|
2078
|
+
/**
|
|
2079
|
+
* New top-level schema definitions created for inline shapes that had no existing
|
|
2080
|
+
* named component. Nested duplicates inside each definition are already collapsed.
|
|
2081
|
+
*/
|
|
2082
|
+
hoisted: Array<SchemaNode>;
|
|
2083
|
+
};
|
|
2084
|
+
/**
|
|
2085
|
+
* Options that inject the naming and candidate policy into {@link buildDedupePlan}.
|
|
2086
|
+
* The mechanics (grouping, counting, rewriting) live here; the policy lives in the caller.
|
|
2087
|
+
*/
|
|
2088
|
+
type BuildDedupePlanOptions = {
|
|
2089
|
+
/**
|
|
2090
|
+
* Returns `true` when a node should be deduplicated. This is the only gate, so it must
|
|
2091
|
+
* reject both ineligible kinds (return `false` for anything other than, say, enums and
|
|
2092
|
+
* objects) and unsafe shapes (e.g. nodes that reference a circular schema).
|
|
2093
|
+
*/
|
|
2094
|
+
isCandidate: (node: SchemaNode) => boolean;
|
|
2095
|
+
/**
|
|
2096
|
+
* Produces the canonical name for an inline shape with no existing named component.
|
|
2097
|
+
* Return `null` to leave the shape inline (for example when no contextual name exists).
|
|
2098
|
+
*/
|
|
2099
|
+
nameFor: (node: SchemaNode, signature: string) => string | null;
|
|
2100
|
+
/**
|
|
2101
|
+
* Builds the `$ref` path for a canonical name.
|
|
2102
|
+
*/
|
|
2103
|
+
refFor: (name: string) => string;
|
|
2104
|
+
/**
|
|
2105
|
+
* Minimum number of occurrences before a shape is deduplicated.
|
|
2106
|
+
*
|
|
2107
|
+
* @default 2
|
|
2108
|
+
*/
|
|
2109
|
+
minOccurrences?: number;
|
|
2110
|
+
};
|
|
2111
|
+
/**
|
|
2112
|
+
* Rewrites a node, replacing every candidate sub-schema whose signature has a canonical
|
|
2113
|
+
* target with a `ref` to that target. Replacing a node with a `ref` prunes its subtree,
|
|
2114
|
+
* so nested duplicates inside a replaced shape are not visited again.
|
|
2115
|
+
*
|
|
2116
|
+
* Pass `skipRootMatch` when rewriting a canonical definition so its own root is not
|
|
2117
|
+
* turned into a reference to itself; nested duplicates are still collapsed.
|
|
2118
|
+
*
|
|
2119
|
+
* @example
|
|
2120
|
+
* ```ts
|
|
2121
|
+
* const next = applyDedupe(operationNode, plan.canonicalBySignature)
|
|
2122
|
+
* ```
|
|
2123
|
+
*/
|
|
2124
|
+
declare function applyDedupe(node: SchemaNode, canonicalBySignature: ReadonlyMap<string, DedupeCanonical>, skipRootMatch?: boolean): SchemaNode;
|
|
2125
|
+
declare function applyDedupe(node: OperationNode, canonicalBySignature: ReadonlyMap<string, DedupeCanonical>, skipRootMatch?: boolean): OperationNode;
|
|
2126
|
+
/**
|
|
2127
|
+
* Scans a forest of schema and operation nodes and produces a {@link DedupePlan}.
|
|
2128
|
+
*
|
|
2129
|
+
* A shape that occurs at least `minOccurrences` times is deduplicated: if any occurrence
|
|
2130
|
+
* is a named top-level schema, that name becomes the canonical (so other top-level duplicates
|
|
2131
|
+
* and inline copies turn into references to it); otherwise a new definition is hoisted using
|
|
2132
|
+
* `nameFor`. The plan is then applied per node with {@link applyDedupe}.
|
|
2133
|
+
*
|
|
2134
|
+
* @example
|
|
2135
|
+
* ```ts
|
|
2136
|
+
* const plan = buildDedupePlan([...schemaNodes, ...operationNodes], {
|
|
2137
|
+
* isCandidate: (node) => node.type === 'enum' || node.type === 'object',
|
|
2138
|
+
* nameFor: (node) => node.name ?? null,
|
|
2139
|
+
* refFor: (name) => `#/components/schemas/${name}`,
|
|
2140
|
+
* })
|
|
2141
|
+
* ```
|
|
2142
|
+
*/
|
|
2143
|
+
declare function buildDedupePlan(roots: ReadonlyArray<Node>, options: BuildDedupePlanOptions): DedupePlan;
|
|
2144
|
+
//#endregion
|
|
2145
|
+
//#region src/dialect.d.ts
|
|
2146
|
+
/**
|
|
2147
|
+
* The spec-specific decisions a schema parser makes while converting a source
|
|
2148
|
+
* document's schemas into Kubb AST nodes.
|
|
2149
|
+
*
|
|
2150
|
+
* Everything else in an adapter's schema pipeline is generic JSON Schema shared
|
|
2151
|
+
* across specs; the dialect is the one seam where a spec differs — the
|
|
2152
|
+
* "dialect layer" analogue of a database driver targeting Postgres vs MySQL.
|
|
2153
|
+
* Pair it with {@link dispatch}: the rule table decides *which* converter runs,
|
|
2154
|
+
* the dialect answers the spec-specific questions inside them.
|
|
2155
|
+
*
|
|
2156
|
+
* The guard methods (`isReference`, `isDiscriminator`) are type predicates so
|
|
2157
|
+
* converters narrow the schema after a check; the type parameters carry those
|
|
2158
|
+
* narrowed types through.
|
|
2159
|
+
*
|
|
2160
|
+
* Scope: this is the seam for the **JSON Schema family** — OpenAPI, AsyncAPI, and
|
|
2161
|
+
* plain JSON Schema all share `$ref`, `allOf`/`oneOf`, `enum`, and `format`, and
|
|
2162
|
+
* differ only in these few decisions. A spec built on a different type system
|
|
2163
|
+
* (e.g. GraphQL, with non-null wrappers, interfaces, and named-type references
|
|
2164
|
+
* instead of `$ref`) does not implement a `SchemaDialect`; it reuses the universal
|
|
2165
|
+
* layer directly — the `Adapter` port, the AST factories, and {@link dispatch}
|
|
2166
|
+
* with its own rule table — to emit the same nodes.
|
|
2167
|
+
*
|
|
2168
|
+
* @typeParam TSchema - The adapter's schema object type (e.g. an OpenAPI `SchemaObject`).
|
|
2169
|
+
* @typeParam TRef - The narrowed `$ref` pointer type `isReference` proves.
|
|
2170
|
+
* @typeParam TDiscriminated - The narrowed discriminated-schema type `isDiscriminator` proves.
|
|
2171
|
+
* @typeParam TDocument - The source document `resolveRef` resolves against.
|
|
2172
|
+
*/
|
|
2173
|
+
type SchemaDialect<TSchema = unknown, TRef = TSchema, TDiscriminated = TSchema, TDocument = unknown> = {
|
|
2174
|
+
/** Identifies the dialect in logs and while debugging dispatch. */name: string; /** Whether a schema should be treated as nullable. */
|
|
2175
|
+
isNullable: (schema?: TSchema) => boolean; /** Whether a value is a `$ref` pointer object. */
|
|
2176
|
+
isReference: (value?: unknown) => value is TRef; /** Whether a schema carries a structured discriminator (polymorphism). */
|
|
2177
|
+
isDiscriminator: (value?: unknown) => value is TDiscriminated; /** Whether a schema represents binary data (converted to a `blob` node). */
|
|
2178
|
+
isBinary: (schema: TSchema) => boolean; /** Resolves a local `$ref` pointer against the document, or nullish when it cannot. */
|
|
2179
|
+
resolveRef: <TResolved>(document: TDocument, ref: string) => TResolved | null | undefined;
|
|
2180
|
+
};
|
|
2181
|
+
/**
|
|
2182
|
+
* Identity helper that types a {@link SchemaDialect} for an adapter. Like
|
|
2183
|
+
* `defineParser`, it adds no runtime behavior — it pins the dialect's type for
|
|
2184
|
+
* inference and gives adapter authors a discoverable anchor.
|
|
2185
|
+
*
|
|
2186
|
+
* @example
|
|
2187
|
+
* ```ts
|
|
2188
|
+
* export const oasDialect = defineSchemaDialect({
|
|
2189
|
+
* name: 'oas',
|
|
2190
|
+
* isNullable,
|
|
2191
|
+
* isReference,
|
|
2192
|
+
* isDiscriminator,
|
|
2193
|
+
* isBinary: (schema) => schema.type === 'string' && schema.contentMediaType === 'application/octet-stream',
|
|
2194
|
+
* resolveRef,
|
|
2195
|
+
* })
|
|
2196
|
+
* ```
|
|
2197
|
+
*/
|
|
2198
|
+
declare function defineSchemaDialect<TSchema, TRef, TDiscriminated, TDocument>(dialect: SchemaDialect<TSchema, TRef, TDiscriminated, TDocument>): SchemaDialect<TSchema, TRef, TDiscriminated, TDocument>;
|
|
2199
|
+
//#endregion
|
|
2200
|
+
//#region src/dispatch.d.ts
|
|
2201
|
+
/**
|
|
2202
|
+
* One entry in an ordered dispatch table: a predicate paired with a converter.
|
|
2203
|
+
*
|
|
2204
|
+
* @typeParam TContext - Per-input context handed to every rule. A spec adapter typically
|
|
2205
|
+
* pre-computes this once per node (the source spec node plus derived fields like a
|
|
2206
|
+
* normalized type or resolved options) so individual rules stay cheap predicates.
|
|
2207
|
+
* @typeParam TNode - The node a rule produces, e.g. a Kubb AST `SchemaNode`.
|
|
2208
|
+
*/
|
|
2209
|
+
type DispatchRule<TContext, TNode> = {
|
|
2210
|
+
/** Identifies the rule when reading the table or debugging which branch ran. */name: string; /** Returns `true` when this rule is responsible for the given context. */
|
|
2211
|
+
match: (context: TContext) => boolean;
|
|
2212
|
+
/**
|
|
2213
|
+
* Produces a node for the context, or `null` to fall through to the next rule.
|
|
2214
|
+
*
|
|
2215
|
+
* Returning `null` lets a broad `match` defer: e.g. "has a `format`" matches many schemas,
|
|
2216
|
+
* but only some formats are convertible — the rest fall through to plain `type` handling.
|
|
2217
|
+
*/
|
|
2218
|
+
convert: (context: TContext) => TNode | null;
|
|
2219
|
+
};
|
|
2220
|
+
/**
|
|
2221
|
+
* Walks an ordered list of {@link DispatchRule}s and returns the first node produced.
|
|
2222
|
+
*
|
|
2223
|
+
* This is the shared backbone for spec adapters (OpenAPI today, AsyncAPI and others later).
|
|
2224
|
+
* The contract an adapter follows is intentionally minimal:
|
|
2225
|
+
*
|
|
2226
|
+
* context → [rule.match → rule.convert] → node
|
|
2227
|
+
*
|
|
2228
|
+
* An adapter derives a context from a source spec node, then declares an ordered table of
|
|
2229
|
+
* rules mapping spec shapes onto Kubb AST nodes. To add support for a new spec, write a new
|
|
2230
|
+
* context type and a new rules table — the traversal here is reused unchanged.
|
|
2231
|
+
*
|
|
2232
|
+
* Order is significant: earlier rules win, so list higher-precedence or more specific shapes
|
|
2233
|
+
* first (e.g. composition keywords before plain `type`). A rule whose `match` returns `true`
|
|
2234
|
+
* may still `convert` to `null` to defer to later rules. When no rule produces a node this
|
|
2235
|
+
* returns `null`, leaving the caller to apply its own fallback.
|
|
2236
|
+
*
|
|
2237
|
+
* @example
|
|
2238
|
+
* ```ts
|
|
2239
|
+
* const node = dispatch(schemaRules, schemaContext) ?? createSchema({ type: fallbackType })
|
|
2240
|
+
* ```
|
|
2241
|
+
*/
|
|
2242
|
+
declare function dispatch<TContext, TNode>(rules: ReadonlyArray<DispatchRule<TContext, TNode>>, context: TContext): TNode | null;
|
|
2243
|
+
//#endregion
|
|
2152
2244
|
//#region src/infer.d.ts
|
|
2153
2245
|
/**
|
|
2154
2246
|
* Shared parser options used by OAS-to-AST inference and parser flows.
|
|
@@ -3194,6 +3286,33 @@ declare function collectImports<TImport>({
|
|
|
3194
3286
|
resolve: (schemaName: string) => TImport | null;
|
|
3195
3287
|
}): Array<TImport>;
|
|
3196
3288
|
//#endregion
|
|
3289
|
+
//#region src/signature.d.ts
|
|
3290
|
+
/**
|
|
3291
|
+
* Computes a deterministic, shape-only signature (a fixed-length content hash) for a schema node.
|
|
3292
|
+
*
|
|
3293
|
+
* Two schemas share a signature when they are structurally identical, ignoring
|
|
3294
|
+
* documentation (`name`, `title`, `description`, `example`, `default`, `deprecated`)
|
|
3295
|
+
* and usage-slot flags (`optional`, `nullish`, `readOnly`, `writeOnly`). `nullable`
|
|
3296
|
+
* is kept because it changes the produced type. `ref` nodes compare by target name,
|
|
3297
|
+
* which also keeps the algorithm terminating on circular shapes.
|
|
3298
|
+
*
|
|
3299
|
+
* @example Two enums with different descriptions share a signature
|
|
3300
|
+
* ```ts
|
|
3301
|
+
* schemaSignature(createSchema({ type: 'enum', primitive: 'string', enumValues: ['a', 'b'], description: 'x' })) ===
|
|
3302
|
+
* schemaSignature(createSchema({ type: 'enum', primitive: 'string', enumValues: ['a', 'b'] }))
|
|
3303
|
+
* ```
|
|
3304
|
+
*/
|
|
3305
|
+
declare function schemaSignature(node: SchemaNode): string;
|
|
3306
|
+
/**
|
|
3307
|
+
* Returns `true` when two schema nodes are structurally identical under shape-only equality.
|
|
3308
|
+
*
|
|
3309
|
+
* @example
|
|
3310
|
+
* ```ts
|
|
3311
|
+
* isSchemaEqual(a, b) // a and b produce the same TypeScript type
|
|
3312
|
+
* ```
|
|
3313
|
+
*/
|
|
3314
|
+
declare function isSchemaEqual(a: SchemaNode, b: SchemaNode): boolean;
|
|
3315
|
+
//#endregion
|
|
3197
3316
|
//#region src/transformers.d.ts
|
|
3198
3317
|
/**
|
|
3199
3318
|
* Replaces a discriminator property's schema with a string enum of allowed values.
|
|
@@ -3754,5 +3873,5 @@ declare function containsCircularRef(node: SchemaNode | undefined, {
|
|
|
3754
3873
|
excludeName?: string;
|
|
3755
3874
|
}): boolean;
|
|
3756
3875
|
//#endregion
|
|
3757
|
-
export { type ArraySchemaNode, type ArrowFunctionNode, AsyncVisitor, type BaseNode, type BreakNode, type CodeNode, CollectOptions, CollectVisitor, type ComplexSchemaType, type ConstNode, type DateSchemaNode, type DatetimeSchemaNode, DispatchRule, DistributiveOmit, type EnumSchemaNode, type EnumValueNode, type ExportNode, type FileNode, type FormatStringSchemaNode, type FunctionNode, type FunctionNodeType, type FunctionParamNode, type FunctionParameterNode, type FunctionParametersNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type HttpStatusCode, type ImportNode, InferSchema, InferSchemaNode, type InputMeta, type InputNode, type InputStreamNode, type IntersectionSchemaNode, type Ipv4SchemaNode, type Ipv6SchemaNode, type JSDocNode, type JsxNode, type MediaType, Node, type NodeKind, type NumberSchemaNode, type ObjectSchemaNode, type OperationNode, type OperationNodeBase, OperationParamsResolver, type OperationProtocol, type OutputNode, type ParameterGroupNode, type ParameterLocation, type ParameterNode, type ParamsTypeNode, ParentOf, ParserOptions, type PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, type PropertyNode, RefMap, type RefSchemaNode, type ResponseNode, ScalarPrimitive, type ScalarSchemaNode, type ScalarSchemaType, SchemaDialect, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type SpecialSchemaType, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, TransformOptions, type TypeDeclarationNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, UserFileNode, Visitor, VisitorContext, VisitorDepth, WalkOptions, caseParams, childName, collect, collectImports, collectLazy, collectReferencedSchemaNames, collectUsedSchemaNames, containsCircularRef, createArrowFunction, createBreak, createConst, createContent, createDiscriminantNode, createExport, createFile, createFunction, createFunctionParameter, createFunctionParameters, createImport, createInput, createJsx, createOperation, createOperationParams, createOutput, createParameter, createParameterGroup, createParamsType, createPrinterFactory, createProperty, createRequestBody, createResponse, createSchema, createSource, createStreamInput, createText, createType, definePrinter, defineSchemaDialect, dispatch, enumPropName, extractRefName, extractStringsFromNodes, findCircularSchemas, findDiscriminator, httpMethods, isHttpOperationNode, isInputNode, isOperationNode, isOutputNode, isScalarPrimitive, isSchemaNode, isStringType, mediaTypes, mergeAdjacentObjects, mergeAdjacentObjectsLazy, narrowSchema, nodeKinds, resolveRefName, schemaTypes, setDiscriminatorEnum, setEnumName, simplifyUnion, syncOptionality, syncSchemaRef, transform, update, walk };
|
|
3876
|
+
export { type ArraySchemaNode, type ArrowFunctionNode, AsyncVisitor, type BaseNode, type BreakNode, BuildDedupePlanOptions, type CodeNode, CollectOptions, CollectVisitor, type ComplexSchemaType, type ConstNode, type DateSchemaNode, type DatetimeSchemaNode, DedupeCanonical, DedupePlan, DispatchRule, DistributiveOmit, type EnumSchemaNode, type EnumValueNode, type ExportNode, type FileNode, type FormatStringSchemaNode, type FunctionNode, type FunctionNodeType, type FunctionParamNode, type FunctionParameterNode, type FunctionParametersNode, type GenericOperationNode, type HttpMethod, type HttpOperationNode, type HttpStatusCode, type ImportNode, InferSchema, InferSchemaNode, type InputMeta, type InputNode, type InputStreamNode, type IntersectionSchemaNode, type Ipv4SchemaNode, type Ipv6SchemaNode, type JSDocNode, type JsxNode, type MediaType, Node, type NodeKind, type NumberSchemaNode, type ObjectSchemaNode, type OperationNode, type OperationNodeBase, OperationParamsResolver, type OperationProtocol, type OutputNode, type ParameterGroupNode, type ParameterLocation, type ParameterNode, type ParamsTypeNode, ParentOf, ParserOptions, type PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, type PropertyNode, RefMap, type RefSchemaNode, type ResponseNode, ScalarPrimitive, type ScalarSchemaNode, type ScalarSchemaType, SchemaDialect, type SchemaNode, type SchemaNodeByType, type SchemaType, type SourceNode, type SpecialSchemaType, type StatusCode, type StringSchemaNode, type TextNode, type TimeSchemaNode, TransformOptions, type TypeDeclarationNode, type TypeNode, type UnionSchemaNode, type UrlSchemaNode, UserFileNode, Visitor, VisitorContext, VisitorDepth, WalkOptions, applyDedupe, buildDedupePlan, caseParams, childName, collect, collectImports, collectLazy, collectReferencedSchemaNames, collectUsedSchemaNames, containsCircularRef, createArrowFunction, createBreak, createConst, createContent, createDiscriminantNode, createExport, createFile, createFunction, createFunctionParameter, createFunctionParameters, createImport, createInput, createJsx, createOperation, createOperationParams, createOutput, createParameter, createParameterGroup, createParamsType, createPrinterFactory, createProperty, createRequestBody, createResponse, createSchema, createSource, createStreamInput, createText, createType, definePrinter, defineSchemaDialect, dispatch, enumPropName, extractRefName, extractStringsFromNodes, findCircularSchemas, findDiscriminator, httpMethods, isHttpOperationNode, isInputNode, isOperationNode, isOutputNode, isScalarPrimitive, isSchemaEqual, isSchemaNode, isStringType, mediaTypes, mergeAdjacentObjects, mergeAdjacentObjectsLazy, narrowSchema, nodeKinds, resolveRefName, schemaSignature, schemaTypes, setDiscriminatorEnum, setEnumName, simplifyUnion, syncOptionality, syncSchemaRef, transform, update, walk };
|
|
3758
3877
|
//# sourceMappingURL=index.d.ts.map
|