@kubb/ast 5.0.0-beta.44 → 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.
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-lc8xMmUs.d.ts → types-BaaNZbSi.d.ts} +4 -19
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- package/src/infer.ts +2 -2
- package/src/nodes/code.ts +0 -6
- package/src/nodes/file.ts +1 -1
- package/src/nodes/http.ts +1 -35
- package/src/nodes/index.ts +4 -10
- package/src/nodes/operation.ts +2 -2
- package/src/nodes/schema.ts +6 -6
- package/src/printer.ts +2 -2
- package/src/types.ts +2 -19
- package/src/utils/ast.ts +1 -1
- package/src/visitor.ts +2 -2
|
@@ -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 '
|
|
2187
|
+
* @default 'bigint'
|
|
2203
2188
|
*/
|
|
2204
2189
|
integerType?: 'number' | 'bigint';
|
|
2205
2190
|
/**
|
|
@@ -3592,5 +3577,5 @@ declare function containsCircularRef(node: SchemaNode | undefined, {
|
|
|
3592
3577
|
excludeName?: string;
|
|
3593
3578
|
}): boolean;
|
|
3594
3579
|
//#endregion
|
|
3595
|
-
export {
|
|
3596
|
-
//# sourceMappingURL=types-
|
|
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 { $
|
|
2
|
-
export type { ArraySchemaNode, ArrowFunctionNode,
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/ast",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.45",
|
|
4
4
|
"description": "Spec-agnostic AST layer for Kubb. Defines the node tree, visitor pattern, factory functions, and type guards used across all code generation plugins.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast",
|
package/src/infer.ts
CHANGED
|
@@ -30,10 +30,10 @@ export type ParserOptions = {
|
|
|
30
30
|
dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date'
|
|
31
31
|
/**
|
|
32
32
|
* How `type: 'integer'` (and `format: 'int64'`) maps to TypeScript.
|
|
33
|
-
* - `'number'` fits most JSON APIs. Loses precision above `Number.MAX_SAFE_INTEGER`.
|
|
34
33
|
* - `'bigint'` is exact for 64-bit IDs, but does not round-trip through JSON.
|
|
34
|
+
* - `'number'` fits most JSON APIs. Loses precision above `Number.MAX_SAFE_INTEGER`.
|
|
35
35
|
*
|
|
36
|
-
* @default '
|
|
36
|
+
* @default 'bigint'
|
|
37
37
|
*/
|
|
38
38
|
integerType?: 'number' | 'bigint'
|
|
39
39
|
/**
|
package/src/nodes/code.ts
CHANGED
|
@@ -95,12 +95,6 @@ export type TypeNode = BaseNode & {
|
|
|
95
95
|
nodes?: Array<CodeNode>
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
* Convenience alias for {@link TypeNode}.
|
|
100
|
-
* @deprecated Use `TypeNode` directly.
|
|
101
|
-
*/
|
|
102
|
-
export type TypeDeclarationNode = TypeNode
|
|
103
|
-
|
|
104
98
|
/**
|
|
105
99
|
* AST node representing a TypeScript `function` declaration.
|
|
106
100
|
*
|
package/src/nodes/file.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { CodeNode } from './code.ts'
|
|
|
4
4
|
/**
|
|
5
5
|
* Supported file extensions.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`
|
|
8
8
|
|
|
9
9
|
type ImportName = string | Array<string | { propertyName: string; name?: string }>
|
|
10
10
|
|
package/src/nodes/http.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* All supported HTTP status code literals as strings, as used in API specs
|
|
3
3
|
* (for example, `"200"` and `"404"`).
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type HttpStatusCode =
|
|
6
6
|
// 1xx Informational
|
|
7
7
|
| '100'
|
|
8
8
|
| '101'
|
|
@@ -83,37 +83,3 @@ export type HttpStatusCode =
|
|
|
83
83
|
* ```
|
|
84
84
|
*/
|
|
85
85
|
export type StatusCode = HttpStatusCode | 'default'
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Supported media type strings used in request and response bodies.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```ts
|
|
92
|
-
* const mediaType: MediaType = 'application/json'
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
export type MediaType =
|
|
96
|
-
// Application
|
|
97
|
-
| 'application/json'
|
|
98
|
-
| 'application/xml'
|
|
99
|
-
| 'application/x-www-form-urlencoded'
|
|
100
|
-
| 'application/octet-stream'
|
|
101
|
-
| 'application/pdf'
|
|
102
|
-
| 'application/zip'
|
|
103
|
-
| 'application/graphql'
|
|
104
|
-
// Multipart
|
|
105
|
-
| 'multipart/form-data'
|
|
106
|
-
// Text
|
|
107
|
-
| 'text/plain'
|
|
108
|
-
| 'text/html'
|
|
109
|
-
| 'text/csv'
|
|
110
|
-
| 'text/xml'
|
|
111
|
-
// Image
|
|
112
|
-
| 'image/png'
|
|
113
|
-
| 'image/jpeg'
|
|
114
|
-
| 'image/gif'
|
|
115
|
-
| 'image/webp'
|
|
116
|
-
| 'image/svg+xml'
|
|
117
|
-
// Audio / Video
|
|
118
|
-
| 'audio/mpeg'
|
|
119
|
-
| 'video/mp4'
|
package/src/nodes/index.ts
CHANGED
|
@@ -10,13 +10,13 @@ import type { ResponseNode } from './response.ts'
|
|
|
10
10
|
import type { InputNode } from './root.ts'
|
|
11
11
|
import type { SchemaNode } from './schema.ts'
|
|
12
12
|
|
|
13
|
-
export type {
|
|
14
|
-
export type { ArrowFunctionNode, BreakNode, CodeNode, ConstNode, FunctionNode, JSDocNode, JsxNode, TextNode,
|
|
13
|
+
export type { NodeKind } from './base.ts'
|
|
14
|
+
export type { ArrowFunctionNode, BreakNode, CodeNode, ConstNode, FunctionNode, JSDocNode, JsxNode, TextNode, TypeNode } from './code.ts'
|
|
15
15
|
export type { ContentNode } from './content.ts'
|
|
16
16
|
export type { ExportNode, FileNode, ImportNode, SourceNode } from './file.ts'
|
|
17
17
|
export type { FunctionNodeType, FunctionParameterNode, FunctionParametersNode, FunctionParamNode, ParameterGroupNode, ParamsTypeNode } from './function.ts'
|
|
18
|
-
export type {
|
|
19
|
-
export type { GenericOperationNode, HttpMethod, HttpOperationNode, OperationNode,
|
|
18
|
+
export type { StatusCode } from './http.ts'
|
|
19
|
+
export type { GenericOperationNode, HttpMethod, HttpOperationNode, OperationNode, RequestBodyNode } from './operation.ts'
|
|
20
20
|
export type { OutputNode } from './output.ts'
|
|
21
21
|
export type { ParameterLocation, ParameterNode } from './parameter.ts'
|
|
22
22
|
export type { PropertyNode } from './property.ts'
|
|
@@ -24,15 +24,10 @@ export type { ResponseNode } from './response.ts'
|
|
|
24
24
|
export type { InputMeta, InputNode, InputStreamNode } from './root.ts'
|
|
25
25
|
export type {
|
|
26
26
|
ArraySchemaNode,
|
|
27
|
-
ComplexSchemaType,
|
|
28
27
|
DateSchemaNode,
|
|
29
28
|
DatetimeSchemaNode,
|
|
30
29
|
EnumSchemaNode,
|
|
31
|
-
EnumValueNode,
|
|
32
|
-
FormatStringSchemaNode,
|
|
33
30
|
IntersectionSchemaNode,
|
|
34
|
-
Ipv4SchemaNode,
|
|
35
|
-
Ipv6SchemaNode,
|
|
36
31
|
NumberSchemaNode,
|
|
37
32
|
ObjectSchemaNode,
|
|
38
33
|
PrimitiveSchemaType,
|
|
@@ -42,7 +37,6 @@ export type {
|
|
|
42
37
|
SchemaNode,
|
|
43
38
|
SchemaNodeByType,
|
|
44
39
|
SchemaType,
|
|
45
|
-
SpecialSchemaType,
|
|
46
40
|
StringSchemaNode,
|
|
47
41
|
TimeSchemaNode,
|
|
48
42
|
UnionSchemaNode,
|
package/src/nodes/operation.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' |
|
|
|
8
8
|
/**
|
|
9
9
|
* Transport an operation belongs to.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
type OperationProtocol = 'http'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* AST node representing an operation request body.
|
|
@@ -53,7 +53,7 @@ export type RequestBodyNode = BaseNode & {
|
|
|
53
53
|
/**
|
|
54
54
|
* Fields shared by every operation, regardless of transport.
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
type OperationNodeBase = BaseNode & {
|
|
57
57
|
/**
|
|
58
58
|
* Node kind.
|
|
59
59
|
*/
|
package/src/nodes/schema.ts
CHANGED
|
@@ -58,12 +58,12 @@ export type PrimitiveSchemaType =
|
|
|
58
58
|
/**
|
|
59
59
|
* Composite schema types.
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
type ComplexSchemaType = 'tuple' | 'union' | 'intersection' | 'enum'
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Schema types that need special handling in generators.
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
type SpecialSchemaType = 'ref' | 'datetime' | 'time' | 'uuid' | 'email' | 'url' | 'ipv4' | 'ipv6' | 'blob'
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* All schema type strings.
|
|
@@ -306,7 +306,7 @@ export type IntersectionSchemaNode = CompositeSchemaNodeBase & {
|
|
|
306
306
|
/**
|
|
307
307
|
* One named enum item.
|
|
308
308
|
*/
|
|
309
|
-
|
|
309
|
+
type EnumValueNode = {
|
|
310
310
|
/**
|
|
311
311
|
* Enum item name.
|
|
312
312
|
*/
|
|
@@ -559,7 +559,7 @@ export type UrlSchemaNode = SchemaNodeBase & {
|
|
|
559
559
|
* const uuidSchema: FormatStringSchemaNode = { kind: 'Schema', type: 'uuid', min: 36, max: 36 }
|
|
560
560
|
* ```
|
|
561
561
|
*/
|
|
562
|
-
|
|
562
|
+
type FormatStringSchemaNode = SchemaNodeBase & {
|
|
563
563
|
/**
|
|
564
564
|
* Schema type discriminator.
|
|
565
565
|
*/
|
|
@@ -582,7 +582,7 @@ export type FormatStringSchemaNode = SchemaNodeBase & {
|
|
|
582
582
|
* const ipv4Schema: Ipv4SchemaNode = { kind: 'Schema', type: 'ipv4' }
|
|
583
583
|
* ```
|
|
584
584
|
*/
|
|
585
|
-
|
|
585
|
+
type Ipv4SchemaNode = SchemaNodeBase & {
|
|
586
586
|
/**
|
|
587
587
|
* Schema type discriminator.
|
|
588
588
|
*/
|
|
@@ -597,7 +597,7 @@ export type Ipv4SchemaNode = SchemaNodeBase & {
|
|
|
597
597
|
* const ipv6Schema: Ipv6SchemaNode = { kind: 'Schema', type: 'ipv6' }
|
|
598
598
|
* ```
|
|
599
599
|
*/
|
|
600
|
-
|
|
600
|
+
type Ipv6SchemaNode = SchemaNodeBase & {
|
|
601
601
|
/**
|
|
602
602
|
* Schema type discriminator.
|
|
603
603
|
*/
|
package/src/printer.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type { SchemaNode, SchemaNodeByType, SchemaType } from './nodes/index.ts'
|
|
|
13
13
|
* }
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
type PrinterHandlerContext<TOutput, TOptions extends object> = {
|
|
17
17
|
/**
|
|
18
18
|
* Recursively transform a nested `SchemaNode` to `TOutput` using the node-level handlers.
|
|
19
19
|
* Use `this.transform` inside `nodes` handlers and inside the `print` override.
|
|
@@ -37,7 +37,7 @@ export type PrinterHandlerContext<TOutput, TOptions extends object> = {
|
|
|
37
37
|
* }
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
type PrinterHandler<TOutput, TOptions extends object, T extends SchemaType = SchemaType> = (
|
|
41
41
|
this: PrinterHandlerContext<TOutput, TOptions>,
|
|
42
42
|
node: SchemaNodeByType[T],
|
|
43
43
|
) => TOutput | null
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type { BuildDedupePlanOptions, DedupeCanonical, DedupePlan } from './dedupe.ts'
|
|
1
|
+
export type { DedupePlan } from './dedupe.ts'
|
|
3
2
|
export type { SchemaDialect } from './dialect.ts'
|
|
4
3
|
export type { DispatchRule } from './dispatch.ts'
|
|
5
4
|
export type { DistributiveOmit } from './factory.ts'
|
|
@@ -7,44 +6,32 @@ export type { InferSchemaNode, ParserOptions } from './infer.ts'
|
|
|
7
6
|
export type {
|
|
8
7
|
ArraySchemaNode,
|
|
9
8
|
ArrowFunctionNode,
|
|
10
|
-
BaseNode,
|
|
11
|
-
BreakNode,
|
|
12
9
|
CodeNode,
|
|
13
|
-
ComplexSchemaType,
|
|
14
10
|
ConstNode,
|
|
15
11
|
DateSchemaNode,
|
|
16
12
|
DatetimeSchemaNode,
|
|
17
13
|
EnumSchemaNode,
|
|
18
|
-
EnumValueNode,
|
|
19
14
|
ExportNode,
|
|
20
15
|
FileNode,
|
|
21
|
-
FormatStringSchemaNode,
|
|
22
16
|
FunctionNode,
|
|
23
17
|
FunctionNodeType,
|
|
24
18
|
FunctionParameterNode,
|
|
25
19
|
FunctionParametersNode,
|
|
26
20
|
FunctionParamNode,
|
|
27
|
-
GenericOperationNode,
|
|
28
21
|
HttpMethod,
|
|
29
22
|
HttpOperationNode,
|
|
30
|
-
HttpStatusCode,
|
|
31
23
|
ImportNode,
|
|
32
24
|
InputMeta,
|
|
33
25
|
InputNode,
|
|
34
26
|
InputStreamNode,
|
|
35
27
|
IntersectionSchemaNode,
|
|
36
|
-
Ipv4SchemaNode,
|
|
37
|
-
Ipv6SchemaNode,
|
|
38
28
|
JSDocNode,
|
|
39
29
|
JsxNode,
|
|
40
|
-
MediaType,
|
|
41
30
|
Node,
|
|
42
31
|
NodeKind,
|
|
43
32
|
NumberSchemaNode,
|
|
44
33
|
ObjectSchemaNode,
|
|
45
34
|
OperationNode,
|
|
46
|
-
OperationNodeBase,
|
|
47
|
-
OperationProtocol,
|
|
48
35
|
OutputNode,
|
|
49
36
|
ParameterGroupNode,
|
|
50
37
|
ParameterLocation,
|
|
@@ -54,24 +41,20 @@ export type {
|
|
|
54
41
|
PropertyNode,
|
|
55
42
|
RefSchemaNode,
|
|
56
43
|
ResponseNode,
|
|
57
|
-
ScalarSchemaNode,
|
|
58
44
|
ScalarSchemaType,
|
|
59
45
|
SchemaNode,
|
|
60
46
|
SchemaNodeByType,
|
|
61
47
|
SchemaType,
|
|
62
48
|
SourceNode,
|
|
63
|
-
SpecialSchemaType,
|
|
64
49
|
StatusCode,
|
|
65
50
|
StringSchemaNode,
|
|
66
51
|
TextNode,
|
|
67
52
|
TimeSchemaNode,
|
|
68
|
-
TypeDeclarationNode,
|
|
69
53
|
TypeNode,
|
|
70
54
|
UnionSchemaNode,
|
|
71
55
|
UrlSchemaNode,
|
|
72
56
|
} from './nodes/index.ts'
|
|
73
|
-
export type {
|
|
57
|
+
export type { ParentOf, Visitor, VisitorContext } from './visitor.ts'
|
|
74
58
|
export type { Printer, PrinterFactoryOptions, PrinterPartial } from './printer.ts'
|
|
75
|
-
export type { ScalarPrimitive } from './constants.ts'
|
|
76
59
|
export type { OperationParamsResolver } from './utils/ast.ts'
|
|
77
60
|
export type { UserFileNode } from './factory.ts'
|
package/src/utils/ast.ts
CHANGED
|
@@ -118,7 +118,7 @@ export function createDiscriminantNode({ propertyName, value }: { propertyName:
|
|
|
118
118
|
/**
|
|
119
119
|
* Named type for a group of parameters (query or header) emitted as a single typed parameter.
|
|
120
120
|
*/
|
|
121
|
-
|
|
121
|
+
type ParamGroupType = {
|
|
122
122
|
/**
|
|
123
123
|
* TypeNode for the group type.
|
|
124
124
|
*/
|
package/src/visitor.ts
CHANGED
|
@@ -182,7 +182,7 @@ type MaybePromise<T> = T | Promise<T>
|
|
|
182
182
|
* }
|
|
183
183
|
* ```
|
|
184
184
|
*/
|
|
185
|
-
|
|
185
|
+
type AsyncVisitor = {
|
|
186
186
|
input?(node: InputNode, context: VisitorContext<InputNode>): MaybePromise<undefined | null | InputNode>
|
|
187
187
|
output?(node: OutputNode, context: VisitorContext<OutputNode>): MaybePromise<undefined | null | OutputNode>
|
|
188
188
|
operation?(node: OperationNode, context: VisitorContext<OperationNode>): MaybePromise<undefined | null | OperationNode>
|
|
@@ -204,7 +204,7 @@ export type AsyncVisitor = {
|
|
|
204
204
|
* }
|
|
205
205
|
* ```
|
|
206
206
|
*/
|
|
207
|
-
|
|
207
|
+
type CollectVisitor<T> = {
|
|
208
208
|
input?(node: InputNode, context: VisitorContext<InputNode>): T | null | undefined
|
|
209
209
|
output?(node: OutputNode, context: VisitorContext<OutputNode>): T | null | undefined
|
|
210
210
|
operation?(node: OperationNode, context: VisitorContext<OperationNode>): T | null | undefined
|