@kubb/ast 5.0.0-beta.62 → 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-Vw-xQvq7.d.ts → defineMacro-BATi7xoC.d.ts} +4 -5
- package/dist/{defineMacro-BryDiuQl.cjs → defineMacro-CEZHaCXE.cjs} +5 -5
- package/dist/defineMacro-CEZHaCXE.cjs.map +1 -0
- package/dist/{defineMacro-CNkUpxia.js → defineMacro-Shz8f6SG.js} +3 -3
- package/dist/defineMacro-Shz8f6SG.js.map +1 -0
- package/dist/factory.cjs +56 -56
- package/dist/factory.cjs.map +1 -1
- package/dist/factory.d.ts +5 -5
- package/dist/factory.js +5 -5
- package/dist/factory.js.map +1 -1
- package/dist/{index-CTaN_ee_.d.ts → index-B9cc8MBS.d.ts} +46 -113
- package/dist/index.cjs +142 -271
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.js +108 -236
- package/dist/index.js.map +1 -1
- package/dist/macros.cjs +12 -12
- package/dist/macros.cjs.map +1 -1
- package/dist/macros.d.ts +2 -2
- package/dist/macros.js +4 -4
- package/dist/macros.js.map +1 -1
- package/dist/{operationParams-B44p6EQy.d.ts → operationParams-k5CKwSWZ.d.ts} +9 -2
- package/dist/{visitor-DepQEKyp.js → refs-BjNDuCBD.js} +115 -120
- package/dist/refs-BjNDuCBD.js.map +1 -0
- package/dist/{visitor-B7Zlnp4c.cjs → refs-u5SDdyV7.cjs} +139 -144
- package/dist/refs-u5SDdyV7.cjs.map +1 -0
- package/dist/{response-BeG6hq2D.cjs → schema-BkvrrOAr.cjs} +171 -153
- package/dist/schema-BkvrrOAr.cjs.map +1 -0
- package/dist/{response-Rd1uisM1.js → schema-Cbnxmz4b.js} +166 -154
- package/dist/schema-Cbnxmz4b.js.map +1 -0
- package/dist/{types-DQTgVSwE.d.ts → types-BB_xgRJ3.d.ts} +55 -79
- package/dist/types.d.ts +5 -5
- package/dist/{utils-BDI3kXlb.cjs → utils-CEepwqmb.cjs} +74 -67
- package/dist/utils-CEepwqmb.cjs.map +1 -0
- package/dist/{utils-DW9rnfsD.js → utils-DaXkewb1.js} +56 -49
- package/dist/utils-DaXkewb1.js.map +1 -0
- package/dist/utils.cjs +11 -11
- package/dist/utils.d.ts +44 -29
- package/dist/utils.js +3 -3
- package/package.json +1 -1
- package/src/constants.ts +3 -6
- package/src/defineMacro.ts +1 -1
- package/src/defineNode.ts +6 -9
- package/src/definePrinter.ts +5 -3
- package/src/dialect.ts +23 -13
- package/src/factory.ts +4 -4
- package/src/index.ts +1 -1
- package/src/infer.ts +1 -1
- package/src/macros/macroEnumName.ts +1 -1
- package/src/nodes/code.ts +8 -5
- package/src/nodes/file.ts +5 -4
- package/src/nodes/operation.ts +3 -0
- package/src/nodes/parameter.ts +5 -5
- package/src/nodes/property.ts +5 -5
- package/src/nodes/schema.ts +4 -4
- package/src/optionality.ts +15 -0
- package/src/types.ts +1 -2
- package/src/utils/codegen.ts +6 -7
- package/src/utils/fileMerge.ts +7 -8
- package/src/utils/operationParams.ts +8 -8
- 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 +1 -1
- package/dist/defineMacro-BryDiuQl.cjs.map +0 -1
- package/dist/defineMacro-CNkUpxia.js.map +0 -1
- package/dist/response-BeG6hq2D.cjs.map +0 -1
- package/dist/response-Rd1uisM1.js.map +0 -1
- package/dist/utils-BDI3kXlb.cjs.map +0 -1
- package/dist/utils-DW9rnfsD.js.map +0 -1
- package/dist/visitor-B7Zlnp4c.cjs.map +0 -1
- package/dist/visitor-DepQEKyp.js.map +0 -1
- package/src/dedupe.ts +0 -231
|
@@ -1,75 +1,5 @@
|
|
|
1
1
|
import { n as __name } from "./chunk-CNktS9qV.js";
|
|
2
2
|
|
|
3
|
-
//#region src/dialect.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* The spec-specific questions a schema parser answers while turning a source document into Kubb
|
|
6
|
-
* AST nodes. The rest of the pipeline is generic JSON Schema, so this is the one seam where
|
|
7
|
-
* OpenAPI, AsyncAPI, and plain JSON Schema differ.
|
|
8
|
-
*/
|
|
9
|
-
type SchemaDialect<TSchema = unknown, TRef = TSchema, TDiscriminated = TSchema, TDocument = unknown> = {
|
|
10
|
-
/**
|
|
11
|
-
* Whether the schema is nullable.
|
|
12
|
-
*/
|
|
13
|
-
isNullable(schema?: TSchema): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Whether the value is a `$ref` pointer.
|
|
16
|
-
*/
|
|
17
|
-
isReference(value?: unknown): value is TRef;
|
|
18
|
-
/**
|
|
19
|
-
* Whether the schema carries a discriminator for polymorphism.
|
|
20
|
-
*/
|
|
21
|
-
isDiscriminator(value?: unknown): value is TDiscriminated;
|
|
22
|
-
/**
|
|
23
|
-
* Whether the schema is binary data, converted to a `blob` node.
|
|
24
|
-
*/
|
|
25
|
-
isBinary(schema: TSchema): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Resolves a local `$ref` against the document, or nullish when it cannot.
|
|
28
|
-
*/
|
|
29
|
-
resolveRef<TResolved>(document: TDocument, ref: string): TResolved | null | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Derives a schema's `optional`/`nullish` flags from a parent's `required` value and the
|
|
32
|
-
* schema's own `nullable`. How "required" and "nullable" combine is spec-specific, so the
|
|
33
|
-
* dialect owns it. Method syntax keeps a concrete dialect assignable to the base
|
|
34
|
-
* `SchemaDialect` (bivariant parameters).
|
|
35
|
-
*/
|
|
36
|
-
optionality(schema: SchemaNode, required: boolean): SchemaNode;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* A spec adapter's dialect. `name` identifies it in logs and diagnostics; `schema` holds the
|
|
40
|
-
* spec-specific schema questions the parser answers.
|
|
41
|
-
*/
|
|
42
|
-
type Dialect<TSchema = unknown, TRef = TSchema, TDiscriminated = TSchema, TDocument = unknown> = {
|
|
43
|
-
/**
|
|
44
|
-
* Identifies the dialect in logs and diagnostics.
|
|
45
|
-
*/
|
|
46
|
-
name: string;
|
|
47
|
-
/**
|
|
48
|
-
* The spec-specific schema behavior. See {@link SchemaDialect}.
|
|
49
|
-
*/
|
|
50
|
-
schema: SchemaDialect<TSchema, TRef, TDiscriminated, TDocument>;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Types a {@link Dialect} for an adapter. Adds no runtime behavior and only pins the
|
|
54
|
-
* dialect's type for inference.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```ts
|
|
58
|
-
* export const oasDialect = defineDialect({
|
|
59
|
-
* name: 'oas',
|
|
60
|
-
* schema: {
|
|
61
|
-
* isNullable,
|
|
62
|
-
* isReference,
|
|
63
|
-
* isDiscriminator,
|
|
64
|
-
* isBinary: (schema) => schema.type === 'string' && schema.contentMediaType === 'application/octet-stream',
|
|
65
|
-
* resolveRef,
|
|
66
|
-
* optionality,
|
|
67
|
-
* },
|
|
68
|
-
* })
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
declare function defineDialect<TSchema, TRef, TDiscriminated, TDocument>(dialect: Dialect<TSchema, TRef, TDiscriminated, TDocument>): Dialect<TSchema, TRef, TDiscriminated, TDocument>;
|
|
72
|
-
//#endregion
|
|
73
3
|
//#region src/nodes/base.d.ts
|
|
74
4
|
/**
|
|
75
5
|
* `kind` values used by AST nodes.
|
|
@@ -128,11 +58,9 @@ type NodeDef<TNode extends BaseNode = BaseNode, TInput = never> = {
|
|
|
128
58
|
*/
|
|
129
59
|
kind: NodeKind;
|
|
130
60
|
/**
|
|
131
|
-
* Builds a node from its input, applying `defaults` and the optional `build` hook.
|
|
132
|
-
* optional `dialect` is forwarded to `build` so nodes can derive spec-specific fields
|
|
133
|
-
* (e.g. a schema's `optional`/`nullish`) through `dialect.schema.optionality` when one is given.
|
|
61
|
+
* Builds a node from its input, applying `defaults` and the optional `build` hook.
|
|
134
62
|
*/
|
|
135
|
-
create: (input: TInput
|
|
63
|
+
create: (input: TInput) => TNode;
|
|
136
64
|
/**
|
|
137
65
|
* Type guard matching this node kind.
|
|
138
66
|
*/
|
|
@@ -149,7 +77,7 @@ type NodeDef<TNode extends BaseNode = BaseNode, TInput = never> = {
|
|
|
149
77
|
type DefineNodeConfig<TNode extends BaseNode, TInput, TBuilt extends object> = {
|
|
150
78
|
kind: TNode['kind'];
|
|
151
79
|
defaults?: Partial<TNode>;
|
|
152
|
-
build?: (input: TInput
|
|
80
|
+
build?: (input: TInput) => TBuilt;
|
|
153
81
|
children?: ReadonlyArray<string>;
|
|
154
82
|
visitorKey?: VisitorKey;
|
|
155
83
|
};
|
|
@@ -289,7 +217,10 @@ type FunctionNode = BaseNode & {
|
|
|
289
217
|
*/
|
|
290
218
|
default?: boolean | null;
|
|
291
219
|
/**
|
|
292
|
-
* 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 = {}'`
|
|
293
224
|
*/
|
|
294
225
|
params?: string | null;
|
|
295
226
|
/**
|
|
@@ -363,16 +294,16 @@ type TextNode = BaseNode & {
|
|
|
363
294
|
value: string;
|
|
364
295
|
};
|
|
365
296
|
/**
|
|
366
|
-
* AST node representing a line
|
|
297
|
+
* AST node representing a blank line in the source output.
|
|
367
298
|
*
|
|
368
|
-
* Corresponds to `<br/>` in JSX components.
|
|
369
|
-
*
|
|
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.
|
|
370
302
|
*
|
|
371
303
|
* @example
|
|
372
304
|
* ```ts
|
|
373
305
|
* createBreak()
|
|
374
306
|
* // { kind: 'Break' }
|
|
375
|
-
* // prints as '' → blank line when surrounded by other nodes
|
|
376
307
|
* ```
|
|
377
308
|
*/
|
|
378
309
|
type BreakNode = BaseNode & {
|
|
@@ -441,7 +372,7 @@ declare const jsxDef: NodeDef<JsxNode, string>;
|
|
|
441
372
|
* // export const pets: Pet[] = ... as const
|
|
442
373
|
* ```
|
|
443
374
|
*/
|
|
444
|
-
declare const createConst: (input: Omit<ConstNode, "kind"
|
|
375
|
+
declare const createConst: (input: Omit<ConstNode, "kind">) => ConstNode;
|
|
445
376
|
/**
|
|
446
377
|
* Creates a `TypeNode` representing a TypeScript `type` alias declaration.
|
|
447
378
|
*
|
|
@@ -451,7 +382,7 @@ declare const createConst: (input: Omit<ConstNode, "kind">, dialect?: Dialect) =
|
|
|
451
382
|
* // export type Pet = ...
|
|
452
383
|
* ```
|
|
453
384
|
*/
|
|
454
|
-
declare const createType: (input: Omit<TypeNode, "kind"
|
|
385
|
+
declare const createType: (input: Omit<TypeNode, "kind">) => TypeNode;
|
|
455
386
|
/**
|
|
456
387
|
* Creates a `FunctionNode` representing a TypeScript `function` declaration.
|
|
457
388
|
*
|
|
@@ -461,7 +392,7 @@ declare const createType: (input: Omit<TypeNode, "kind">, dialect?: Dialect) =>
|
|
|
461
392
|
* // export async function fetchPet(): Promise<Pet> { ... }
|
|
462
393
|
* ```
|
|
463
394
|
*/
|
|
464
|
-
declare const createFunction: (input: Omit<FunctionNode, "kind"
|
|
395
|
+
declare const createFunction: (input: Omit<FunctionNode, "kind">) => FunctionNode;
|
|
465
396
|
/**
|
|
466
397
|
* Creates an `ArrowFunctionNode` representing a TypeScript arrow function.
|
|
467
398
|
*
|
|
@@ -471,7 +402,7 @@ declare const createFunction: (input: Omit<FunctionNode, "kind">, dialect?: Dial
|
|
|
471
402
|
* // export const double = (n: number) => ...
|
|
472
403
|
* ```
|
|
473
404
|
*/
|
|
474
|
-
declare const createArrowFunction: (input: Omit<ArrowFunctionNode, "kind"
|
|
405
|
+
declare const createArrowFunction: (input: Omit<ArrowFunctionNode, "kind">) => ArrowFunctionNode;
|
|
475
406
|
/**
|
|
476
407
|
* Creates a {@link TextNode} representing a raw string fragment in the source output.
|
|
477
408
|
*
|
|
@@ -481,7 +412,7 @@ declare const createArrowFunction: (input: Omit<ArrowFunctionNode, "kind">, dial
|
|
|
481
412
|
* // { kind: 'Text', value: 'return fetch(id)' }
|
|
482
413
|
* ```
|
|
483
414
|
*/
|
|
484
|
-
declare const createText: (input: string
|
|
415
|
+
declare const createText: (input: string) => TextNode;
|
|
485
416
|
/**
|
|
486
417
|
* Creates a {@link BreakNode} representing a line break in the source output.
|
|
487
418
|
*
|
|
@@ -501,11 +432,11 @@ declare function createBreak(): BreakNode;
|
|
|
501
432
|
* // { kind: 'Jsx', value: '<>\n <a href={href}>Open</a>\n</>' }
|
|
502
433
|
* ```
|
|
503
434
|
*/
|
|
504
|
-
declare const createJsx: (input: string
|
|
435
|
+
declare const createJsx: (input: string) => JsxNode;
|
|
505
436
|
//#endregion
|
|
506
437
|
//#region src/infer.d.ts
|
|
507
438
|
/**
|
|
508
|
-
*
|
|
439
|
+
* Options that control how the adapter parser maps OpenAPI schemas to AST nodes.
|
|
509
440
|
*/
|
|
510
441
|
type ParserOptions = {
|
|
511
442
|
/**
|
|
@@ -685,9 +616,8 @@ type PropertyNode = BaseNode & {
|
|
|
685
616
|
*/
|
|
686
617
|
type UserPropertyNode = Pick<PropertyNode, 'name' | 'schema'> & Partial<Omit<PropertyNode, 'kind' | 'name' | 'schema'>>;
|
|
687
618
|
/**
|
|
688
|
-
* Definition for the {@link PropertyNode}. `required` defaults to `false
|
|
689
|
-
*
|
|
690
|
-
* `optionality`; without one, the schema is left as-is.
|
|
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}.
|
|
691
621
|
*/
|
|
692
622
|
declare const propertyDef: NodeDef<PropertyNode, UserPropertyNode>;
|
|
693
623
|
/**
|
|
@@ -703,7 +633,7 @@ declare const propertyDef: NodeDef<PropertyNode, UserPropertyNode>;
|
|
|
703
633
|
* // required=true, no optional/nullish
|
|
704
634
|
* ```
|
|
705
635
|
*/
|
|
706
|
-
declare const createProperty: (input: UserPropertyNode
|
|
636
|
+
declare const createProperty: (input: UserPropertyNode) => PropertyNode;
|
|
707
637
|
//#endregion
|
|
708
638
|
//#region src/nodes/schema.d.ts
|
|
709
639
|
type PrimitiveSchemaType =
|
|
@@ -786,7 +716,7 @@ type SchemaNodeBase = BaseNode & {
|
|
|
786
716
|
/**
|
|
787
717
|
* Schema name for named definitions (for example, `"Pet"`).
|
|
788
718
|
* Inline schemas omit this field.
|
|
789
|
-
* `null` means
|
|
719
|
+
* `null` means Kubb has processed this and determined there is no applicable name.
|
|
790
720
|
* `undefined` means the name has not been set yet.
|
|
791
721
|
*/
|
|
792
722
|
name?: string | null;
|
|
@@ -868,7 +798,7 @@ type ObjectSchemaNode = SchemaNodeBase & {
|
|
|
868
798
|
/**
|
|
869
799
|
* Additional object properties behavior:
|
|
870
800
|
* - `true`: allow any value
|
|
871
|
-
* - `false`: reject unknown properties
|
|
801
|
+
* - `false`: reject unknown properties
|
|
872
802
|
* - `SchemaNode`: allow values that match that schema
|
|
873
803
|
* - `undefined`: no additional properties constraint (open object)
|
|
874
804
|
*/
|
|
@@ -1375,7 +1305,7 @@ declare const contentDef: NodeDef<ContentNode, Omit<ContentNode, "kind">>;
|
|
|
1375
1305
|
/**
|
|
1376
1306
|
* Creates a `ContentNode` for a single request-body or response content type.
|
|
1377
1307
|
*/
|
|
1378
|
-
declare const createContent: (input: Omit<ContentNode, "kind"
|
|
1308
|
+
declare const createContent: (input: Omit<ContentNode, "kind">) => ContentNode;
|
|
1379
1309
|
//#endregion
|
|
1380
1310
|
//#region src/nodes/file.d.ts
|
|
1381
1311
|
/**
|
|
@@ -1566,13 +1496,14 @@ type FileNode<TMeta extends object = object> = BaseNode & {
|
|
|
1566
1496
|
id: string;
|
|
1567
1497
|
/**
|
|
1568
1498
|
* File name without extension, derived from `baseName`.
|
|
1569
|
-
*
|
|
1499
|
+
*
|
|
1500
|
+
* @see https://nodejs.org/api/path.html#pathformatpathobject
|
|
1570
1501
|
*/
|
|
1571
1502
|
name: string;
|
|
1572
1503
|
/**
|
|
1573
|
-
* File base name, including extension
|
|
1574
|
-
*
|
|
1575
|
-
* @
|
|
1504
|
+
* File base name, including extension, shaped like `${name}${extname}`.
|
|
1505
|
+
*
|
|
1506
|
+
* @see https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
1576
1507
|
*/
|
|
1577
1508
|
baseName: `${string}.${string}`;
|
|
1578
1509
|
/**
|
|
@@ -1636,7 +1567,7 @@ declare const fileDef: NodeDef<FileNode<object>, Omit<FileNode<object>, "kind">>
|
|
|
1636
1567
|
* // import { useState } from 'react'
|
|
1637
1568
|
* ```
|
|
1638
1569
|
*/
|
|
1639
|
-
declare const createImport: (input: Omit<ImportNode, "kind"
|
|
1570
|
+
declare const createImport: (input: Omit<ImportNode, "kind">) => ImportNode;
|
|
1640
1571
|
/**
|
|
1641
1572
|
* Creates an `ExportNode` representing a language-agnostic export/public API declaration.
|
|
1642
1573
|
*
|
|
@@ -1646,7 +1577,7 @@ declare const createImport: (input: Omit<ImportNode, "kind">, dialect?: Dialect)
|
|
|
1646
1577
|
* // export { Pet } from './Pet'
|
|
1647
1578
|
* ```
|
|
1648
1579
|
*/
|
|
1649
|
-
declare const createExport: (input: Omit<ExportNode, "kind"
|
|
1580
|
+
declare const createExport: (input: Omit<ExportNode, "kind">) => ExportNode;
|
|
1650
1581
|
/**
|
|
1651
1582
|
* Creates a `SourceNode` representing a fragment of source code within a file.
|
|
1652
1583
|
*
|
|
@@ -1655,7 +1586,7 @@ declare const createExport: (input: Omit<ExportNode, "kind">, dialect?: Dialect)
|
|
|
1655
1586
|
* createSource({ name: 'Pet', nodes: [createText('export type Pet = { id: number }')], isExportable: true })
|
|
1656
1587
|
* ```
|
|
1657
1588
|
*/
|
|
1658
|
-
declare const createSource: (input: Omit<SourceNode, "kind"
|
|
1589
|
+
declare const createSource: (input: Omit<SourceNode, "kind">) => SourceNode;
|
|
1659
1590
|
/**
|
|
1660
1591
|
* Input descriptor for {@link createFile}, before `id`, `name`, and `extname` are computed
|
|
1661
1592
|
* and `imports`/`exports`/`sources` are deduplicated.
|
|
@@ -1897,7 +1828,7 @@ declare const functionParametersDef: NodeDef<FunctionParametersNode, Partial<Omi
|
|
|
1897
1828
|
* // { petId: string }
|
|
1898
1829
|
* ```
|
|
1899
1830
|
*/
|
|
1900
|
-
declare const createTypeLiteral: (input: Pick<TypeLiteralNode, "members"
|
|
1831
|
+
declare const createTypeLiteral: (input: Pick<TypeLiteralNode, "members">) => TypeLiteralNode;
|
|
1901
1832
|
/**
|
|
1902
1833
|
* Creates an {@link IndexedAccessTypeNode} representing a single field accessed from a named type.
|
|
1903
1834
|
*
|
|
@@ -1907,7 +1838,7 @@ declare const createTypeLiteral: (input: Pick<TypeLiteralNode, "members">, diale
|
|
|
1907
1838
|
* // DeletePetPathParams['petId']
|
|
1908
1839
|
* ```
|
|
1909
1840
|
*/
|
|
1910
|
-
declare const createIndexedAccessType: (input: Omit<IndexedAccessTypeNode, "kind"
|
|
1841
|
+
declare const createIndexedAccessType: (input: Omit<IndexedAccessTypeNode, "kind">) => IndexedAccessTypeNode;
|
|
1911
1842
|
/**
|
|
1912
1843
|
* Creates an {@link ObjectBindingPatternNode} for a destructured parameter binding.
|
|
1913
1844
|
*
|
|
@@ -1917,7 +1848,7 @@ declare const createIndexedAccessType: (input: Omit<IndexedAccessTypeNode, "kind
|
|
|
1917
1848
|
* // { id, name }
|
|
1918
1849
|
* ```
|
|
1919
1850
|
*/
|
|
1920
|
-
declare const createObjectBindingPattern: (input: Pick<ObjectBindingPatternNode, "elements"
|
|
1851
|
+
declare const createObjectBindingPattern: (input: Pick<ObjectBindingPatternNode, "elements">) => ObjectBindingPatternNode;
|
|
1921
1852
|
/**
|
|
1922
1853
|
* Creates a `FunctionParameterNode`. `optional` defaults to `false`.
|
|
1923
1854
|
*
|
|
@@ -1933,7 +1864,7 @@ declare const createObjectBindingPattern: (input: Pick<ObjectBindingPatternNode,
|
|
|
1933
1864
|
* // → { id, name }: { id: string; name?: string } = {}
|
|
1934
1865
|
* ```
|
|
1935
1866
|
*/
|
|
1936
|
-
declare const createFunctionParameter: (input: FunctionParameterInput
|
|
1867
|
+
declare const createFunctionParameter: (input: FunctionParameterInput) => FunctionParameterNode;
|
|
1937
1868
|
/**
|
|
1938
1869
|
* Creates a `FunctionParametersNode` from an ordered list of parameters.
|
|
1939
1870
|
*
|
|
@@ -1998,9 +1929,8 @@ type ParameterNode = BaseNode & {
|
|
|
1998
1929
|
};
|
|
1999
1930
|
type UserParameterNode = Pick<ParameterNode, 'name' | 'in' | 'schema'> & Partial<Omit<ParameterNode, 'kind' | 'name' | 'in' | 'schema'>>;
|
|
2000
1931
|
/**
|
|
2001
|
-
* Definition for the {@link ParameterNode}. `required` defaults to `false
|
|
2002
|
-
*
|
|
2003
|
-
* `optionality`; without one, the schema is left as-is.
|
|
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}.
|
|
2004
1934
|
*/
|
|
2005
1935
|
declare const parameterDef: NodeDef<ParameterNode, UserParameterNode>;
|
|
2006
1936
|
/**
|
|
@@ -2016,7 +1946,7 @@ declare const parameterDef: NodeDef<ParameterNode, UserParameterNode>;
|
|
|
2016
1946
|
* })
|
|
2017
1947
|
* ```
|
|
2018
1948
|
*/
|
|
2019
|
-
declare const createParameter: (input: UserParameterNode
|
|
1949
|
+
declare const createParameter: (input: UserParameterNode) => ParameterNode;
|
|
2020
1950
|
//#endregion
|
|
2021
1951
|
//#region src/nodes/requestBody.d.ts
|
|
2022
1952
|
/**
|
|
@@ -2063,7 +1993,7 @@ declare const requestBodyDef: NodeDef<RequestBodyNode, Omit<RequestBodyNode, "ki
|
|
|
2063
1993
|
/**
|
|
2064
1994
|
* Creates a `RequestBodyNode`.
|
|
2065
1995
|
*/
|
|
2066
|
-
declare const createRequestBody: (input: Omit<RequestBodyNode, "kind"
|
|
1996
|
+
declare const createRequestBody: (input: Omit<RequestBodyNode, "kind">) => RequestBodyNode;
|
|
2067
1997
|
//#endregion
|
|
2068
1998
|
//#region src/nodes/response.d.ts
|
|
2069
1999
|
/**
|
|
@@ -2151,9 +2081,12 @@ declare const responseDef: NodeDef<ResponseNode, ResponseInput>;
|
|
|
2151
2081
|
* })
|
|
2152
2082
|
* ```
|
|
2153
2083
|
*/
|
|
2154
|
-
declare const createResponse: (input: ResponseInput
|
|
2084
|
+
declare const createResponse: (input: ResponseInput) => ResponseNode;
|
|
2155
2085
|
//#endregion
|
|
2156
2086
|
//#region src/nodes/operation.d.ts
|
|
2087
|
+
/**
|
|
2088
|
+
* HTTP method an operation responds to.
|
|
2089
|
+
*/
|
|
2157
2090
|
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'TRACE';
|
|
2158
2091
|
/**
|
|
2159
2092
|
* Transport an operation belongs to.
|
|
@@ -2466,5 +2399,5 @@ declare function createOutput(overrides?: Partial<Omit<OutputNode, 'kind'>>): Ou
|
|
|
2466
2399
|
*/
|
|
2467
2400
|
type Node = InputNode | OutputNode | OperationNode | SchemaNode | PropertyNode | ParameterNode | ResponseNode | RequestBodyNode | ContentNode | FunctionParamNode | FileNode | ImportNode | ExportNode | SourceNode | ConstNode | TypeNode | FunctionNode | ArrowFunctionNode;
|
|
2468
2401
|
//#endregion
|
|
2469
|
-
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,
|
|
2470
|
-
//# 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
|