@kubb/ast 5.0.0-beta.43 → 5.0.0-beta.44
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 +15 -467
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -18
- package/dist/index.js +3 -426
- package/dist/index.js.map +1 -1
- package/dist/{types-CC46hQUP.d.ts → types-lc8xMmUs.d.ts} +3 -39
- package/dist/types.d.ts +1 -1
- package/dist/utils-BIcKgbbc.js +626 -0
- package/dist/utils-BIcKgbbc.js.map +1 -0
- package/dist/utils-CMRZrT-w.cjs +794 -0
- package/dist/utils-CMRZrT-w.cjs.map +1 -0
- package/dist/utils.cjs +18 -0
- package/dist/utils.d.ts +205 -0
- package/dist/utils.js +2 -0
- package/package.json +5 -1
- package/src/factory.ts +1 -1
- package/src/index.ts +2 -6
- package/src/resolvers.ts +1 -15
- package/src/signature.ts +1 -1
- package/src/transformers.ts +1 -1
- package/src/types.ts +1 -1
- package/src/{utils.ts → utils/ast.ts} +6 -69
- package/src/utils/index.ts +295 -0
- package/src/refs.ts +0 -13
|
@@ -3386,7 +3386,7 @@ declare function transform(node: Node, options: TransformOptions): Node;
|
|
|
3386
3386
|
*/
|
|
3387
3387
|
declare function collect<T>(node: Node, options: CollectOptions<T>): Array<T>;
|
|
3388
3388
|
//#endregion
|
|
3389
|
-
//#region src/utils.d.ts
|
|
3389
|
+
//#region src/utils/ast.d.ts
|
|
3390
3390
|
/**
|
|
3391
3391
|
* Merges a ref node with its resolved schema, giving usage-site fields precedence.
|
|
3392
3392
|
*
|
|
@@ -3565,42 +3565,6 @@ declare function createOperationParams(node: OperationNode, options: CreateOpera
|
|
|
3565
3565
|
* and nested node content. Used internally to build the full source string for import filtering.
|
|
3566
3566
|
*/
|
|
3567
3567
|
declare function extractStringsFromNodes(nodes: Array<CodeNode> | undefined): string;
|
|
3568
|
-
/**
|
|
3569
|
-
* Renders an object key, quoting it only when it is not a valid variable name.
|
|
3570
|
-
*
|
|
3571
|
-
* @example
|
|
3572
|
-
* ```ts
|
|
3573
|
-
* objectKey('id') // 'id'
|
|
3574
|
-
* objectKey('x-total') // '"x-total"'
|
|
3575
|
-
* ```
|
|
3576
|
-
*/
|
|
3577
|
-
declare function objectKey(name: string): string;
|
|
3578
|
-
/**
|
|
3579
|
-
* Assembles a multi-line object literal from already-rendered `entries`, indenting each entry one
|
|
3580
|
-
* level and closing the brace at column zero. Nested objects built the same way indent cumulatively,
|
|
3581
|
-
* so callers never re-parse the generated code. A trailing comma is added per entry to match the
|
|
3582
|
-
* formatter's multi-line style.
|
|
3583
|
-
*
|
|
3584
|
-
* @example
|
|
3585
|
-
* ```ts
|
|
3586
|
-
* buildObject(['id: z.number()', 'name: z.string()'])
|
|
3587
|
-
* // '{\n id: z.number(),\n name: z.string(),\n}'
|
|
3588
|
-
* ```
|
|
3589
|
-
*/
|
|
3590
|
-
declare function buildObject(entries: Array<string>): string;
|
|
3591
|
-
/**
|
|
3592
|
-
* Assembles a bracketed list (array by default) from already-rendered `items`. Keeps everything on
|
|
3593
|
-
* one line when no item spans multiple lines, and otherwise puts each item on its own line, indented
|
|
3594
|
-
* one level with a trailing comma and the closing bracket at column zero. Use it for `z.union([…])`,
|
|
3595
|
-
* `z.array([…])`, and similar member lists so objects inside them nest correctly.
|
|
3596
|
-
*
|
|
3597
|
-
* @example
|
|
3598
|
-
* ```ts
|
|
3599
|
-
* buildList(['z.string()', 'z.number()'])
|
|
3600
|
-
* // '[z.string(), z.number()]'
|
|
3601
|
-
* ```
|
|
3602
|
-
*/
|
|
3603
|
-
declare function buildList(items: Array<string>, brackets?: [open: string, close: string]): string;
|
|
3604
3568
|
declare function collectUsedSchemaNames(operations: ReadonlyArray<OperationNode>, schemas: ReadonlyArray<SchemaNode>): Set<string>;
|
|
3605
3569
|
/**
|
|
3606
3570
|
* Identifies all schemas that participate in circular dependency chains, including direct self-loops.
|
|
@@ -3628,5 +3592,5 @@ declare function containsCircularRef(node: SchemaNode | undefined, {
|
|
|
3628
3592
|
excludeName?: string;
|
|
3629
3593
|
}): boolean;
|
|
3630
3594
|
//#endregion
|
|
3631
|
-
export {
|
|
3632
|
-
//# sourceMappingURL=types-
|
|
3595
|
+
export { update as $, ScalarSchemaType as $t, createBreak as A, FunctionParameterNode as At, createOperation as B, DateSchemaNode as Bt, PrinterFactoryOptions as C, httpMethods as Cn, HttpStatusCode as Ct, DistributiveOmit as D, ParameterNode as Dt, definePrinter as E, ParameterLocation as Et, createFunctionParameter as F, FileNode as Ft, createProperty as G, IntersectionSchemaNode as Gt, createParameter as H, EnumSchemaNode as Ht, createFunctionParameters as I, ImportNode as It, createSource as J, NumberSchemaNode as Jt, createResponse as K, Ipv4SchemaNode as Kt, createImport as L, SourceNode as Lt, createExport as M, ParameterGroupNode as Mt, createFile as N, ParamsTypeNode as Nt, UserFileNode as O, FunctionNodeType as Ot, createFunction as P, ExportNode as Pt, syncOptionality as Q, ScalarSchemaNode as Qt, createInput as R, ArraySchemaNode as Rt, Printer as S, VisitorDepth as Sn, ResponseNode as St, createPrinterFactory as T, StatusCode as Tt, createParameterGroup as U, EnumValueNode as Ut, createOutput as V, DatetimeSchemaNode as Vt, createParamsType as W, FormatStringSchemaNode as Wt, createText as X, PrimitiveSchemaType as Xt, createStreamInput as Y, ObjectSchemaNode as Yt, createType as Z, RefSchemaNode as Zt, VisitorContext as _, TypeDeclarationNode as _n, HttpMethod as _t, createDiscriminantNode as a, TimeSchemaNode as an, defineSchemaDialect as at, transform as b, NodeKind as bn, OperationNodeBase as bt, findCircularSchemas as c, PropertyNode as cn, DedupePlan as ct, AsyncVisitor as d, CodeNode as dn, Node as dt, SchemaNode as en, InferSchemaNode as et, CollectOptions as f, ConstNode as fn, InputMeta as ft, Visitor as g, TextNode as gn, GenericOperationNode as gt, TransformOptions as h, JsxNode as hn, OutputNode as ht, containsCircularRef as i, StringSchemaNode as in, SchemaDialect as it, createConst as j, FunctionParametersNode as jt, createArrowFunction as k, FunctionParamNode as kt, isStringType as l, ArrowFunctionNode as ln, applyDedupe as lt, ParentOf as m, JSDocNode as mn, InputStreamNode as mt, caseParams as n, SchemaType as nn, DispatchRule as nt, createOperationParams as o, UnionSchemaNode as on, BuildDedupePlanOptions as ot, CollectVisitor as p, FunctionNode as pn, InputNode as pt, createSchema as q, Ipv6SchemaNode as qt, collectUsedSchemaNames as r, SpecialSchemaType as rn, dispatch as rt, extractStringsFromNodes as s, UrlSchemaNode as sn, DedupeCanonical as st, OperationParamsResolver as t, SchemaNodeByType as tn, ParserOptions as tt, syncSchemaRef as u, BreakNode as un, buildDedupePlan as ut, WalkOptions as v, TypeNode as vn, HttpOperationNode as vt, PrinterPartial as w, schemaTypes as wn, MediaType as wt, walk as x, ScalarPrimitive as xn, OperationProtocol as xt, collect as y, BaseNode as yn, OperationNode as yt, createJsx as z, ComplexSchemaType as zt };
|
|
3596
|
+
//# sourceMappingURL=types-lc8xMmUs.d.ts.map
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as ScalarSchemaType, At as FunctionParameterNode, Bt as DateSchemaNode, C as PrinterFactoryOptions, Ct as HttpStatusCode, D as DistributiveOmit, Dt as ParameterNode, Et as ParameterLocation, Ft as FileNode, Gt as IntersectionSchemaNode, Ht as EnumSchemaNode, It as ImportNode, Jt as NumberSchemaNode, Kt as Ipv4SchemaNode, Lt as SourceNode, Mt as ParameterGroupNode, Nt as ParamsTypeNode, O as UserFileNode, Ot as FunctionNodeType, Pt as ExportNode, Qt as ScalarSchemaNode, Rt as ArraySchemaNode, S as Printer, Sn as VisitorDepth, St as ResponseNode, Tt as StatusCode, Ut as EnumValueNode, Vt as DatetimeSchemaNode, Wt as FormatStringSchemaNode, Xt as PrimitiveSchemaType, Yt as ObjectSchemaNode, Zt as RefSchemaNode, _ as VisitorContext, _n as TypeDeclarationNode, _t as HttpMethod, an as TimeSchemaNode, bn as NodeKind, bt as OperationNodeBase, cn as PropertyNode, ct as DedupePlan, d as AsyncVisitor, dn as CodeNode, dt as Node, en as SchemaNode, et as InferSchemaNode, f as CollectOptions, fn as ConstNode, ft as InputMeta, g as Visitor, gn as TextNode, gt as GenericOperationNode, h as TransformOptions, hn as JsxNode, ht as OutputNode, in as StringSchemaNode, it as SchemaDialect, jt as FunctionParametersNode, kt as FunctionParamNode, ln as ArrowFunctionNode, m as ParentOf, mn as JSDocNode, mt as InputStreamNode, nn as SchemaType, nt as DispatchRule, on as UnionSchemaNode, ot as BuildDedupePlanOptions, p as CollectVisitor, pn as FunctionNode, pt as InputNode, qt as Ipv6SchemaNode, rn as SpecialSchemaType, sn as UrlSchemaNode, st as DedupeCanonical, t as OperationParamsResolver, tn as SchemaNodeByType, tt as ParserOptions, un as BreakNode, v as WalkOptions, vn as TypeNode, vt as HttpOperationNode, w as PrinterPartial, wt as MediaType, xn as ScalarPrimitive, xt as OperationProtocol, yn as BaseNode, yt as OperationNode, zt as ComplexSchemaType } from "./types-lc8xMmUs.js";
|
|
2
2
|
export type { ArraySchemaNode, ArrowFunctionNode, AsyncVisitor, BaseNode, BreakNode, BuildDedupePlanOptions, CodeNode, CollectOptions, CollectVisitor, ComplexSchemaType, ConstNode, DateSchemaNode, DatetimeSchemaNode, DedupeCanonical, DedupePlan, DispatchRule, DistributiveOmit, EnumSchemaNode, EnumValueNode, ExportNode, FileNode, FormatStringSchemaNode, FunctionNode, FunctionNodeType, FunctionParamNode, FunctionParameterNode, FunctionParametersNode, GenericOperationNode, HttpMethod, HttpOperationNode, HttpStatusCode, ImportNode, InferSchemaNode, InputMeta, InputNode, InputStreamNode, IntersectionSchemaNode, Ipv4SchemaNode, Ipv6SchemaNode, JSDocNode, JsxNode, MediaType, Node, NodeKind, NumberSchemaNode, ObjectSchemaNode, OperationNode, OperationNodeBase, OperationParamsResolver, OperationProtocol, OutputNode, ParameterGroupNode, ParameterLocation, ParameterNode, ParamsTypeNode, ParentOf, ParserOptions, PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, PropertyNode, RefSchemaNode, ResponseNode, ScalarPrimitive, ScalarSchemaNode, ScalarSchemaType, SchemaDialect, SchemaNode, SchemaNodeByType, SchemaType, SourceNode, SpecialSchemaType, StatusCode, StringSchemaNode, TextNode, TimeSchemaNode, TransformOptions, TypeDeclarationNode, TypeNode, UnionSchemaNode, UrlSchemaNode, UserFileNode, Visitor, VisitorContext, VisitorDepth, WalkOptions };
|