@kubb/ast 5.0.0-beta.61 → 5.0.0-beta.63
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/{defineMacro-BLIR6k-j.d.ts → defineMacro-BATi7xoC.d.ts} +11 -20
- package/dist/{defineMacro-Bv9R_9a2.cjs → defineMacro-CEZHaCXE.cjs} +13 -21
- package/dist/defineMacro-CEZHaCXE.cjs.map +1 -0
- package/dist/{defineMacro-BTXvS8nI.js → defineMacro-Shz8f6SG.js} +12 -19
- package/dist/defineMacro-Shz8f6SG.js.map +1 -0
- package/dist/factory.cjs +88 -28
- package/dist/factory.cjs.map +1 -0
- package/dist/factory.d.ts +6 -41
- package/dist/factory.js +58 -3
- package/dist/factory.js.map +1 -0
- package/dist/{index-BzjwdK2M.d.ts → index-B9cc8MBS.d.ts} +164 -194
- package/dist/index.cjs +144 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +43 -37
- package/dist/index.js +109 -235
- package/dist/index.js.map +1 -1
- package/dist/macros.cjs +41 -28
- package/dist/macros.cjs.map +1 -1
- package/dist/macros.d.ts +14 -12
- package/dist/macros.js +34 -21
- package/dist/macros.js.map +1 -1
- package/dist/{operationParams-BZ07xDm0.d.ts → operationParams-k5CKwSWZ.d.ts} +9 -2
- package/dist/{visitor-DJ6ZEJvq.js → refs-BjNDuCBD.js} +116 -159
- package/dist/refs-BjNDuCBD.js.map +1 -0
- package/dist/{visitor-DpKZ9Tk0.cjs → refs-u5SDdyV7.cjs} +140 -195
- package/dist/refs-u5SDdyV7.cjs.map +1 -0
- package/dist/{response-hnSw2NKE.cjs → schema-BkvrrOAr.cjs} +496 -231
- package/dist/schema-BkvrrOAr.cjs.map +1 -0
- package/dist/{response-KUdWiDWw.js → schema-Cbnxmz4b.js} +472 -220
- package/dist/schema-Cbnxmz4b.js.map +1 -0
- package/dist/{types-DyDzizSf.d.ts → types-BB_xgRJ3.d.ts} +49 -123
- package/dist/types.d.ts +5 -6
- package/dist/{utils-BLJwyza-.cjs → utils-CEepwqmb.cjs} +76 -69
- package/dist/utils-CEepwqmb.cjs.map +1 -0
- package/dist/{utils-CF_-Pn_c.js → utils-DaXkewb1.js} +58 -51
- package/dist/utils-DaXkewb1.js.map +1 -0
- package/dist/utils.cjs +11 -11
- package/dist/utils.d.ts +53 -30
- package/dist/utils.js +3 -3
- package/package.json +1 -1
- package/src/constants.ts +3 -36
- package/src/defineMacro.ts +20 -13
- package/src/{node.ts → defineNode.ts} +12 -38
- package/src/{printer.ts → definePrinter.ts} +5 -3
- package/src/dialect.ts +52 -19
- package/src/factory.ts +7 -94
- package/src/index.ts +7 -9
- package/src/infer.ts +1 -1
- package/src/macros/macroDiscriminatorEnum.ts +7 -1
- package/src/macros/macroEnumName.ts +10 -2
- package/src/macros/macroSimplifyUnion.ts +29 -19
- package/src/nodes/code.ts +40 -80
- package/src/nodes/content.ts +2 -7
- package/src/nodes/file.ts +107 -18
- package/src/nodes/function.ts +46 -46
- package/src/nodes/index.ts +2 -3
- package/src/nodes/input.ts +13 -9
- package/src/nodes/operation.ts +8 -5
- package/src/nodes/output.ts +1 -1
- package/src/nodes/parameter.ts +5 -5
- package/src/nodes/property.ts +5 -5
- package/src/nodes/requestBody.ts +6 -13
- package/src/nodes/response.ts +93 -8
- package/src/nodes/schema.ts +5 -5
- package/src/optionality.ts +15 -0
- package/src/registry.ts +1 -1
- package/src/types.ts +4 -6
- package/src/utils/codegen.ts +6 -7
- package/src/utils/extractStringsFromNodes.ts +1 -0
- package/src/utils/fileMerge.ts +7 -8
- package/src/utils/operationParams.ts +9 -9
- package/src/utils/refs.ts +14 -18
- package/src/utils/schemaGraph.ts +41 -33
- package/src/utils/schemaMerge.ts +2 -2
- package/src/visitor.ts +3 -14
- package/dist/defineMacro-BTXvS8nI.js.map +0 -1
- package/dist/defineMacro-Bv9R_9a2.cjs.map +0 -1
- package/dist/extractStringsFromNodes-Cja-xxx5.js +0 -29
- package/dist/extractStringsFromNodes-Cja-xxx5.js.map +0 -1
- package/dist/extractStringsFromNodes-DKgDjFO0.cjs +0 -34
- package/dist/extractStringsFromNodes-DKgDjFO0.cjs.map +0 -1
- package/dist/extractStringsFromNodes-p4mX1TQD.d.ts +0 -14
- package/dist/factory-CZNOGI-N.js +0 -283
- package/dist/factory-CZNOGI-N.js.map +0 -1
- package/dist/factory-DG1CVkEb.cjs +0 -300
- package/dist/factory-DG1CVkEb.cjs.map +0 -1
- package/dist/response-KUdWiDWw.js.map +0 -1
- package/dist/response-hnSw2NKE.cjs.map +0 -1
- package/dist/utils-BLJwyza-.cjs.map +0 -1
- package/dist/utils-CF_-Pn_c.js.map +0 -1
- package/dist/visitor-DJ6ZEJvq.js.map +0 -1
- package/dist/visitor-DpKZ9Tk0.cjs.map +0 -1
- package/src/dedupe.ts +0 -239
- package/src/mocks.ts +0 -56
- package/src/nodes/http.ts +0 -85
|
@@ -25,12 +25,16 @@ type BaseNode = {
|
|
|
25
25
|
kind: NodeKind;
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
|
28
|
-
//#region src/
|
|
28
|
+
//#region src/defineNode.d.ts
|
|
29
29
|
/**
|
|
30
|
-
* Visitor callback names, one per traversable node kind
|
|
31
|
-
* keys of `Visitor` in `visitor.ts`.
|
|
30
|
+
* Visitor callback names, one per traversable node kind, in traversal order.
|
|
31
|
+
* Kept in sync with the keys of `Visitor` in `visitor.ts`.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
declare const visitorKeys: readonly ["input", "output", "operation", "schema", "property", "parameter", "response"];
|
|
34
|
+
/**
|
|
35
|
+
* One of the {@link visitorKeys} callback names.
|
|
36
|
+
*/
|
|
37
|
+
type VisitorKey = (typeof visitorKeys)[number];
|
|
34
38
|
/**
|
|
35
39
|
* Distributive `Omit` that preserves each member of a union.
|
|
36
40
|
*
|
|
@@ -43,16 +47,6 @@ type VisitorKey = 'input' | 'output' | 'operation' | 'schema' | 'property' | 'pa
|
|
|
43
47
|
* ```
|
|
44
48
|
*/
|
|
45
49
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
46
|
-
/**
|
|
47
|
-
* Updates a schema's `optional` and `nullish` flags from a parent's `required`
|
|
48
|
-
* value and the schema's own `nullable`. Mirrors how OpenAPI parameters and
|
|
49
|
-
* object properties combine "required" and "nullable" into a single AST.
|
|
50
|
-
*
|
|
51
|
-
* - Non-required + non-nullable → `optional: true`.
|
|
52
|
-
* - Non-required + nullable → `nullish: true`.
|
|
53
|
-
* - Required → both flags cleared.
|
|
54
|
-
*/
|
|
55
|
-
declare function syncOptionality(schema: SchemaNode, required: boolean): SchemaNode;
|
|
56
50
|
/**
|
|
57
51
|
* The single definition derived from one {@link defineNode} call: the node's
|
|
58
52
|
* `create` builder, its `is` guard, and the traversal metadata the registry
|
|
@@ -79,11 +73,6 @@ type NodeDef<TNode extends BaseNode = BaseNode, TInput = never> = {
|
|
|
79
73
|
* Visitor callback name. Feeds `VISITOR_KEY_BY_KIND`.
|
|
80
74
|
*/
|
|
81
75
|
visitorKey?: VisitorKey;
|
|
82
|
-
/**
|
|
83
|
-
* When `true`, `create` is rerun after children are rebuilt so computed fields
|
|
84
|
-
* stay in sync. Feeds `nodeRebuilders`.
|
|
85
|
-
*/
|
|
86
|
-
rebuild?: boolean;
|
|
87
76
|
};
|
|
88
77
|
type DefineNodeConfig<TNode extends BaseNode, TInput, TBuilt extends object> = {
|
|
89
78
|
kind: TNode['kind'];
|
|
@@ -91,31 +80,25 @@ type DefineNodeConfig<TNode extends BaseNode, TInput, TBuilt extends object> = {
|
|
|
91
80
|
build?: (input: TInput) => TBuilt;
|
|
92
81
|
children?: ReadonlyArray<string>;
|
|
93
82
|
visitorKey?: VisitorKey;
|
|
94
|
-
rebuild?: boolean;
|
|
95
83
|
};
|
|
96
84
|
/**
|
|
97
85
|
* Defines a node once and derives its `create` builder, `is` guard, and traversal
|
|
98
86
|
* metadata. `create` merges `defaults`, the `build` hook (or the raw input), and the
|
|
99
87
|
* `kind`, so node construction lives in one place without scattered `as` casts.
|
|
100
88
|
*
|
|
101
|
-
* Set `rebuild: true` when the `build` hook derives fields from children. After a
|
|
102
|
-
* transform rewrites those children, the registry reruns `create` so the derived
|
|
103
|
-
* fields stay correct.
|
|
104
|
-
*
|
|
105
89
|
* @example Simple node
|
|
106
90
|
* ```ts
|
|
107
91
|
* const importDef = defineNode<ImportNode>({ kind: 'Import' })
|
|
108
92
|
* const createImport = importDef.create
|
|
109
93
|
* ```
|
|
110
94
|
*
|
|
111
|
-
* @example Node with a build hook
|
|
95
|
+
* @example Node with a build hook
|
|
112
96
|
* ```ts
|
|
113
97
|
* const propertyDef = defineNode<PropertyNode, UserPropertyNode>({
|
|
114
98
|
* kind: 'Property',
|
|
115
99
|
* build: (props) => ({ ...props, required: props.required ?? false }),
|
|
116
100
|
* children: ['schema'],
|
|
117
101
|
* visitorKey: 'property',
|
|
118
|
-
* rebuild: true,
|
|
119
102
|
* })
|
|
120
103
|
* ```
|
|
121
104
|
*/
|
|
@@ -234,7 +217,10 @@ type FunctionNode = BaseNode & {
|
|
|
234
217
|
*/
|
|
235
218
|
default?: boolean | null;
|
|
236
219
|
/**
|
|
237
|
-
* Function parameter list
|
|
220
|
+
* Function parameter list as a pre-rendered string, written verbatim between the parentheses.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* `'id: string, config: Config = {}'`
|
|
238
224
|
*/
|
|
239
225
|
params?: string | null;
|
|
240
226
|
/**
|
|
@@ -281,55 +267,12 @@ type FunctionNode = BaseNode & {
|
|
|
281
267
|
* // export const getPet = () => ...
|
|
282
268
|
* ```
|
|
283
269
|
*/
|
|
284
|
-
type ArrowFunctionNode =
|
|
270
|
+
type ArrowFunctionNode = Omit<FunctionNode, 'kind'> & {
|
|
285
271
|
kind: 'ArrowFunction';
|
|
286
|
-
/**
|
|
287
|
-
* Name of the arrow function (used as the `const` variable name).
|
|
288
|
-
*/
|
|
289
|
-
name: string;
|
|
290
|
-
/**
|
|
291
|
-
* Whether the function is a default export.
|
|
292
|
-
*/
|
|
293
|
-
default?: boolean | null;
|
|
294
|
-
/**
|
|
295
|
-
* Function parameter list rendered as a string (e.g. from `FunctionParams.toConstructor()`).
|
|
296
|
-
*/
|
|
297
|
-
params?: string | null;
|
|
298
|
-
/**
|
|
299
|
-
* Whether the arrow function should be exported.
|
|
300
|
-
*/
|
|
301
|
-
export?: boolean | null;
|
|
302
|
-
/**
|
|
303
|
-
* Whether the arrow function is async. When `true`, the return type is wrapped in `Promise<>`.
|
|
304
|
-
*/
|
|
305
|
-
async?: boolean | null;
|
|
306
|
-
/**
|
|
307
|
-
* TypeScript generic type parameters.
|
|
308
|
-
*
|
|
309
|
-
* @example Constrained generics
|
|
310
|
-
* `['T', 'U extends string']`
|
|
311
|
-
*/
|
|
312
|
-
generics?: string | Array<string> | null;
|
|
313
|
-
/**
|
|
314
|
-
* Return type annotation.
|
|
315
|
-
*
|
|
316
|
-
* @example Type reference
|
|
317
|
-
* `'Pet'`
|
|
318
|
-
*/
|
|
319
|
-
returnType?: string | null;
|
|
320
|
-
/**
|
|
321
|
-
* JSDoc documentation metadata.
|
|
322
|
-
*/
|
|
323
|
-
JSDoc?: JSDocNode | null;
|
|
324
272
|
/**
|
|
325
273
|
* Render the arrow function body as a single-line expression.
|
|
326
274
|
*/
|
|
327
275
|
singleLine?: boolean | null;
|
|
328
|
-
/**
|
|
329
|
-
* Child nodes representing the function body (children of the `Function.Arrow` component).
|
|
330
|
-
* Each entry is a {@link CodeNode}. Use {@link TextNode} for raw string content.
|
|
331
|
-
*/
|
|
332
|
-
nodes?: Array<CodeNode>;
|
|
333
276
|
};
|
|
334
277
|
/**
|
|
335
278
|
* AST node representing a raw text/string fragment in the source output.
|
|
@@ -351,16 +294,16 @@ type TextNode = BaseNode & {
|
|
|
351
294
|
value: string;
|
|
352
295
|
};
|
|
353
296
|
/**
|
|
354
|
-
* AST node representing a line
|
|
297
|
+
* AST node representing a blank line in the source output.
|
|
355
298
|
*
|
|
356
|
-
* Corresponds to `<br/>` in JSX components.
|
|
357
|
-
*
|
|
299
|
+
* Corresponds to `<br/>` in JSX components. `printNodes` turns a `Break` between two
|
|
300
|
+
* statements into one blank line. Consecutive breaks, and breaks at the start or end of
|
|
301
|
+
* the list, are folded away, so a `Break` never produces more than one blank line.
|
|
358
302
|
*
|
|
359
303
|
* @example
|
|
360
304
|
* ```ts
|
|
361
305
|
* createBreak()
|
|
362
306
|
* // { kind: 'Break' }
|
|
363
|
-
* // prints as '' → blank line when surrounded by other nodes
|
|
364
307
|
* ```
|
|
365
308
|
*/
|
|
366
309
|
type BreakNode = BaseNode & {
|
|
@@ -396,6 +339,30 @@ type CodeNode = ConstNode | TypeNode | FunctionNode | ArrowFunctionNode | TextNo
|
|
|
396
339
|
* Definition for the {@link ConstNode}.
|
|
397
340
|
*/
|
|
398
341
|
declare const constDef: NodeDef<ConstNode, Omit<ConstNode, "kind">>;
|
|
342
|
+
/**
|
|
343
|
+
* Definition for the {@link TypeNode}.
|
|
344
|
+
*/
|
|
345
|
+
declare const typeDef: NodeDef<TypeNode, Omit<TypeNode, "kind">>;
|
|
346
|
+
/**
|
|
347
|
+
* Definition for the {@link FunctionNode}.
|
|
348
|
+
*/
|
|
349
|
+
declare const functionDef: NodeDef<FunctionNode, Omit<FunctionNode, "kind">>;
|
|
350
|
+
/**
|
|
351
|
+
* Definition for the {@link ArrowFunctionNode}.
|
|
352
|
+
*/
|
|
353
|
+
declare const arrowFunctionDef: NodeDef<ArrowFunctionNode, Omit<ArrowFunctionNode, "kind">>;
|
|
354
|
+
/**
|
|
355
|
+
* Definition for the {@link TextNode}.
|
|
356
|
+
*/
|
|
357
|
+
declare const textDef: NodeDef<TextNode, string>;
|
|
358
|
+
/**
|
|
359
|
+
* Definition for the {@link BreakNode}.
|
|
360
|
+
*/
|
|
361
|
+
declare const breakDef: NodeDef<BreakNode, void>;
|
|
362
|
+
/**
|
|
363
|
+
* Definition for the {@link JsxNode}.
|
|
364
|
+
*/
|
|
365
|
+
declare const jsxDef: NodeDef<JsxNode, string>;
|
|
399
366
|
/**
|
|
400
367
|
* Creates a `ConstNode` representing a TypeScript `const` declaration.
|
|
401
368
|
*
|
|
@@ -406,10 +373,6 @@ declare const constDef: NodeDef<ConstNode, Omit<ConstNode, "kind">>;
|
|
|
406
373
|
* ```
|
|
407
374
|
*/
|
|
408
375
|
declare const createConst: (input: Omit<ConstNode, "kind">) => ConstNode;
|
|
409
|
-
/**
|
|
410
|
-
* Definition for the {@link TypeNode}.
|
|
411
|
-
*/
|
|
412
|
-
declare const typeDef: NodeDef<TypeNode, Omit<TypeNode, "kind">>;
|
|
413
376
|
/**
|
|
414
377
|
* Creates a `TypeNode` representing a TypeScript `type` alias declaration.
|
|
415
378
|
*
|
|
@@ -420,10 +383,6 @@ declare const typeDef: NodeDef<TypeNode, Omit<TypeNode, "kind">>;
|
|
|
420
383
|
* ```
|
|
421
384
|
*/
|
|
422
385
|
declare const createType: (input: Omit<TypeNode, "kind">) => TypeNode;
|
|
423
|
-
/**
|
|
424
|
-
* Definition for the {@link FunctionNode}.
|
|
425
|
-
*/
|
|
426
|
-
declare const functionDef: NodeDef<FunctionNode, Omit<FunctionNode, "kind">>;
|
|
427
386
|
/**
|
|
428
387
|
* Creates a `FunctionNode` representing a TypeScript `function` declaration.
|
|
429
388
|
*
|
|
@@ -434,10 +393,6 @@ declare const functionDef: NodeDef<FunctionNode, Omit<FunctionNode, "kind">>;
|
|
|
434
393
|
* ```
|
|
435
394
|
*/
|
|
436
395
|
declare const createFunction: (input: Omit<FunctionNode, "kind">) => FunctionNode;
|
|
437
|
-
/**
|
|
438
|
-
* Definition for the {@link ArrowFunctionNode}.
|
|
439
|
-
*/
|
|
440
|
-
declare const arrowFunctionDef: NodeDef<ArrowFunctionNode, Omit<ArrowFunctionNode, "kind">>;
|
|
441
396
|
/**
|
|
442
397
|
* Creates an `ArrowFunctionNode` representing a TypeScript arrow function.
|
|
443
398
|
*
|
|
@@ -448,10 +403,6 @@ declare const arrowFunctionDef: NodeDef<ArrowFunctionNode, Omit<ArrowFunctionNod
|
|
|
448
403
|
* ```
|
|
449
404
|
*/
|
|
450
405
|
declare const createArrowFunction: (input: Omit<ArrowFunctionNode, "kind">) => ArrowFunctionNode;
|
|
451
|
-
/**
|
|
452
|
-
* Definition for the {@link TextNode}.
|
|
453
|
-
*/
|
|
454
|
-
declare const textDef: NodeDef<TextNode, string>;
|
|
455
406
|
/**
|
|
456
407
|
* Creates a {@link TextNode} representing a raw string fragment in the source output.
|
|
457
408
|
*
|
|
@@ -462,10 +413,6 @@ declare const textDef: NodeDef<TextNode, string>;
|
|
|
462
413
|
* ```
|
|
463
414
|
*/
|
|
464
415
|
declare const createText: (input: string) => TextNode;
|
|
465
|
-
/**
|
|
466
|
-
* Definition for the {@link BreakNode}.
|
|
467
|
-
*/
|
|
468
|
-
declare const breakDef: NodeDef<BreakNode, void>;
|
|
469
416
|
/**
|
|
470
417
|
* Creates a {@link BreakNode} representing a line break in the source output.
|
|
471
418
|
*
|
|
@@ -476,10 +423,6 @@ declare const breakDef: NodeDef<BreakNode, void>;
|
|
|
476
423
|
* ```
|
|
477
424
|
*/
|
|
478
425
|
declare function createBreak(): BreakNode;
|
|
479
|
-
/**
|
|
480
|
-
* Definition for the {@link JsxNode}.
|
|
481
|
-
*/
|
|
482
|
-
declare const jsxDef: NodeDef<JsxNode, string>;
|
|
483
426
|
/**
|
|
484
427
|
* Creates a {@link JsxNode} representing a raw JSX fragment in the source output.
|
|
485
428
|
*
|
|
@@ -493,7 +436,7 @@ declare const createJsx: (input: string) => JsxNode;
|
|
|
493
436
|
//#endregion
|
|
494
437
|
//#region src/infer.d.ts
|
|
495
438
|
/**
|
|
496
|
-
*
|
|
439
|
+
* Options that control how the adapter parser maps OpenAPI schemas to AST nodes.
|
|
497
440
|
*/
|
|
498
441
|
type ParserOptions = {
|
|
499
442
|
/**
|
|
@@ -673,8 +616,8 @@ type PropertyNode = BaseNode & {
|
|
|
673
616
|
*/
|
|
674
617
|
type UserPropertyNode = Pick<PropertyNode, 'name' | 'schema'> & Partial<Omit<PropertyNode, 'kind' | 'name' | 'schema'>>;
|
|
675
618
|
/**
|
|
676
|
-
* Definition for the {@link PropertyNode}. `required` defaults to `false
|
|
677
|
-
*
|
|
619
|
+
* Definition for the {@link PropertyNode}. `required` defaults to `false`, and the schema's
|
|
620
|
+
* `optional`/`nullish` flags are derived from it through {@link optionality}.
|
|
678
621
|
*/
|
|
679
622
|
declare const propertyDef: NodeDef<PropertyNode, UserPropertyNode>;
|
|
680
623
|
/**
|
|
@@ -773,7 +716,7 @@ type SchemaNodeBase = BaseNode & {
|
|
|
773
716
|
/**
|
|
774
717
|
* Schema name for named definitions (for example, `"Pet"`).
|
|
775
718
|
* Inline schemas omit this field.
|
|
776
|
-
* `null` means
|
|
719
|
+
* `null` means Kubb has processed this and determined there is no applicable name.
|
|
777
720
|
* `undefined` means the name has not been set yet.
|
|
778
721
|
*/
|
|
779
722
|
name?: string | null;
|
|
@@ -855,7 +798,7 @@ type ObjectSchemaNode = SchemaNodeBase & {
|
|
|
855
798
|
/**
|
|
856
799
|
* Additional object properties behavior:
|
|
857
800
|
* - `true`: allow any value
|
|
858
|
-
* - `false`: reject unknown properties
|
|
801
|
+
* - `false`: reject unknown properties
|
|
859
802
|
* - `SchemaNode`: allow values that match that schema
|
|
860
803
|
* - `undefined`: no additional properties constraint (open object)
|
|
861
804
|
*/
|
|
@@ -1355,18 +1298,14 @@ type ContentNode = BaseNode & {
|
|
|
1355
1298
|
*/
|
|
1356
1299
|
keysToOmit?: Array<string> | null;
|
|
1357
1300
|
};
|
|
1358
|
-
/**
|
|
1359
|
-
* Loosely-typed content entry accepted by the builders, normalized into a {@link ContentNode}.
|
|
1360
|
-
*/
|
|
1361
|
-
type UserContent = Omit<ContentNode, 'kind'>;
|
|
1362
1301
|
/**
|
|
1363
1302
|
* Definition for the {@link ContentNode}.
|
|
1364
1303
|
*/
|
|
1365
|
-
declare const contentDef: NodeDef<ContentNode,
|
|
1304
|
+
declare const contentDef: NodeDef<ContentNode, Omit<ContentNode, "kind">>;
|
|
1366
1305
|
/**
|
|
1367
1306
|
* Creates a `ContentNode` for a single request-body or response content type.
|
|
1368
1307
|
*/
|
|
1369
|
-
declare const createContent: (input:
|
|
1308
|
+
declare const createContent: (input: Omit<ContentNode, "kind">) => ContentNode;
|
|
1370
1309
|
//#endregion
|
|
1371
1310
|
//#region src/nodes/file.d.ts
|
|
1372
1311
|
/**
|
|
@@ -1557,13 +1496,14 @@ type FileNode<TMeta extends object = object> = BaseNode & {
|
|
|
1557
1496
|
id: string;
|
|
1558
1497
|
/**
|
|
1559
1498
|
* File name without extension, derived from `baseName`.
|
|
1560
|
-
*
|
|
1499
|
+
*
|
|
1500
|
+
* @see https://nodejs.org/api/path.html#pathformatpathobject
|
|
1561
1501
|
*/
|
|
1562
1502
|
name: string;
|
|
1563
1503
|
/**
|
|
1564
|
-
* File base name, including extension
|
|
1565
|
-
*
|
|
1566
|
-
* @
|
|
1504
|
+
* File base name, including extension, shaped like `${name}${extname}`.
|
|
1505
|
+
*
|
|
1506
|
+
* @see https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
1567
1507
|
*/
|
|
1568
1508
|
baseName: `${string}.${string}`;
|
|
1569
1509
|
/**
|
|
@@ -1605,6 +1545,19 @@ type FileNode<TMeta extends object = object> = BaseNode & {
|
|
|
1605
1545
|
* Definition for the {@link ImportNode}.
|
|
1606
1546
|
*/
|
|
1607
1547
|
declare const importDef: NodeDef<ImportNode, Omit<ImportNode, "kind">>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Definition for the {@link ExportNode}.
|
|
1550
|
+
*/
|
|
1551
|
+
declare const exportDef: NodeDef<ExportNode, Omit<ExportNode, "kind">>;
|
|
1552
|
+
/**
|
|
1553
|
+
* Definition for the {@link SourceNode}.
|
|
1554
|
+
*/
|
|
1555
|
+
declare const sourceDef: NodeDef<SourceNode, Omit<SourceNode, "kind">>;
|
|
1556
|
+
/**
|
|
1557
|
+
* Definition for the {@link FileNode}. The fully resolved builder lives in
|
|
1558
|
+
* `createFile`, so this definition only supplies the guard.
|
|
1559
|
+
*/
|
|
1560
|
+
declare const fileDef: NodeDef<FileNode<object>, Omit<FileNode<object>, "kind">>;
|
|
1608
1561
|
/**
|
|
1609
1562
|
* Creates an `ImportNode` representing a language-agnostic import/dependency declaration.
|
|
1610
1563
|
*
|
|
@@ -1615,10 +1568,6 @@ declare const importDef: NodeDef<ImportNode, Omit<ImportNode, "kind">>;
|
|
|
1615
1568
|
* ```
|
|
1616
1569
|
*/
|
|
1617
1570
|
declare const createImport: (input: Omit<ImportNode, "kind">) => ImportNode;
|
|
1618
|
-
/**
|
|
1619
|
-
* Definition for the {@link ExportNode}.
|
|
1620
|
-
*/
|
|
1621
|
-
declare const exportDef: NodeDef<ExportNode, Omit<ExportNode, "kind">>;
|
|
1622
1571
|
/**
|
|
1623
1572
|
* Creates an `ExportNode` representing a language-agnostic export/public API declaration.
|
|
1624
1573
|
*
|
|
@@ -1629,10 +1578,6 @@ declare const exportDef: NodeDef<ExportNode, Omit<ExportNode, "kind">>;
|
|
|
1629
1578
|
* ```
|
|
1630
1579
|
*/
|
|
1631
1580
|
declare const createExport: (input: Omit<ExportNode, "kind">) => ExportNode;
|
|
1632
|
-
/**
|
|
1633
|
-
* Definition for the {@link SourceNode}.
|
|
1634
|
-
*/
|
|
1635
|
-
declare const sourceDef: NodeDef<SourceNode, Omit<SourceNode, "kind">>;
|
|
1636
1581
|
/**
|
|
1637
1582
|
* Creates a `SourceNode` representing a fragment of source code within a file.
|
|
1638
1583
|
*
|
|
@@ -1643,10 +1588,40 @@ declare const sourceDef: NodeDef<SourceNode, Omit<SourceNode, "kind">>;
|
|
|
1643
1588
|
*/
|
|
1644
1589
|
declare const createSource: (input: Omit<SourceNode, "kind">) => SourceNode;
|
|
1645
1590
|
/**
|
|
1646
|
-
*
|
|
1647
|
-
* `
|
|
1591
|
+
* Input descriptor for {@link createFile}, before `id`, `name`, and `extname` are computed
|
|
1592
|
+
* and `imports`/`exports`/`sources` are deduplicated.
|
|
1648
1593
|
*/
|
|
1649
|
-
|
|
1594
|
+
type UserFileNode<TMeta extends object = object> = Omit<FileNode<TMeta>, 'kind' | 'id' | 'name' | 'extname' | 'imports' | 'exports' | 'sources'> & Pick<Partial<FileNode<TMeta>>, 'imports' | 'exports' | 'sources'>;
|
|
1595
|
+
/**
|
|
1596
|
+
* Creates a fully resolved `FileNode` from a file input descriptor.
|
|
1597
|
+
*
|
|
1598
|
+
* Computes:
|
|
1599
|
+
* - `id` SHA256 hash of the file path
|
|
1600
|
+
* - `name` `baseName` without extension
|
|
1601
|
+
* - `extname` extension extracted from `baseName`
|
|
1602
|
+
*
|
|
1603
|
+
* Deduplicates:
|
|
1604
|
+
* - `sources` via `combineSources`
|
|
1605
|
+
* - `exports` via `combineExports`
|
|
1606
|
+
* - `imports` via `combineImports` (also filters unused imports)
|
|
1607
|
+
*
|
|
1608
|
+
* @throws {Error} when `baseName` has no extension.
|
|
1609
|
+
*
|
|
1610
|
+
* @example
|
|
1611
|
+
* ```ts
|
|
1612
|
+
* const file = createFile({
|
|
1613
|
+
* baseName: 'petStore.ts',
|
|
1614
|
+
* path: 'src/models/petStore.ts',
|
|
1615
|
+
* sources: [createSource({ name: 'Pet', nodes: [createText('export type Pet = { id: number }')] })],
|
|
1616
|
+
* imports: [createImport({ name: ['z'], path: 'zod' })],
|
|
1617
|
+
* exports: [createExport({ name: ['Pet'], path: './petStore' })],
|
|
1618
|
+
* })
|
|
1619
|
+
* // file.id = SHA256 hash of 'src/models/petStore.ts'
|
|
1620
|
+
* // file.name = 'petStore'
|
|
1621
|
+
* // file.extname = '.ts'
|
|
1622
|
+
* ```
|
|
1623
|
+
*/
|
|
1624
|
+
declare function createFile<TMeta extends object = object>(input: UserFileNode<TMeta>): FileNode<TMeta>;
|
|
1650
1625
|
//#endregion
|
|
1651
1626
|
//#region src/nodes/function.d.ts
|
|
1652
1627
|
/**
|
|
@@ -1689,11 +1664,11 @@ type TypeLiteralNode = BaseNode & {
|
|
|
1689
1664
|
};
|
|
1690
1665
|
/**
|
|
1691
1666
|
* AST node for a single field accessed from a named group type.
|
|
1692
|
-
* TypeScript renders as `
|
|
1667
|
+
* TypeScript renders as `target['key']`.
|
|
1693
1668
|
*
|
|
1694
1669
|
* @example
|
|
1695
1670
|
* ```ts
|
|
1696
|
-
* createIndexedAccessType({
|
|
1671
|
+
* createIndexedAccessType({ target: 'GetPetPathParams', key: 'petId' })
|
|
1697
1672
|
* // GetPetPathParams['petId']
|
|
1698
1673
|
* ```
|
|
1699
1674
|
*/
|
|
@@ -1702,11 +1677,11 @@ type IndexedAccessTypeNode = BaseNode & {
|
|
|
1702
1677
|
/**
|
|
1703
1678
|
* Name of the type being indexed, e.g. `'GetPetPathParams'`.
|
|
1704
1679
|
*/
|
|
1705
|
-
|
|
1680
|
+
target: string;
|
|
1706
1681
|
/**
|
|
1707
1682
|
* Field key to access, e.g. `'petId'`.
|
|
1708
1683
|
*/
|
|
1709
|
-
|
|
1684
|
+
key: string;
|
|
1710
1685
|
};
|
|
1711
1686
|
/**
|
|
1712
1687
|
* AST node for an object destructuring binding, used as the name of a grouped function parameter.
|
|
@@ -1807,44 +1782,14 @@ type FunctionParamKind = FunctionParamNode['kind'];
|
|
|
1807
1782
|
* Definition for the {@link TypeLiteralNode}.
|
|
1808
1783
|
*/
|
|
1809
1784
|
declare const typeLiteralDef: NodeDef<TypeLiteralNode, Pick<TypeLiteralNode, "members">>;
|
|
1810
|
-
/**
|
|
1811
|
-
* Creates a {@link TypeLiteralNode} representing an inline anonymous object type.
|
|
1812
|
-
*
|
|
1813
|
-
* @example
|
|
1814
|
-
* ```ts
|
|
1815
|
-
* createTypeLiteral({ members: [{ name: 'petId', type: 'string', optional: false }] })
|
|
1816
|
-
* // { petId: string }
|
|
1817
|
-
* ```
|
|
1818
|
-
*/
|
|
1819
|
-
declare const createTypeLiteral: (input: Pick<TypeLiteralNode, "members">) => TypeLiteralNode;
|
|
1820
1785
|
/**
|
|
1821
1786
|
* Definition for the {@link IndexedAccessTypeNode}.
|
|
1822
1787
|
*/
|
|
1823
1788
|
declare const indexedAccessTypeDef: NodeDef<IndexedAccessTypeNode, Omit<IndexedAccessTypeNode, "kind">>;
|
|
1824
|
-
/**
|
|
1825
|
-
* Creates an {@link IndexedAccessTypeNode} representing a single field accessed from a named type.
|
|
1826
|
-
*
|
|
1827
|
-
* @example
|
|
1828
|
-
* ```ts
|
|
1829
|
-
* createIndexedAccessType({ objectType: 'DeletePetPathParams', indexType: 'petId' })
|
|
1830
|
-
* // DeletePetPathParams['petId']
|
|
1831
|
-
* ```
|
|
1832
|
-
*/
|
|
1833
|
-
declare const createIndexedAccessType: (input: Omit<IndexedAccessTypeNode, "kind">) => IndexedAccessTypeNode;
|
|
1834
1789
|
/**
|
|
1835
1790
|
* Definition for the {@link ObjectBindingPatternNode}.
|
|
1836
1791
|
*/
|
|
1837
1792
|
declare const objectBindingPatternDef: NodeDef<ObjectBindingPatternNode, Pick<ObjectBindingPatternNode, "elements">>;
|
|
1838
|
-
/**
|
|
1839
|
-
* Creates an {@link ObjectBindingPatternNode} for a destructured parameter binding.
|
|
1840
|
-
*
|
|
1841
|
-
* @example
|
|
1842
|
-
* ```ts
|
|
1843
|
-
* createObjectBindingPattern({ elements: [{ name: 'id' }, { name: 'name' }] })
|
|
1844
|
-
* // { id, name }
|
|
1845
|
-
* ```
|
|
1846
|
-
*/
|
|
1847
|
-
declare const createObjectBindingPattern: (input: Pick<ObjectBindingPatternNode, "elements">) => ObjectBindingPatternNode;
|
|
1848
1793
|
/**
|
|
1849
1794
|
* Plain property descriptor for a destructured group built by {@link createFunctionParameter}.
|
|
1850
1795
|
*/
|
|
@@ -1870,6 +1815,40 @@ type FunctionParameterInput = {
|
|
|
1870
1815
|
* paired with a {@link TypeLiteralNode} type.
|
|
1871
1816
|
*/
|
|
1872
1817
|
declare const functionParameterDef: NodeDef<FunctionParameterNode, FunctionParameterInput>;
|
|
1818
|
+
/**
|
|
1819
|
+
* Definition for the {@link FunctionParametersNode}.
|
|
1820
|
+
*/
|
|
1821
|
+
declare const functionParametersDef: NodeDef<FunctionParametersNode, Partial<Omit<FunctionParametersNode, "kind">>>;
|
|
1822
|
+
/**
|
|
1823
|
+
* Creates a {@link TypeLiteralNode} representing an inline anonymous object type.
|
|
1824
|
+
*
|
|
1825
|
+
* @example
|
|
1826
|
+
* ```ts
|
|
1827
|
+
* createTypeLiteral({ members: [{ name: 'petId', type: 'string', optional: false }] })
|
|
1828
|
+
* // { petId: string }
|
|
1829
|
+
* ```
|
|
1830
|
+
*/
|
|
1831
|
+
declare const createTypeLiteral: (input: Pick<TypeLiteralNode, "members">) => TypeLiteralNode;
|
|
1832
|
+
/**
|
|
1833
|
+
* Creates an {@link IndexedAccessTypeNode} representing a single field accessed from a named type.
|
|
1834
|
+
*
|
|
1835
|
+
* @example
|
|
1836
|
+
* ```ts
|
|
1837
|
+
* createIndexedAccessType({ target: 'DeletePetPathParams', key: 'petId' })
|
|
1838
|
+
* // DeletePetPathParams['petId']
|
|
1839
|
+
* ```
|
|
1840
|
+
*/
|
|
1841
|
+
declare const createIndexedAccessType: (input: Omit<IndexedAccessTypeNode, "kind">) => IndexedAccessTypeNode;
|
|
1842
|
+
/**
|
|
1843
|
+
* Creates an {@link ObjectBindingPatternNode} for a destructured parameter binding.
|
|
1844
|
+
*
|
|
1845
|
+
* @example
|
|
1846
|
+
* ```ts
|
|
1847
|
+
* createObjectBindingPattern({ elements: [{ name: 'id' }, { name: 'name' }] })
|
|
1848
|
+
* // { id, name }
|
|
1849
|
+
* ```
|
|
1850
|
+
*/
|
|
1851
|
+
declare const createObjectBindingPattern: (input: Pick<ObjectBindingPatternNode, "elements">) => ObjectBindingPatternNode;
|
|
1873
1852
|
/**
|
|
1874
1853
|
* Creates a `FunctionParameterNode`. `optional` defaults to `false`.
|
|
1875
1854
|
*
|
|
@@ -1886,10 +1865,6 @@ declare const functionParameterDef: NodeDef<FunctionParameterNode, FunctionParam
|
|
|
1886
1865
|
* ```
|
|
1887
1866
|
*/
|
|
1888
1867
|
declare const createFunctionParameter: (input: FunctionParameterInput) => FunctionParameterNode;
|
|
1889
|
-
/**
|
|
1890
|
-
* Definition for the {@link FunctionParametersNode}.
|
|
1891
|
-
*/
|
|
1892
|
-
declare const functionParametersDef: NodeDef<FunctionParametersNode, Partial<Omit<FunctionParametersNode, "kind">>>;
|
|
1893
1868
|
/**
|
|
1894
1869
|
* Creates a `FunctionParametersNode` from an ordered list of parameters.
|
|
1895
1870
|
*
|
|
@@ -1954,8 +1929,8 @@ type ParameterNode = BaseNode & {
|
|
|
1954
1929
|
};
|
|
1955
1930
|
type UserParameterNode = Pick<ParameterNode, 'name' | 'in' | 'schema'> & Partial<Omit<ParameterNode, 'kind' | 'name' | 'in' | 'schema'>>;
|
|
1956
1931
|
/**
|
|
1957
|
-
* Definition for the {@link ParameterNode}. `required` defaults to `false
|
|
1958
|
-
*
|
|
1932
|
+
* Definition for the {@link ParameterNode}. `required` defaults to `false`, and the schema's
|
|
1933
|
+
* `optional`/`nullish` flags are derived from it through {@link optionality}.
|
|
1959
1934
|
*/
|
|
1960
1935
|
declare const parameterDef: NodeDef<ParameterNode, UserParameterNode>;
|
|
1961
1936
|
/**
|
|
@@ -2011,21 +1986,16 @@ type RequestBodyNode = BaseNode & {
|
|
|
2011
1986
|
content?: Array<ContentNode>;
|
|
2012
1987
|
};
|
|
2013
1988
|
/**
|
|
2014
|
-
*
|
|
1989
|
+
* Definition for the {@link RequestBodyNode}. Content entries are built upfront with
|
|
1990
|
+
* {@link createContent}, mirroring how `parameters` and `responses` take prebuilt nodes.
|
|
2015
1991
|
*/
|
|
2016
|
-
|
|
2017
|
-
content?: Array<UserContent>;
|
|
2018
|
-
};
|
|
2019
|
-
/**
|
|
2020
|
-
* Definition for the {@link RequestBodyNode}, normalizing each content entry into a `ContentNode`.
|
|
2021
|
-
*/
|
|
2022
|
-
declare const requestBodyDef: NodeDef<RequestBodyNode, UserRequestBody>;
|
|
1992
|
+
declare const requestBodyDef: NodeDef<RequestBodyNode, Omit<RequestBodyNode, "kind">>;
|
|
2023
1993
|
/**
|
|
2024
|
-
* Creates a `RequestBodyNode
|
|
1994
|
+
* Creates a `RequestBodyNode`.
|
|
2025
1995
|
*/
|
|
2026
|
-
declare const createRequestBody: (input:
|
|
1996
|
+
declare const createRequestBody: (input: Omit<RequestBodyNode, "kind">) => RequestBodyNode;
|
|
2027
1997
|
//#endregion
|
|
2028
|
-
//#region src/nodes/
|
|
1998
|
+
//#region src/nodes/response.d.ts
|
|
2029
1999
|
/**
|
|
2030
2000
|
* All supported HTTP status code literals as strings, as used in API specs
|
|
2031
2001
|
* (for example, `"200"` and `"404"`).
|
|
@@ -2043,8 +2013,6 @@ type HttpStatusCode = '100' | '101' | '102' | '103' | '200' | '201' | '202' | '2
|
|
|
2043
2013
|
* ```
|
|
2044
2014
|
*/
|
|
2045
2015
|
type StatusCode = HttpStatusCode | 'default';
|
|
2046
|
-
//#endregion
|
|
2047
|
-
//#region src/nodes/response.d.ts
|
|
2048
2016
|
/**
|
|
2049
2017
|
* AST node representing one operation response variant.
|
|
2050
2018
|
*
|
|
@@ -2057,7 +2025,7 @@ type StatusCode = HttpStatusCode | 'default';
|
|
|
2057
2025
|
* const response: ResponseNode = {
|
|
2058
2026
|
* kind: 'Response',
|
|
2059
2027
|
* statusCode: '200',
|
|
2060
|
-
* content: [{ contentType: 'application/json', schema: createSchema({ type: 'string' }) }],
|
|
2028
|
+
* content: [{ kind: 'Content', contentType: 'application/json', schema: createSchema({ type: 'string' }) }],
|
|
2061
2029
|
* }
|
|
2062
2030
|
* ```
|
|
2063
2031
|
*/
|
|
@@ -2092,7 +2060,7 @@ type ResponseNode = BaseNode & {
|
|
|
2092
2060
|
content?: Array<ContentNode>;
|
|
2093
2061
|
};
|
|
2094
2062
|
type ResponseInput = Pick<ResponseNode, 'statusCode'> & Partial<Omit<ResponseNode, 'kind' | 'statusCode' | 'content'>> & {
|
|
2095
|
-
content?: Array<
|
|
2063
|
+
content?: Array<ContentNode>;
|
|
2096
2064
|
schema?: SchemaNode;
|
|
2097
2065
|
mediaType?: string | null;
|
|
2098
2066
|
keysToOmit?: Array<string> | null;
|
|
@@ -2109,13 +2077,16 @@ declare const responseDef: NodeDef<ResponseNode, ResponseInput>;
|
|
|
2109
2077
|
* ```ts
|
|
2110
2078
|
* const response = createResponse({
|
|
2111
2079
|
* statusCode: '200',
|
|
2112
|
-
* content: [{ contentType: 'application/json', schema: createSchema({ type: 'object', properties: [] }) }],
|
|
2080
|
+
* content: [createContent({ contentType: 'application/json', schema: createSchema({ type: 'object', properties: [] }) })],
|
|
2113
2081
|
* })
|
|
2114
2082
|
* ```
|
|
2115
2083
|
*/
|
|
2116
2084
|
declare const createResponse: (input: ResponseInput) => ResponseNode;
|
|
2117
2085
|
//#endregion
|
|
2118
2086
|
//#region src/nodes/operation.d.ts
|
|
2087
|
+
/**
|
|
2088
|
+
* HTTP method an operation responds to.
|
|
2089
|
+
*/
|
|
2119
2090
|
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE';
|
|
2120
2091
|
/**
|
|
2121
2092
|
* Transport an operation belongs to.
|
|
@@ -2217,7 +2188,7 @@ type OperationInput = {
|
|
|
2217
2188
|
operationId: string;
|
|
2218
2189
|
method?: HttpOperationNode['method'];
|
|
2219
2190
|
path?: HttpOperationNode['path'];
|
|
2220
|
-
requestBody?:
|
|
2191
|
+
requestBody?: Omit<RequestBodyNode, 'kind'>;
|
|
2221
2192
|
[key: string]: unknown;
|
|
2222
2193
|
};
|
|
2223
2194
|
/**
|
|
@@ -2236,10 +2207,10 @@ declare const operationDef: NodeDef<OperationNode, OperationInput>;
|
|
|
2236
2207
|
* ```
|
|
2237
2208
|
*/
|
|
2238
2209
|
declare function createOperation(props: Pick<HttpOperationNode, 'operationId' | 'method' | 'path'> & Partial<Omit<HttpOperationNode, 'kind' | 'operationId' | 'method' | 'path' | 'requestBody'>> & {
|
|
2239
|
-
requestBody?:
|
|
2210
|
+
requestBody?: Omit<RequestBodyNode, 'kind'>;
|
|
2240
2211
|
}): HttpOperationNode;
|
|
2241
2212
|
declare function createOperation(props: Pick<GenericOperationNode, 'operationId'> & Partial<Omit<GenericOperationNode, 'kind' | 'operationId' | 'requestBody'>> & {
|
|
2242
|
-
requestBody?:
|
|
2213
|
+
requestBody?: Omit<RequestBodyNode, 'kind'>;
|
|
2243
2214
|
}): GenericOperationNode;
|
|
2244
2215
|
//#endregion
|
|
2245
2216
|
//#region src/nodes/input.d.ts
|
|
@@ -2306,8 +2277,7 @@ type InputMeta = {
|
|
|
2306
2277
|
* Produced by the adapter and consumed by all Kubb plugins.
|
|
2307
2278
|
*
|
|
2308
2279
|
* `Stream` switches `schemas` and `operations` between eager `Array`s (the default) and lazy
|
|
2309
|
-
* `AsyncIterable`s. The streaming variant `InputNode<true>` yields nodes one at a time
|
|
2310
|
-
* `meta` optional, since the adapter can emit metadata before the first node is parsed.
|
|
2280
|
+
* `AsyncIterable`s. The streaming variant `InputNode<true>` yields nodes one at a time.
|
|
2311
2281
|
*
|
|
2312
2282
|
* @example
|
|
2313
2283
|
* ```ts
|
|
@@ -2339,19 +2309,19 @@ type InputNode<Stream extends boolean = false> = BaseNode & {
|
|
|
2339
2309
|
* All operation nodes in the document.
|
|
2340
2310
|
*/
|
|
2341
2311
|
operations: Streamable<OperationNode, Stream>;
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2312
|
+
/**
|
|
2313
|
+
* Document metadata populated by the adapter.
|
|
2314
|
+
*/
|
|
2345
2315
|
meta: InputMeta;
|
|
2346
|
-
}
|
|
2316
|
+
};
|
|
2347
2317
|
/**
|
|
2348
2318
|
* Definition for the {@link InputNode}.
|
|
2349
2319
|
*/
|
|
2350
2320
|
declare const inputDef: NodeDef<InputNode<false>, Partial<Omit<InputNode<false>, "kind">>>;
|
|
2351
2321
|
/**
|
|
2352
2322
|
* Creates an `InputNode`. Pass `stream: true` for the streaming variant whose `schemas` and
|
|
2353
|
-
* `operations` are `AsyncIterable` sources
|
|
2354
|
-
*
|
|
2323
|
+
* `operations` are `AsyncIterable` sources. Otherwise it builds the eager variant with array
|
|
2324
|
+
* `schemas`/`operations`. Both variants get the defaulted `meta`.
|
|
2355
2325
|
*
|
|
2356
2326
|
* @example Eager
|
|
2357
2327
|
* ```ts
|
|
@@ -2429,5 +2399,5 @@ declare function createOutput(overrides?: Partial<Omit<OutputNode, 'kind'>>): Ou
|
|
|
2429
2399
|
*/
|
|
2430
2400
|
type Node = InputNode | OutputNode | OperationNode | SchemaNode | PropertyNode | ParameterNode | ResponseNode | RequestBodyNode | ContentNode | FunctionParamNode | FileNode | ImportNode | ExportNode | SourceNode | ConstNode | TypeNode | FunctionNode | ArrowFunctionNode;
|
|
2431
2401
|
//#endregion
|
|
2432
|
-
export {
|
|
2433
|
-
//# sourceMappingURL=index-
|
|
2402
|
+
export { exportDef as $, textDef as $t, IndexedAccessTypeNode as A, InferSchemaNode as At, functionParametersDef as B, TypeNode as Bt, ParameterNode as C, UrlSchemaNode as Ct, FunctionParamNode as D, UserPropertyNode as Dt, FunctionParamKind as E, PropertyNode as Et, createFunctionParameters as F, ConstNode as Ft, FileNode as G, createBreak as Gt, objectBindingPatternDef as H, breakDef as Ht, createIndexedAccessType as I, FunctionNode as It, UserFileNode as J, createJsx as Jt, ImportNode as K, createConst as Kt, createObjectBindingPattern as L, JSDocNode as Lt, TypeExpression as M, ArrowFunctionNode as Mt, TypeLiteralNode as N, BreakNode as Nt, FunctionParameterNode as O, createProperty as Ot, createFunctionParameter as P, CodeNode as Pt, createSource as Q, jsxDef as Qt, createTypeLiteral as R, JsxNode as Rt, ParameterLocation as S, UnionSchemaNode as St, parameterDef as T, schemaDef as Tt, typeLiteralDef as U, constDef as Ut, indexedAccessTypeDef as V, arrowFunctionDef as Vt, ExportNode as W, createArrowFunction as Wt, createFile as X, createType as Xt, createExport as Y, createText as Yt, createImport as Z, functionDef as Zt, createResponse as _, SchemaNode as _t, InputMeta as a, NodeKind as an, createContent as at, createRequestBody as b, StringSchemaNode as bt, inputDef as c, DatetimeSchemaNode as ct, HttpOperationNode as d, NumberSchemaNode as dt, typeDef as en, fileDef as et, OperationNode as f, ObjectSchemaNode as ft, StatusCode as g, ScalarSchemaType as gt, ResponseNode as h, ScalarSchemaNode as ht, outputDef as i, BaseNode as in, contentDef as it, ObjectBindingPatternNode as j, ParserOptions as jt, FunctionParametersNode as k, propertyDef as kt, GenericOperationNode as l, EnumSchemaNode as lt, operationDef as m, RefSchemaNode as mt, OutputNode as n, NodeDef as nn, sourceDef as nt, InputNode as o, ArraySchemaNode as ot, createOperation as p, PrimitiveSchemaType as pt, SourceNode as q, createFunction as qt, createOutput as r, defineNode as rn, ContentNode as rt, createInput as s, DateSchemaNode as st, Node as t, DistributiveOmit as tn, importDef as tt, HttpMethod as u, IntersectionSchemaNode as ut, responseDef as v, SchemaNodeByType as vt, createParameter as w, createSchema as wt, requestBodyDef as x, TimeSchemaNode as xt, RequestBodyNode as y, SchemaType as yt, functionParameterDef as z, TextNode as zt };
|
|
2403
|
+
//# sourceMappingURL=index-B9cc8MBS.d.ts.map
|