@kubb/ast 5.0.0-beta.43 → 5.0.0-beta.45

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.
@@ -121,7 +121,6 @@ declare const schemaTypes: {
121
121
  */
122
122
  readonly never: "never";
123
123
  };
124
- type ScalarPrimitive = 'string' | 'number' | 'integer' | 'bigint' | 'boolean';
125
124
  /**
126
125
  * HTTP method identifiers used by operation nodes.
127
126
  *
@@ -256,11 +255,6 @@ type TypeNode = BaseNode & {
256
255
  */
257
256
  nodes?: Array<CodeNode>;
258
257
  };
259
- /**
260
- * Convenience alias for {@link TypeNode}.
261
- * @deprecated Use `TypeNode` directly.
262
- */
263
- type TypeDeclarationNode = TypeNode;
264
258
  /**
265
259
  * AST node representing a TypeScript `function` declaration.
266
260
  *
@@ -1630,15 +1624,6 @@ type HttpStatusCode = '100' | '101' | '102' | '103' | '200' | '201' | '202' | '2
1630
1624
  * ```
1631
1625
  */
1632
1626
  type StatusCode = HttpStatusCode | 'default';
1633
- /**
1634
- * Supported media type strings used in request and response bodies.
1635
- *
1636
- * @example
1637
- * ```ts
1638
- * const mediaType: MediaType = 'application/json'
1639
- * ```
1640
- */
1641
- type MediaType = 'application/json' | 'application/xml' | 'application/x-www-form-urlencoded' | 'application/octet-stream' | 'application/pdf' | 'application/zip' | 'application/graphql' | 'multipart/form-data' | 'text/plain' | 'text/html' | 'text/csv' | 'text/xml' | 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'image/svg+xml' | 'audio/mpeg' | 'video/mp4';
1642
1627
  //#endregion
1643
1628
  //#region src/nodes/response.d.ts
1644
1629
  /**
@@ -2196,10 +2181,10 @@ type ParserOptions = {
2196
2181
  dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
2197
2182
  /**
2198
2183
  * How `type: 'integer'` (and `format: 'int64'`) maps to TypeScript.
2199
- * - `'number'` fits most JSON APIs. Loses precision above `Number.MAX_SAFE_INTEGER`.
2200
2184
  * - `'bigint'` is exact for 64-bit IDs, but does not round-trip through JSON.
2185
+ * - `'number'` fits most JSON APIs. Loses precision above `Number.MAX_SAFE_INTEGER`.
2201
2186
  *
2202
- * @default 'number'
2187
+ * @default 'bigint'
2203
2188
  */
2204
2189
  integerType?: 'number' | 'bigint';
2205
2190
  /**
@@ -3386,7 +3371,7 @@ declare function transform(node: Node, options: TransformOptions): Node;
3386
3371
  */
3387
3372
  declare function collect<T>(node: Node, options: CollectOptions<T>): Array<T>;
3388
3373
  //#endregion
3389
- //#region src/utils.d.ts
3374
+ //#region src/utils/ast.d.ts
3390
3375
  /**
3391
3376
  * Merges a ref node with its resolved schema, giving usage-site fields precedence.
3392
3377
  *
@@ -3565,42 +3550,6 @@ declare function createOperationParams(node: OperationNode, options: CreateOpera
3565
3550
  * and nested node content. Used internally to build the full source string for import filtering.
3566
3551
  */
3567
3552
  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
3553
  declare function collectUsedSchemaNames(operations: ReadonlyArray<OperationNode>, schemas: ReadonlyArray<SchemaNode>): Set<string>;
3605
3554
  /**
3606
3555
  * Identifies all schemas that participate in circular dependency chains, including direct self-loops.
@@ -3628,5 +3577,5 @@ declare function containsCircularRef(node: SchemaNode | undefined, {
3628
3577
  excludeName?: string;
3629
3578
  }): boolean;
3630
3579
  //#endregion
3631
- export { createText as $, PrimitiveSchemaType as $t, DistributiveOmit as A, ParameterNode as At, createImport as B, SourceNode as Bt, transform as C, NodeKind as Cn, OperationNodeBase as Ct, PrinterPartial as D, schemaTypes as Dn, MediaType as Dt, PrinterFactoryOptions as E, httpMethods as En, HttpStatusCode as Et, createExport as F, ParameterGroupNode as Ft, createParameter as G, EnumSchemaNode as Gt, createJsx as H, ComplexSchemaType as Ht, createFile as I, ParamsTypeNode as It, createProperty as J, IntersectionSchemaNode as Jt, createParameterGroup as K, EnumValueNode as Kt, createFunction as L, ExportNode as Lt, createArrowFunction as M, FunctionParamNode as Mt, createBreak as N, FunctionParameterNode as Nt, createPrinterFactory as O, StatusCode as Ot, createConst as P, FunctionParametersNode as Pt, createStreamInput as Q, ObjectSchemaNode as Qt, createFunctionParameter as R, FileNode as Rt, collect as S, BaseNode as Sn, OperationNode as St, Printer as T, VisitorDepth as Tn, ResponseNode as Tt, createOperation as U, DateSchemaNode as Ut, createInput as V, ArraySchemaNode as Vt, createOutput as W, DatetimeSchemaNode as Wt, createSchema as X, Ipv6SchemaNode as Xt, createResponse as Y, Ipv4SchemaNode as Yt, createSource as Z, NumberSchemaNode as Zt, ParentOf as _, JSDocNode as _n, InputStreamNode as _t, collectUsedSchemaNames as a, SchemaType as an, DispatchRule as at, VisitorContext as b, TypeDeclarationNode as bn, HttpMethod as bt, createOperationParams as c, TimeSchemaNode as cn, defineSchemaDialect as ct, isStringType as d, PropertyNode as dn, DedupePlan as dt, RefSchemaNode as en, createType as et, objectKey as f, ArrowFunctionNode as fn, applyDedupe as ft, CollectVisitor as g, FunctionNode as gn, InputNode as gt, CollectOptions as h, ConstNode as hn, InputMeta as ht, caseParams as i, SchemaNodeByType as in, ParserOptions as it, UserFileNode as j, FunctionNodeType as jt, definePrinter as k, ParameterLocation as kt, extractStringsFromNodes as l, UnionSchemaNode as ln, BuildDedupePlanOptions as lt, AsyncVisitor as m, CodeNode as mn, Node as mt, buildList as n, ScalarSchemaType as nn, update as nt, containsCircularRef as o, SpecialSchemaType as on, dispatch as ot, syncSchemaRef as p, BreakNode as pn, buildDedupePlan as pt, createParamsType as q, FormatStringSchemaNode as qt, buildObject as r, SchemaNode as rn, InferSchemaNode as rt, createDiscriminantNode as s, StringSchemaNode as sn, SchemaDialect as st, OperationParamsResolver as t, ScalarSchemaNode as tn, syncOptionality as tt, findCircularSchemas as u, UrlSchemaNode as un, DedupeCanonical as ut, TransformOptions as v, JsxNode as vn, OutputNode as vt, walk as w, ScalarPrimitive as wn, OperationProtocol as wt, WalkOptions as x, TypeNode as xn, HttpOperationNode as xt, Visitor as y, TextNode as yn, GenericOperationNode as yt, createFunctionParameters as z, ImportNode as zt };
3632
- //# sourceMappingURL=types-CC46hQUP.d.ts.map
3580
+ export { SchemaDialect as $, httpMethods as $t, createFunctionParameter as A, IntersectionSchemaNode as At, createProperty as B, TimeSchemaNode as Bt, UserFileNode as C, FileNode as Ct, createExport as D, DateSchemaNode as Dt, createConst as E, ArraySchemaNode as Et, createOperation as F, ScalarSchemaType as Ft, createText as G, CodeNode as Gt, createSchema as H, UrlSchemaNode as Ht, createOutput as I, SchemaNode as It, update as J, JSDocNode as Jt, createType as K, ConstNode as Kt, createParameter as L, SchemaNodeByType as Lt, createImport as M, ObjectSchemaNode as Mt, createInput as N, PrimitiveSchemaType as Nt, createFile as O, DatetimeSchemaNode as Ot, createJsx as P, RefSchemaNode as Pt, dispatch as Q, NodeKind as Qt, createParameterGroup as R, SchemaType as Rt, DistributiveOmit as S, ExportNode as St, createBreak as T, SourceNode as Tt, createSource as U, PropertyNode as Ut, createResponse as V, UnionSchemaNode as Vt, createStreamInput as W, ArrowFunctionNode as Wt, ParserOptions as X, TextNode as Xt, InferSchemaNode as Y, JsxNode as Yt, DispatchRule as Z, TypeNode as Zt, Printer as _, FunctionParamNode as _t, createDiscriminantNode as a, InputMeta as at, createPrinterFactory as b, ParameterGroupNode as bt, findCircularSchemas as c, OutputNode as ct, ParentOf as d, OperationNode as dt, schemaTypes as en, defineSchemaDialect as et, Visitor as f, ResponseNode as ft, walk as g, FunctionNodeType as gt, transform as h, ParameterNode as ht, containsCircularRef as i, Node as it, createFunctionParameters as j, NumberSchemaNode as jt, createFunction as k, EnumSchemaNode as kt, isStringType as l, HttpMethod as lt, collect as m, ParameterLocation as mt, caseParams as n, applyDedupe as nt, createOperationParams as o, InputNode as ot, VisitorContext as p, StatusCode as pt, syncOptionality as q, FunctionNode as qt, collectUsedSchemaNames as r, buildDedupePlan as rt, extractStringsFromNodes as s, InputStreamNode as st, OperationParamsResolver as t, DedupePlan as tt, syncSchemaRef as u, HttpOperationNode as ut, PrinterFactoryOptions as v, FunctionParameterNode as vt, createArrowFunction as w, ImportNode as wt, definePrinter as x, ParamsTypeNode as xt, PrinterPartial as y, FunctionParametersNode as yt, createParamsType as z, StringSchemaNode as zt };
3581
+ //# sourceMappingURL=types-BaaNZbSi.d.ts.map
package/dist/types.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $t as PrimitiveSchemaType, A as DistributiveOmit, At as ParameterNode, Bt as SourceNode, Cn as NodeKind, Ct as OperationNodeBase, D as PrinterPartial, Dt as MediaType, E as PrinterFactoryOptions, Et as HttpStatusCode, Ft as ParameterGroupNode, Gt as EnumSchemaNode, Ht as ComplexSchemaType, It as ParamsTypeNode, Jt as IntersectionSchemaNode, Kt as EnumValueNode, Lt as ExportNode, Mt as FunctionParamNode, Nt as FunctionParameterNode, Ot as StatusCode, Pt as FunctionParametersNode, Qt as ObjectSchemaNode, Rt as FileNode, Sn as BaseNode, St as OperationNode, T as Printer, Tn as VisitorDepth, Tt as ResponseNode, Ut as DateSchemaNode, Vt as ArraySchemaNode, Wt as DatetimeSchemaNode, Xt as Ipv6SchemaNode, Yt as Ipv4SchemaNode, Zt as NumberSchemaNode, _ as ParentOf, _n as JSDocNode, _t as InputStreamNode, an as SchemaType, at as DispatchRule, b as VisitorContext, bn as TypeDeclarationNode, bt as HttpMethod, cn as TimeSchemaNode, dn as PropertyNode, dt as DedupePlan, en as RefSchemaNode, fn as ArrowFunctionNode, g as CollectVisitor, gn as FunctionNode, gt as InputNode, h as CollectOptions, hn as ConstNode, ht as InputMeta, in as SchemaNodeByType, it as ParserOptions, j as UserFileNode, jt as FunctionNodeType, kt as ParameterLocation, ln as UnionSchemaNode, lt as BuildDedupePlanOptions, m as AsyncVisitor, mn as CodeNode, mt as Node, nn as ScalarSchemaType, on as SpecialSchemaType, pn as BreakNode, qt as FormatStringSchemaNode, rn as SchemaNode, rt as InferSchemaNode, sn as StringSchemaNode, st as SchemaDialect, t as OperationParamsResolver, tn as ScalarSchemaNode, un as UrlSchemaNode, ut as DedupeCanonical, v as TransformOptions, vn as JsxNode, vt as OutputNode, wn as ScalarPrimitive, wt as OperationProtocol, x as WalkOptions, xn as TypeNode, xt as HttpOperationNode, y as Visitor, yn as TextNode, yt as GenericOperationNode, zt as ImportNode } from "./types-CC46hQUP.js";
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 };
1
+ import { $ as SchemaDialect, At as IntersectionSchemaNode, Bt as TimeSchemaNode, C as UserFileNode, Ct as FileNode, Dt as DateSchemaNode, Et as ArraySchemaNode, Ft as ScalarSchemaType, Gt as CodeNode, Ht as UrlSchemaNode, It as SchemaNode, Jt as JSDocNode, Kt as ConstNode, Lt as SchemaNodeByType, Mt as ObjectSchemaNode, Nt as PrimitiveSchemaType, Ot as DatetimeSchemaNode, Pt as RefSchemaNode, Qt as NodeKind, Rt as SchemaType, S as DistributiveOmit, St as ExportNode, Tt as SourceNode, Ut as PropertyNode, Vt as UnionSchemaNode, Wt as ArrowFunctionNode, X as ParserOptions, Xt as TextNode, Y as InferSchemaNode, Yt as JsxNode, Z as DispatchRule, Zt as TypeNode, _ as Printer, _t as FunctionParamNode, at as InputMeta, bt as ParameterGroupNode, ct as OutputNode, d as ParentOf, dt as OperationNode, f as Visitor, ft as ResponseNode, gt as FunctionNodeType, ht as ParameterNode, it as Node, jt as NumberSchemaNode, kt as EnumSchemaNode, lt as HttpMethod, mt as ParameterLocation, ot as InputNode, p as VisitorContext, pt as StatusCode, qt as FunctionNode, st as InputStreamNode, t as OperationParamsResolver, tt as DedupePlan, ut as HttpOperationNode, v as PrinterFactoryOptions, vt as FunctionParameterNode, wt as ImportNode, xt as ParamsTypeNode, y as PrinterPartial, yt as FunctionParametersNode, zt as StringSchemaNode } from "./types-BaaNZbSi.js";
2
+ export type { ArraySchemaNode, ArrowFunctionNode, CodeNode, ConstNode, DateSchemaNode, DatetimeSchemaNode, DedupePlan, DispatchRule, DistributiveOmit, EnumSchemaNode, ExportNode, FileNode, FunctionNode, FunctionNodeType, FunctionParamNode, FunctionParameterNode, FunctionParametersNode, HttpMethod, HttpOperationNode, ImportNode, InferSchemaNode, InputMeta, InputNode, InputStreamNode, IntersectionSchemaNode, JSDocNode, JsxNode, Node, NodeKind, NumberSchemaNode, ObjectSchemaNode, OperationNode, OperationParamsResolver, OutputNode, ParameterGroupNode, ParameterLocation, ParameterNode, ParamsTypeNode, ParentOf, ParserOptions, PrimitiveSchemaType, Printer, PrinterFactoryOptions, PrinterPartial, PropertyNode, RefSchemaNode, ResponseNode, ScalarSchemaType, SchemaDialect, SchemaNode, SchemaNodeByType, SchemaType, SourceNode, StatusCode, StringSchemaNode, TextNode, TimeSchemaNode, TypeNode, UnionSchemaNode, UrlSchemaNode, UserFileNode, Visitor, VisitorContext };